News:

Download Pelles C here: http://www.smorgasbordet.com/pellesc/

Main Menu

Compilation order

Started by jev, October 17, 2012, 12:23:33 PM

Previous topic - Next topic

jev

I was hoping "update all dependencies" in the IDE's workspace manager would also find dependencies on libraries, but it doesn't or it doesn't work...

So, I got a workspace in the IDE that contains 2 projects. One project builds a DLL (and a static library that defines the DLL's interface of course) that is needed by the other project. Is it possible to configure the workspace so that the DLL is built first and the other project -which depends on it- is built later?


TimoVJL

Quote from: jev on October 17, 2012, 12:23:33 PM
Is it possible to configure the workspace so that the DLL is built first and the other project -which depends on it- is built later?
Project -> Workspace -> Project dependencies
May the source be with you

jev

Ah yes, thanks. Don't know how I could have missed that.

Here's a strange one... one of the projects is called "libtest" and it should generate "libtest.exe". Sometimes (but not always) the linker thinks it must generate a library from this project, but the executable is updated too. How weird is that?

- - - - - - - - - - libtest.exe
Building main_test.obj.
Building libtest.exe.
Creating object: C:\Users\jev\Documents\Pelles C Projects\CB0005\libtest.exp
Creating library: C:\Users\jev\Documents\Pelles C Projects\CB0005\libtest.lib
Writing debug information
Compacting CodeView information
Done.

CommonTater

#3
Quote from: jev on October 17, 2012, 06:24:41 PM
Ah yes, thanks. Don't know how I could have missed that.

Here's a strange one... one of the projects is called "libtest" and it should generate "libtest.exe". Sometimes (but not always) the linker thinks it must generate a library from this project, but the executable is updated too. How weird is that?

- - - - - - - - - - libtest.exe
Building main_test.obj.
Building libtest.exe.
Creating object: C:\Users\jev\Documents\Pelles C Projects\CB0005\libtest.exp
Creating library: C:\Users\jev\Documents\Pelles C Projects\CB0005\libtest.lib
Writing debug information
Compacting CodeView information
Done.


Are your projects by chance all in the same folder? 
If they are they will be sharing one OUTPUT folder that could be part of the problem. 

If you use the Workspace Manager AddIn and re-create your projects with it this problem is overcome since each project gets it's own separate output folder.

Installation is easy... read the FAQ about AddIns for details.

TimoVJL

Quote from: jev on October 17, 2012, 06:24:41 PM
Ah yes, thanks. Don't know how I could have missed that.

Here's a strange one... one of the projects is called "libtest" and it should generate "libtest.exe". Sometimes (but not always) the linker thinks it must generate a library from this project, but the executable is updated too. How weird is that?

- - - - - - - - - - libtest.exe
Building main_test.obj.
Building libtest.exe.
Creating object: C:\Users\jev\Documents\Pelles C Projects\CB0005\libtest.exp
Creating library: C:\Users\jev\Documents\Pelles C Projects\CB0005\libtest.lib
Writing debug information
Compacting CodeView information
Done.

Is it possible that libtest.exe have exported functions ?
May the source be with you

jev

#5
Quote from: CommonTater on October 17, 2012, 06:33:51 PM
Are your projects by chance all in the same folder? 
If they are they will be sharing one OUTPUT folder that could be part of the problem. 
Yes, they share the same output folder. Still, the names are not the same, there should really be no problem there. Will take a look at the workspace manager addin but still it smells buggy.

Quote from: timovjl on October 17, 2012, 07:18:21 PM
Is it possible that libtest.exe have exported functions ?
Nope.

Are you suggesting the tools do some guesswork on how to build things based on the contents of the sources? That would be very strange IMHO.


CommonTater

#6
Quote from: jev on October 23, 2012, 12:07:56 PM
Quote from: CommonTater on October 17, 2012, 06:33:51 PM
Are your projects by chance all in the same folder? 
If they are they will be sharing one OUTPUT folder that could be part of the problem. 
Yes, they share the same output folder. Still, the names are not the same, there should really be no problem there. Will take a look at the workspace manager addin but still it smells buggy.

Ummm... "Smells buggy"?  In what way?

CommonTater

Quote from: timovjl on October 17, 2012, 07:18:21 PM
Is it possible that libtest.exe have exported functions ?

Or... misnamed import functions?

TimoVJL

#8
Maybe there is header file with something like this:
__declspec(dllexport) void _cdecl foo(void);

For example
//Test_Main.c
#include "TestLib.h"
// in TestLib.h is this line:
//__declspec(dllexport) void _cdecl foo(void);
int main(int argc, char **argv) {
foo();
return 0;
}
Building TestLib.exe.
Creating object: C:\code\PellesC\Forum\jev\TestLib.exp
Creating library: C:\code\PellesC\Forum\jev\TestLib.lib
Writing debug information
Compacting CodeView information
Done.
//TestLibS.c
__declspec(dllexport) void _cdecl foo(void) {};
May the source be with you