VS2010 Linking errors

Hi
I am new in OF and I am using vs2010 and when I am programming my own applications with using the built-in addons and examples it successfully works, but when I reuse a shared source or addon from other developers like ofxbox2d, ofxblobtracker or any external codes I faced problem with linking after following the steps and resolving the problems of the include directories ans libs. and this is one of the logs I found.

Debug mode:

1>------ Rebuild All started: Project: openframeworksLib, Configuration: Debug Win32 ------
1> ofSerial.cpp
1> ofArduino.cpp
1> ofVideoPlayer.cpp
1> ofVideoGrabber.cpp
1> ofQtUtils.cpp
1> ofUtils.cpp
1> ofMath.cpp
1> ofSoundStream.cpp
1> ofSoundPlayer.cpp
1> ofTrueTypeFont.cpp
1> ofTexture.cpp
1> ofImage.cpp
1> ofGraphics.cpp
1> ofBitmapFont.cpp
1> ofAppRunner.cpp
1> ofAppGlutWindow.cpp
1> Generating Code…
1> openframeworksLib.vcxproj -> C:\Users\ADMIN\Desktop\Multitouch Stuff\Libraries and Frameworks\OF_VS2010\of_preRelease_v0062_vs2010_FAT\of_preRelease_v0062_vs2010_FAT\libs\openFrameworksCompiled\project\vs2010…\lib\vs2010\openframeworksLibDebug.lib
2>------ Rebuild All started: Project: emptyExample, Configuration: Debug Win32 ------
2> testApp.cpp
2> main.cpp
2> Generating Code…
2>main.obj : warning LNK4075: ignoring ‘/EDITANDCONTINUE’ due to ‘/INCREMENTAL:NO’ specification
2>main.obj : error LNK2019: unresolved external symbol “public: __thiscall ofxCvColorImage::ofxCvColorImage(void)” (??0ofxCvColorImage@@QAE@XZ) referenced in function “public: __thiscall testApp::testApp(void)” (??0testApp@@QAE@XZ)
2>main.obj : error LNK2019: unresolved external symbol “public: virtual __thiscall ofxCvImage::~ofxCvImage(void)” (??1ofxCvImage@@UAE@XZ) referenced in function “public: virtual __thiscall ofxCvColorImage::~ofxCvColorImage(void)” (??1ofxCvColorImage@@UAE@XZ)
2>testApp.obj : error LNK2001: unresolved external symbol “public: virtual __thiscall ofxCvImage::~ofxCvImage(void)” (??1ofxCvImage@@UAE@XZ)
2>testApp.obj : error LNK2019: unresolved external symbol “public: __thiscall ofxCvColorImage::ofxCvColorImage(class ofxCvColorImage const &)” (??0ofxCvColorImage@@QAE@ABV0@@Z) referenced in function “public: virtual void __thiscall testApp::update(void)” (?update@testApp@@UAEXXZ)
2>testApp.obj : error LNK2019: unresolved external symbol _cvCreateMemStorage referenced in function “public: void __thiscall headmanager::allocate(int,int)” (?allocate@headmanager@@QAEXHH@Z)
2>testApp.obj : error LNK2019: unresolved external symbol _cvLoad referenced in function “public: void __thiscall headmanager::allocate(int,int)” (?allocate@headmanager@@QAEXHH@Z)
2>testApp.obj : error LNK2019: unresolved external symbol _cvCreateImage referenced in function “public: void __thiscall headmanager::allocate(int,int)” (?allocate@headmanager@@QAEXHH@Z)
2>testApp.obj : error LNK2019: unresolved external symbol _cvGetSeqElem referenced in function “public: void __thiscall headmanager::detect(class ofxCvColorImage)” (?detect@headmanager@@QAEXVofxCvColorImage@@@Z)
2>testApp.obj : error LNK2019: unresolved external symbol _cvGetTickFrequency referenced in function “public: void __thiscall headmanager::detect(class ofxCvColorImage)” (?detect@headmanager@@QAEXVofxCvColorImage@@@Z)
2>testApp.obj : error LNK2019: unresolved external symbol _cvHaarDetectObjects referenced in function “public: void __thiscall headmanager::detect(class ofxCvColorImage)” (?detect@headmanager@@QAEXVofxCvColorImage@@@Z)
2>testApp.obj : error LNK2019: unresolved external symbol _cvGetTickCount referenced in function “public: void __thiscall headmanager::detect(class ofxCvColorImage)” (?detect@headmanager@@QAEXVofxCvColorImage@@@Z)
2>testApp.obj : error LNK2019: unresolved external symbol _cvClearMemStorage referenced in function “public: void __thiscall headmanager::detect(class ofxCvColorImage)” (?detect@headmanager@@QAEXVofxCvColorImage@@@Z)
2>testApp.obj : error LNK2019: unresolved external symbol _cvResize referenced in function “public: void __thiscall headmanager::detect(class ofxCvColorImage)” (?detect@headmanager@@QAEXVofxCvColorImage@@@Z)
2>testApp.obj : error LNK2019: unresolved external symbol _cvCvtColor referenced in function “public: void __thiscall headmanager::detect(class ofxCvColorImage)” (?detect@headmanager@@QAEXVofxCvColorImage@@@Z)
2>bin\emptyExample_debug.exe : fatal error LNK1120: 13 unresolved externals
========== Rebuild All: 1 succeeded, 1 failed, 0 skipped ==========

