Reputation: 355
In building a my application, I have a fairly long list of *.Lib files required for compilation. Here is my compilation instruction:
Bin\cl.exe Main.cpp /EHsc /I atlmfc\include /I Includes /I Includes\Winsdk atlmfc\lib\amd64\nafxcw.Lib Libs\libcmt.lib Libs\Kernel32.Lib Libs\User32.Lib Libs\Gdi32.Lib Libs\MSImg32.Lib Libs\ComDlg32.Lib Libs\WinSpool.Lib Libs\AdvAPI32.Lib Libs\Shell32.Lib Libs\ComCtl32.Lib Libs\ShLwApi.Lib Libs\Uuid.lib atlmfc\lib\amd64\atls.lib Libs\Ole32.Lib Libs\OleAut32.Lib Libs\oldnames.lib Libs\WS2_32.Lib Libs\MsWSock.Lib Libs\OleAcc.Lib Libs\comsuppw.lib Libs\GdiPlus.lib Libs\Imm32.Lib Libs\WinMM.Lib Libs\MsXml2.Lib Libs\OleDlg.Lib Libs\Urlmon.Lib /link/SUBSYSTEM:WINDOWS
All of these files are in the same directory. Well, one or two directories anyway. Is there some way that I can just tell the compiler to look in those directories for files that it needs, instead of typing out every single one?
Upvotes: 2
Views: 2298
Reputation:
Are you looking for http://www.lavishsoft.com/wiki/index.php/Visual_Studio_Paths or http://msdn.microsoft.com/en-us/library/1xhzskbe(v=vs.80).aspx? As already explained by Roman R. you can use the pragma command afterwards in your files. This way you can always see which libs are required without looking at the project configuration. If you don't want to use the pragma command there should be a linker section in your project configuration where you can add the libs.
Upvotes: 1