C++ – How to link a .lib file without putting them into the compilers library folder


Is there a way in my code that I can link to the library files I need so that I do not have to setup each individual compiler I use?

I want to be able to use Visual C++.net 2005, G++, etc. I am trying to make a cross platform game engine, but some platforms use a custom compiler and I want to make my engine as versatile as possible.

Best Solution

There is a tool called mpc that can create both makefiles and VC projects from the same mpc DSL. If you would use that tool you would specify the link dependencies (libraries) once in the pmc files and it would generate makefiles for g++ and project files for Visual Studio that contain the necessary information on how to link your libraries.

From the mpc homepage:

supports multiple versions of make (GNU, Microsoft, Borland, Automake), Visual C++ 6.0 and Visual Studio 2003, 2005 and 2008.

Related Question