How to solve "Apple Mach-O Linker (id) Error".

Hello, everyone.

I’m beginner of OF.
I’m trying to use ofxOpenCv and make “color tracker”.
Just like this video.
http://www.youtube.com/watch?v=yuSbbVwHdI0&feature=related

The first step to make color tracker, I tried to do the following site’s sample.
http://d.hatena.ne.jp/afeq/20101025/1287932718
So, I copied and pasted the sorce code and add ofxOpenCv addons.
But, I couldn’t compile, and it was displayed the following error.

issues:
Apple Mach-O Linker (id) Error
“testApp::mouseMoved(int, int)”, referenced from:

Apple Mach-O Linker (id) Error
“testApp::mouseDragged(int, int, int)”, referenced from:

Apple Mach-O Linker (id) Error
“testApp::mouseReleased(int, int, int)”, referenced from:

Apple Mach-O Linker (id) Error
“testApp::keyPressed(int)”, referenced from:

Apple Mach-O Linker (id) Error
“testApp::keyReleased(int)”, referenced from:

Apple Mach-O Linker (id) Error
“testApp::windowResized(int, int)”, referenced from:

concrete content of issues
Ld bin/opencvStudy_01Debug.app/Contents/MacOS/opencvStudy_01Debug normal i386
cd “/Users/MYPCNAME/Documents/of_0071_osx_release/apps/myApps/opencvStudy_01”
/Developer/usr/bin/llvm-g+±4.2 -arch i386 “-L/Users/MYPCNAME 1/Documents/of_0071_osx_release/apps/myApps/opencvStudy_01/bin” “-L/Users/MYPCNAME 1/Documents/of_0071_osx_release/apps/myApps/opencvStudy_01/…/…/…/…/of_preRelease_v007_osx/addons/ofxOpenCv/libs/opencv/lib/osx” “-L/Users/MYPCNAME 1/Documents/of_0071_osx_release/apps/myApps/opencvStudy_01/…/…/…/addons/ofxOpenCv/libs/opencv/lib/osx” “-F/Users/MYPCNAME/Documents/of_0071_osx_release/apps/myApps/opencvStudy_01/bin” “-F/Users/MYPCNAME /Documents/of_0071_osx_release/apps/myApps/opencvStudy_01/…/…/…/libs/glut/lib/osx” -filelist “/Users/MYPCNAME 1/Documents/of_0071_osx_release/apps/myApps/opencvStudy_01/build/opencvStudy_01.build/Debug/opencvStudy_01.build/Objects-normal/i386/opencvStudy_01Debug.LinkFileList” -dead_strip …/…/…/libs/poco/lib/osx/PocoCrypto.a …/…/…/libs/poco/lib/osx/PocoData.a …/…/…/libs/poco/lib/osx/PocoDataODBC.a …/…/…/libs/poco/lib/osx/PocoDataSQLite.a …/…/…/libs/poco/lib/osx/PocoFoundation.a …/…/…/libs/poco/lib/osx/PocoNet.a …/…/…/libs/poco/lib/osx/PocoNetSSL.a …/…/…/libs/poco/lib/osx/PocoUtil.a …/…/…/libs/poco/lib/osx/PocoXML.a …/…/…/libs/poco/lib/osx/PocoZip.a …/…/…/libs/tess2/lib/osx/tess2.a …/…/…/libs/glew/lib/osx/glew.a …/…/…/libs/cairo/lib/osx/cairo-script-interpreter.a …/…/…/libs/cairo/lib/osx/cairo.a …/…/…/libs/cairo/lib/osx/pixman-1.a …/…/…/libs/fmodex/lib/osx/libfmodex.dylib …/…/…/libs/rtAudio/lib/osx/rtAudio.a -framework GLUT “/Users/MYPCNAME 1/Documents/of_0071_osx_release/libs/openFrameworksCompiled/lib/osx/openFrameworksDebug.a” -framework AGL -framework ApplicationServices -framework AudioToolbox -framework Carbon -framework CoreAudio -framework CoreFoundation -framework CoreServices -framework OpenGL -framework QuickTime -framework AppKit -framework Cocoa -framework IOKit “/Users/MYPCNAME 1/Documents/of_0071_osx_release/apps/myApps/opencvStudy_01/…/…/…/addons/ofxOpenCv/libs/opencv/lib/osx/opencv.a” -o “/Users/MYPCNAME 1/Documents/of_0071_osx_release/apps/myApps/opencvStudy_01/bin/opencvStudy_01Debug.app/Contents/MacOS/opencvStudy_01Debug”

Undefined symbols for architecture i386:
“testApp::mouseMoved(int, int)”, referenced from:
vtable for testAppin testApp.o
“testApp::mouseDragged(int, int, int)”, referenced from:
vtable for testAppin testApp.o
“testApp::mouseReleased(int, int, int)”, referenced from:
vtable for testAppin testApp.o
“testApp::keyPressed(int)”, referenced from:
vtable for testAppin testApp.o
“testApp::keyReleased(int)”, referenced from:
vtable for testAppin testApp.o
“testApp::windowResized(int, int)”, referenced from:
vtable for testAppin testApp.o
ld: symbol(s) not found for architecture i386
collect2: ld returned 1 exit status

note:
-My xcode version is “4.0.2”
-My OS is “OSX snow leopard”
-My OF version is “of_0071_osx_release”

If you know how to solve those error, please teach me.

Thanks very much for your help.

My best guess would be that you check in your testApp.h if the following functions are listed:

  • mouseMoved

  • mouseDragged

  • mouseReleased

  • keyPressed

  • keyReleased

  • windowResized

And do the same in testApp.cpp. I believe they are only in one of those both files.

in testApp.h you would put their declaration, such as:

void mouseMoved(int x, int y, int button);

in testApp.cpp you would put their code:

void testApp::mouseMoved(int x, int y, int button){
// Do stuff when mouse is moved.
}

Hi, Meach.

Thank you for your cooperation!
Thanks to your advice, I could run my program.
This was an elementary mistake.

I always feel that your help give me a charge.
I really appreciate cooperation of the member of this community.

sincerely yours,
hoshi427