Release Mode:

1>------ Build started: Project: openframeworksLib, Configuration: Release Win32 ------
1> openframeworksLib.vcxproj -> C:\Users\ADMIN\Desktop\Multitouch Stuff\Libraries and Frameworks\OF_VS2010\of_preRelease_v0062_vs2010_FAT\of_preRelease_v0062_vs2010_FAT\libs\openFrameworksCompiled\project\vs2010…\lib\vs2010\openframeworksLib.lib
2>------ Build started: Project: emptyExample, Configuration: Release Win32 ------
2> main.cpp
2> testApp.cpp
2> Generating Code…
2>main.obj : error LNK2019: unresolved external symbol “public: virtual __thiscall ofxCvImage::~ofxCvImage(void)” (??1ofxCvImage@@UAE@XZ) referenced in function “public: virtual __thiscall ofxCvColorImage::~ofxCvColorImage(void)” (??1ofxCvColorImage@@UAE@XZ)
2>testApp.obj : error LNK2001: unresolved external symbol “public: virtual __thiscall ofxCvImage::~ofxCvImage(void)” (??1ofxCvImage@@UAE@XZ)
2>main.obj : error LNK2019: unresolved external symbol “public: __thiscall ofxCvColorImage::ofxCvColorImage(void)” (??0ofxCvColorImage@@QAE@XZ) referenced in function “public: __thiscall testApp::testApp(void)” (??0testApp@@QAE@XZ)
2>testApp.obj : error LNK2019: unresolved external symbol _cvCreateMemStorage referenced in function “public: void __thiscall headmanager::allocate(int,int)” (?allocate@headmanager@@QAEXHH@Z)
2>testApp.obj : error LNK2019: unresolved external symbol _cvLoad referenced in function “public: void __thiscall headmanager::allocate(int,int)” (?allocate@headmanager@@QAEXHH@Z)
2>testApp.obj : error LNK2019: unresolved external symbol _cvCreateImage referenced in function “public: void __thiscall headmanager::allocate(int,int)” (?allocate@headmanager@@QAEXHH@Z)
2>testApp.obj : error LNK2019: unresolved external symbol _cvGetSeqElem referenced in function “public: void __thiscall headmanager::detect(class ofxCvColorImage)” (?detect@headmanager@@QAEXVofxCvColorImage@@@Z)
2>testApp.obj : error LNK2019: unresolved external symbol _cvGetTickFrequency referenced in function “public: void __thiscall headmanager::detect(class ofxCvColorImage)” (?detect@headmanager@@QAEXVofxCvColorImage@@@Z)
2>testApp.obj : error LNK2019: unresolved external symbol _cvHaarDetectObjects referenced in function “public: void __thiscall headmanager::detect(class ofxCvColorImage)” (?detect@headmanager@@QAEXVofxCvColorImage@@@Z)
2>testApp.obj : error LNK2019: unresolved external symbol _cvGetTickCount referenced in function “public: void __thiscall headmanager::detect(class ofxCvColorImage)” (?detect@headmanager@@QAEXVofxCvColorImage@@@Z)
2>testApp.obj : error LNK2019: unresolved external symbol _cvClearMemStorage referenced in function “public: void __thiscall headmanager::detect(class ofxCvColorImage)” (?detect@headmanager@@QAEXVofxCvColorImage@@@Z)
2>testApp.obj : error LNK2019: unresolved external symbol _cvResize referenced in function “public: void __thiscall headmanager::detect(class ofxCvColorImage)” (?detect@headmanager@@QAEXVofxCvColorImage@@@Z)
2>testApp.obj : error LNK2019: unresolved external symbol _cvCvtColor referenced in function “public: void __thiscall headmanager::detect(class ofxCvColorImage)” (?detect@headmanager@@QAEXVofxCvColorImage@@@Z)
2>testApp.obj : error LNK2019: unresolved external symbol “public: __thiscall ofxCvColorImage::ofxCvColorImage(class ofxCvColorImage const &)” (??0ofxCvColorImage@@QAE@ABV0@@Z) referenced in function “public: virtual void __thiscall testApp::update(void)” (?update@testApp@@UAEXXZ)
2>bin\emptyExample.exe : fatal error LNK1120: 13 unresolved externals
========== Build: 1 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

