views:

395

answers:

1

I'm porting some Visual Studio 2008/VC9 stuff to Code::Blocks/MinGW and for some reason the linker cannot find a static library from another project in the workspace.

In Visual Studio 2008 I could just set the static lib project as a dependency, and it would build in the right order (i.e. static lib needs to be built before linking the other project), and link the correct library for the configuration.

I couldn't find such an option in Code::Blocks, so I made sure to explicitly build the static lib first (libcommon.a) then under "build options" for the other project add "libcommon.a" in the "linker settings". The .a file is located in the same directory as the project files, however I still get an error from the linker of the other projects saying they cant find it...

ld.exe cannot find -lcommon

What am I doing so it cant find the library, even though its right next to the projects file?

Also is there a better way to simulate the Visual Studio dependencies within a single solution/workspace?

A: 

Apparently the directory containing the project files is not included in the linker search path, and needed to be defined explicitly by adding ".\" to the list of directories containg library files for the projects.

Fire Lancer