visual c++ - Keep VC++ 2005 static library and your application in separate solutions -


i have built static library described in walkthrough: http://msdn.microsoft.com/en-us/library/ms235627%28v=vs.80%29.aspx

in example above, both static library , application located within same solution prefer keep them in separate solutions. after separation, can compile cannot link, here error:

main.obj : error lnk2019: unresolved external symbol… 

then tried project level setting of application c/c++ / general / additional include directories .h file resides.

i set .. linker / general / additional library directories .lib file at.

i set .. linker / input / additional dependencies .lib file at.

again, compile not link. here entire link error:

link : warning lnk4075: ignoring '/incremental' due '/opt:icf' specification main.obj : error lnk2019: unresolved external symbol "public: static double __cdecl mathfuncs::mymathfuncs::add(double,double)" (?add@mymathfuncs@mathfuncs@@sannn@z) referenced in function _main release\staticlibraryapp.exe : fatal error lnk1120: 1 unresolved externals 

your project should link against library project. in 2nd project properties, add library path .lib file stored , include path header path. should resolve issue. make 1st project dependent on 2nd solution.

have @ below article how add libraries: http://www.lavishsoft.com/wiki/index.php/visual_studio_paths


Comments

Popular posts from this blog

c++ - CryptStringToBinary API behavior -

c++ - Correct method for redrawing a layered window -

java.util.scanner - How to read and add only numbers to array from a text file -