So please would anyonehelp me resolving this problem.

I’m also new to this and running into the same issues. Seems like I can sometimes get things fixed by jiggling the handle (adding the header files to my project), but in some cases not. If anyone can point me in the right direction it would be much appreciated. Thanks!

[edit: I just added every single header file it couldn’t seem to locate into my project. That fixed it, but I need to bone up on some basic programming it seems like I’m doing something unnecessary]

I came across the same error when trying to build ofxBox2D. I have been using xCode on mac but I had to switch to a PC for development so I am fairly new to the quirks of visual studio. After adding the includes and header paths I had to add every class from the original Box2D into my VS project. After I did that my project compiled fine. Hope that helps!

I also get linker errors, though there are different from those previously mentioned. Does anyone have insight into this? Something looks wrong with ofPoint.obj. I believe it’s caused by my linker settings, though I can’t determine what’s wrong.

1> Generating Code…
1>ofPoint.obj : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library
1>ofBaseSoundStream.obj : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library
1>ofBaseSoundPlayer.obj : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library
1>------ Build started: Project: emptyExample, Configuration: Debug Win32 ------

1> Generating Code…

1> Creating library bin\emptyExample_debug.lib and object bin\emptyExample_debug.exp
1>LINK : warning LNK4098: defaultlib ‘MSVCRT’ conflicts with use of other libs; use /NODEFAULTLIB:library
1>ofxBox2d.obj : error LNK2019: unresolved external symbol “public: __thiscall b2DebugDraw::b2DebugDraw(void)” (??0b2DebugDraw@@QAE@XZ) referenced in function “public: __thiscall ofxBox2dRender::ofxBox2dRender(void)” (??0ofxBox2dRender@@QAE@XZ)

1>bin\emptyExample_debug.exe : fatal error LNK1120: 41 unresolved externals
========== Build: 0 succeeded, 1 failed, 1 up-to-date, 0 skipped ==========

To attempt a fix, I followed the instructions at http://msdn.microsoft.com/en-us/library/3tz4da4a(v=vs.80.aspx to use /NODEFAULT. This solution led to a slew of errors beginning with 2>PocoFoundationmdd.lib(MemoryPool.obj) : error LNK2001: unresolved external symbol __RTC_CheckEsp

I’m using VS2010 and of_preRelease_v007_vs2010.

Thanks.

Is there another venue that’s more appropriate for my above question? I’d very much like to hunt down an answer and get a project unblocked.

Thanks.

The linker can’t find the library you’re adding, are you just trying to compile one of the example applications or did you create the solution file yourself?

I tried two approaches. First, I created the solution file myself. Then I used the one supplied in the oF download that has all add-ons included. I ran into the same error with both.

How can I tell the linker can’t find the library? The message “defaultlib ‘MSVCRT’ conflicts with use of other libs” seems to indicate two or more things are in conflict.

Until recently, I’m almost exclusively a Linux person. Perhaps the error is in part due to lack of education on my part. Is there a good, semi-short resource to prep the oF community using VS on how to deal with linker errors?

Thanks for the assistance.