Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

reg. compiling ofxFaceTracker #32

Closed
tommysky opened this issue Oct 21, 2012 · 34 comments
Closed

reg. compiling ofxFaceTracker #32

tommysky opened this issue Oct 21, 2012 · 34 comments

Comments

@tommysky
Copy link

Hi, dear Kyle,

I tried your work, FaceOSC_win. It is AMAZING! I tried to compile ofxFaceTracker to get FaceOSC_win but met errors and hope get you helps. I use 64-bit windows 7 and VS2010.


The error is:
ContourFinder.obj : error LNK2019: unresolved external symbol "float cdecl ofxCv::trackingDistance(class cv::Rect const &,class cv::Rect const &)"


  1. I downloaded "openFrameWork 0072 under VS2010" at ttp://www.openframeworks.cc/download/.
  2. I then downloaded "ofxFaceTracker". I modified its file name "kylemcdonald-ofxFaceTracker-15060b2" as "ofxFaceTracker" and copied it into addons of "openFrameWrok at (..\of_v0072_vs2010_release\addons).
  3. I found "ofxFraceTracker" needs "ofxCv" and then downloaded it and copied it into addons (same as above).
  4. I run "projectGenerator.exe" of "openFramework" and added "ofxFraceTracker", "ofxOpenCv" and "ofxCv" as addons. After compiling generated "mySketch" using VS2010, I met the error in the top. Plus, I added codes as what the page of ofxCv said.

I really hope to get your helps, because it is supposed to be helpful to my current project. Sorry to bother you. I'll appreciate for your supports.

@kylemcdonald
Copy link
Owner

Try switching to the develop branch of ofxCv and ofxFaceTracker. I can merge them to master later but it should fix your problem.

On Oct 21, 2012, at 1:53 PM, yanjia [email protected] wrote:

Hi, dear Kyle,

I tried your work, FaceOSC_win. It is AMAZING! I tried to compile ofxFaceTracker to get FaceOSC_win but met errors and hope get you helps. I use 64-bit windows 7 and VS2010.

The error is:
ContourFinder.obj : error LNK2019: unresolved external symbol "float _cdecl ofxCv::trackingDistance(class cv::Rect const &,class cv::Rect const &)" (?trackingDistance@ofxCv@@YAMABV?$Rect@H@cv@@0@Z) referenced in function "public: virtual class std::vector > & thiscall ofxCv::Tracker::track(class std::vector,class std::allocator > > const &)" (?track@?$Tracker@V?$Rect@H@cv@@@ofxCv@@UAEAAV?$vector@IV?$allocator@I@std@@@std@@abv?$vector@V?$Rect@H@cv@@v?$allocator@V?$Rect@h@cv@@@std@@@4@@z)

I downloaded "openFrameWork 0072 under VS2010" at ttp://www.openframeworks.cc/download/.
I then downloaded "ofxFaceTracker". I modified its file name "kylemcdonald-ofxFaceTracker-15060b2" as "ofxFaceTracker" and copied it into addons of "openFrameWrok at (..\of_v0072_vs2010_release\addons).
I found "ofxFraceTracker" needs "ofxCv" and then downloaded it and copied it into addons (same as above).
I run "projectGenerator.exe" of "openFramework" and added "ofxFraceTracker", "ofxOpenCv" and "ofxCv" as addons. After compiling generated "mySketch" using VS2010, I met the error in the top. Plus, I added codes as what the page of ofxCv said.
I really hope to get your helps, because it is supposed to be helpful to my current project. Sorry to bother you. I'll appreciate for your supports.

Regards,

Yanjia


Reply to this email directly or view it on GitHub.

@tommysky
Copy link
Author

Hi, kyle, I cannot understand "switching to the develop branch of ofxCv and ofxFaceTracker"... Could you give me deeper guides? Or, I wonder if you could send me your entire project of FaceOSC_win for study? Thank you.

@kylemcdonald
Copy link
Owner

ok, i merged the changes from the develop branch to the master branch. so don't worry about doing what i said -- just get the latest copy of both ofxCv (be45a2bb88) and ofxFacetrackerd (5263d1ab2).

i think the reason that you were getting a problem was because there is ofxCv/Tracker.h and also FaceTracker/Tracker.h and they were conflicting with each other. but i made some changes that should keep this from happening.

so could you re-download both, and re-generate the project files? please let me know if there is the same error, or a new error, or if it works.

@tommysky
Copy link
Author

Hi, Kyle, the error is as below this time, but it seems to be the same error as before.

error LNK2019: unresolved external symbol "float cdecl ofxCv::trackingDistance(class cv::Rect const &,class cv::Rect const &)" (?trackingDistance@ofxCv@@YAMABV?$Rect_@H@cv@@0@Z) referenced in function "public: virtual class std::vector<unsigned int,class std::allocator > & thiscall ofxCv::Tracker<class cv::Rect >::track(class std::vector<class cv::Rect,class std::allocator<class cv::Rect_ > > const &)" (?track@?$Tracker@V?$Rect_@H@cv@@@ofxCv@@UAEAAV?$vector@IV?$allocator@I@std@@@std@@abv?$vector@V?$Rect_@H@cv@@v?$allocator@V?$Rect_@H@cv@@@std@@@4@@z)

@tommysky
Copy link
Author

Hi, dear Kyle, do you have any idea?

@Dewb
Copy link

Dewb commented Oct 25, 2012

Can you try building some of the ofxCV samples and see if you get the same error?

@tommysky
Copy link
Author

Hi, Dewb, I'm new and wonder where I can find ofxCV samples for testing? Thank you.

@kylemcdonald
Copy link
Owner

ah, maybe i misunderstood this issue -- is it possible you haven't downloaded ofxCv? grab it here: https://github.com/kylemcdonald/ofxCv

the examples are all available in the repository, just try running them. if those work, but the ofxFaceTracker example still doesn't, then try using the 0072 projectGenerator to create an ofxOpenCv + ofxCv + ofxFaceTracker project.

@tommysky
Copy link
Author

Hi, dear Kyle. Following what you said, I created an ofxOpenCv + ofxCv + ofxFaceTracker project using 0072 projectGenerator but I still met the same error as before. BTW, ofxCV samples work well.

@tommysky
Copy link
Author

About ofxFaceTracker examples, I don't know how to run them using VS2010. Please give me the hints. Thanks.

@kylemcdonald
Copy link
Owner

if ofxCv works but not ofxFaceTracker, i recommend adding the ofxFaceTracker files to an ofxCv project by hand.

also, i'm thinking of combining the ofxCv and ofxFaceTracker repositories, which should simplify this a little.

@tommysky
Copy link
Author

Hi, Klye, I manually copied all ofxFaceTracker/ files into the corresponding directory of ofxCV/ without .gitignore file, but errors still exist as bellow.

  1. error LNK2019: unresolved external symbol "public: void __thiscall FACETRACKER::Tracker::Load(char const *)"
  2. error LNK2019: unresolved external symbol "public: int __thiscall FACETRACKER::Tracker::Track(class cv::Mat,class std::vector<int,class std::allocator > &,int,int,double,double,bool)"

@tommysky
Copy link
Author

Plus, I don't test ofxFraceTracker samples yet, because I have no idea how to run them using VS2010.

@tommysky
Copy link
Author

Hi, Kyle, I searched my errors through Google, but didn't get satisfied solutions. I wonder if you could provide me your entire project of ofxFaceTracker you compiled using VS2010. Let me try if I still have the same errors? Thank you.

@kylemcdonald
Copy link
Owner

i'm sorry, i didn't use visual studio to build FaceOSC on windows -- i used code::blocks. so i haven't posted a visual studio project before. i'm going to take a look right now.

@kylemcdonald
Copy link
Owner

i just built vs2010 projects for ofxFaceTracker successfully. i got the same error that you had, but when i googled the error number i found this solution http://stackoverflow.com/a/3731643 which fixed it.

@tommysky
Copy link
Author

tommysky commented Nov 4, 2012

Hi, dear Kyle, I appreciate for your helps! ofxFaceTracker examples was indeed built successfully, but when they be run they are aborted. Assertion failed: s.is_open() at file ..\libs\facetracker\src\lib\Tracker.cc line 59. I tested example-expression and example-extraction. BTW, ofxCV examples are still run well.

I also met some strange problems on new ofxFaceTracker file and report you. I wonder if you have the same problems.

  1. ofxFaceTracker examples can be built. The premise is that all ofxFaceTracker examples should be in theSUB-directory of ofxFaceTracker (renamed from ofxFaceTracker-master). Errors pop out if use "ofxFaceTracker-master" as root name.
  2. ofxOpenCv + ofxCv + ofxFaceTracker project using 0072 projectGenerator
    If I want to build the new project like faceOSC-win successfully, ofxFaceTracker examples should be in the SUB-SUB-directory of ofxFaceTracker, otherwise the early error will occur. However, examples cannot be opened successfully in the SUB-SUB-directory. Furthermore, the new project looks like an empty project whose effect is not same as faceOSC-win when I run it. I wonder if I need write some codes by myself? Thank you.

@kylemcdonald
Copy link
Owner

all the examples (including faceosc) should stay in their current location, and be compiled from their current location. you shouldn't move them, because the paths are all relative and moving them will break the paths.

if you have an s.is_open() error, you haven't copied your model files into data correctly. please see the readme for more info.

@tommysky
Copy link
Author

tommysky commented Nov 4, 2012

the example faceosc which is not like examples (expression and extraction) does not comtain .sln. I don't know how to build it. Could you give me some hints?

@kylemcdonald
Copy link
Owner

sorry, i forgot that the .sln was not copied over.

try to take a .sln + other files (vcxproj, user files) from another example and then add ofxOsc by hand.

@tommysky
Copy link
Author

tommysky commented Nov 4, 2012

Hi, Kyle, Following what you said, I met the following errors. I'm not clear how to fix them and wonder if I need to do more? Thank you.

main.obj : error LNK2019: unresolved external symbol "public: __thiscall ofxOscBundle::~ofxOscBundle(void)" (??1ofxOscBundle@@QAE@XZ) referenced in function __unwindfunclet$??0testApp@@QAE@XZ$0
1>testApp.obj : error LNK2001: unresolved external symbol "public: __thiscall ofxOscBundle::~ofxOscBundle(void)" (??1ofxOscBundle@@QAE@XZ)
1>main.obj : error LNK2019: unresolved external symbol "public: __thiscall ofxOscSender::~ofxOscSender(void)" (??1ofxOscSender@@QAE@XZ) referenced in function __unwindfunclet$??0testApp@@QAE@XZ$0
1>main.obj : error LNK2019: unresolved external symbol "public: __thiscall ofxOscBundle::ofxOscBundle(void)" (??0ofxOscBundle@@QAE@XZ) referenced in function "public: __thiscall testApp::testApp(void)" (??0testApp@@QAE@XZ)
1>main.obj : error LNK2019: unresolved external symbol "public: __thiscall ofxOscSender::ofxOscSender(void)" (??0ofxOscSender@@QAE@XZ) referenced in function "public: __thiscall testApp::testApp(void)" (??0testApp@@QAE@XZ)
1>testApp.obj : error LNK2019: unresolved external symbol "public: __thiscall ofxXmlSettings::~ofxXmlSettings(void)" (??1ofxXmlSettings@@QAE@XZ) referenced in function "public: void __thiscall testApp::loadSettings(void)" (?loadSettings@testApp@@QAEXXZ)
1>testApp.obj : error LNK2019: unresolved external symbol "public: void __thiscall ofxOscSender::setup(class std::basic_string<char,struct std::char_traits,class std::allocator >,int)" (?setup@ofxOscSender@@QAEXV?$basic_string@DU?$char_traits@D@std@@v?$allocator@D@2@@std@@h@Z) referenced in function "public: void __thiscall testApp::loadSettings(void)" (?loadSettings@testApp@@QAEXXZ)
1>testApp.obj : error LNK2019: unresolved external symbol "public: double __thiscall ofxXmlSettings::getValue(class std::basic_string<char,struct std::char_traits,class std::allocator > const &,double,int)" (?getValue@ofxXmlSettings@@QAENABV?$basic_string@DU?$char_traits@D@std@@v?$allocator@D@2@@std@@nh@Z) referenced in function "public: void __thiscall testApp::loadSettings(void)" (?loadSettings@testApp@@QAEXXZ)
1>testApp.obj : error LNK2019: unresolved external symbol "public: class std::basic_string<char,struct std::char_traits,class std::allocator > __thiscall ofxXmlSettings::getValue(class std::basic_string<char,struct std::char_traits,class std::allocator > const &,class std::basic_string<char,struct std::char_traits,class std::allocator > const &,int)" (?getValue@ofxXmlSettings@@QAE?AV?$basic_string@DU?$char_traits@D@std@@v?$allocator@D@2@@std@@Abv23@0H@Z) referenced in function "public: void __thiscall testApp::loadSettings(void)" (?loadSettings@testApp@@QAEXXZ)
1>testApp.obj : error LNK2019: unresolved external symbol "public: int __thiscall ofxXmlSettings::popTag(void)" (?popTag@ofxXmlSettings@@QAEHXZ) referenced in function "public: void __thiscall testApp::loadSettings(void)" (?loadSettings@testApp@@QAEXXZ)
1>testApp.obj : error LNK2019: unresolved external symbol "public: int __thiscall ofxXmlSettings::getValue(class std::basic_string<char,struct std::char_traits,class std::allocator > const &,int,int)" (?getValue@ofxXmlSettings@@QAEHABV?$basic_string@DU?$char_traits@D@std@@v?$allocator@D@2@@std@@hh@Z) referenced in function "public: void __thiscall testApp::loadSettings(void)" (?loadSettings@testApp@@QAEXXZ)
1>testApp.obj : error LNK2019: unresolved external symbol "public: int __thiscall ofxXmlSettings::getNumTags(class std::basic_string<char,struct std::char_traits,class std::allocator > const &)" (?getNumTags@ofxXmlSettings@@QAEHABV?$basic_string@DU?$char_traits@D@std@@v?$allocator@D@2@@std@@@z) referenced in function "public: void __thiscall testApp::loadSettings(void)" (?loadSettings@testApp@@QAEXXZ)
1>testApp.obj : error LNK2019: unresolved external symbol "public: bool __thiscall ofxXmlSettings::pushTag(class std::basic_string<char,struct std::char_traits,class std::allocator > const &,int)" (?pushTag@ofxXmlSettings@@QAE_NABV?$basic_string@DU?$char_traits@D@std@@v?$allocator@D@2@@std@@h@Z) referenced in function "public: void __thiscall testApp::loadSettings(void)" (?loadSettings@testApp@@QAEXXZ)
1>testApp.obj : error LNK2019: unresolved external symbol "public: bool __thiscall ofxXmlSettings::loadFile(class std::basic_string<char,struct std::char_traits,class std::allocator > const &)" (?loadFile@ofxXmlSettings@@QAE_NABV?$basic_string@DU?$char_traits@D@std@@v?$allocator@D@2@@std@@@z) referenced in function "public: void __thiscall testApp::loadSettings(void)" (?loadSettings@testApp@@QAEXXZ)
1>testApp.obj : error LNK2019: unresolved external symbol "public: __thiscall ofxXmlSettings::ofxXmlSettings(void)" (??0ofxXmlSettings@@QAE@XZ) referenced in function "public: void __thiscall testApp::loadSettings(void)" (?loadSettings@testApp@@QAEXXZ)
1>testApp.obj : error LNK2019: unresolved external symbol "public: __thiscall ofxOscMessage::~ofxOscMessage(void)" (??1ofxOscMessage@@QAE@XZ) referenced in function "public: void __thiscall testApp::addMessage(class std::basic_string<char,struct std::char_traits,class std::allocator >,class ofVec3f)" (??$addMessage@VofVec3f@@@TestApp@@QAEXV?$basic_string@DU?$char_traits@D@std@@v?$allocator@D@2@@std@@VofVec3f@@@z)
1>testApp.obj : error LNK2019: unresolved external symbol "public: void __thiscall ofxOscBundle::addMessage(class ofxOscMessage const &)" (?addMessage@ofxOscBundle@@QAEXABVofxOscMessage@@@z) referenced in function "public: void __thiscall testApp::addMessage(class std::basic_string<char,struct std::char_traits,class std::allocator >,class ofVec3f)" (??$addMessage@VofVec3f@@@TestApp@@QAEXV?$basic_string@DU?$char_traits@D@std@@v?$allocator@D@2@@std@@VofVec3f@@@z)
1>testApp.obj : error LNK2019: unresolved external symbol "public: void __thiscall ofxOscMessage::addFloatArg(float)" (?addFloatArg@ofxOscMessage@@QAEXM@Z) referenced in function "public: void __thiscall testApp::addMessage(class std::basic_string<char,struct std::char_traits,class std::allocator >,class ofVec3f)" (??$addMessage@VofVec3f@@@TestApp@@QAEXV?$basic_string@DU?$char_traits@D@std@@v?$allocator@D@2@@std@@VofVec3f@@@z)
1>testApp.obj : error LNK2019: unresolved external symbol "public: __thiscall ofxOscMessage::ofxOscMessage(void)" (??0ofxOscMessage@@QAE@XZ) referenced in function "public: void __thiscall testApp::addMessage(class std::basic_string<char,struct std::char_traits,class std::allocator >,class ofVec3f)" (??$addMessage@VofVec3f@@@TestApp@@QAEXV?$basic_string@DU?$char_traits@D@std@@v?$allocator@D@2@@std@@VofVec3f@@@z)
1>testApp.obj : error LNK2019: unresolved external symbol "public: void __thiscall ofxOscMessage::addIntArg(int)" (?addIntArg@ofxOscMessage@@qaexh@Z) referenced in function "public: void __thiscall testApp::addMessage(class std::basic_string<char,struct std::char_traits,class std::allocator >,int)" (??$addMessage@H@testApp@@QAEXV?$basic_string@DU?$char_traits@D@std@@v?$allocator@D@2@@std@@h@Z)
1>testApp.obj : error LNK2019: unresolved external symbol "public: void __thiscall ofxOscSender::sendBundle(class ofxOscBundle &)" (?sendBundle@ofxOscSender@@QAEXAAVofxOscBundle@@@z) referenced in function "public: void __thiscall testApp::sendBundle(void)" (?sendBundle@testApp@@QAEXXZ)
1>testApp.obj : error LNK2019: unresolved external symbol "public: class ofxOscMessage & __thiscall ofxOscMessage::copy(class ofxOscMessage const &)" (?copy@ofxOscMessage@@QAEAAV1@ABV1@@z) referenced in function "public: class ofxOscMessage & __thiscall ofxOscMessage::operator=(class ofxOscMessage const &)" (??4ofxOscMessage@@QAEAAV0@ABV0@@z)

@tommysky
Copy link
Author

tommysky commented Nov 4, 2012

Sorry for my posting so many. I'm supposed to select part of them to post.

@tommysky
Copy link
Author

tommysky commented Nov 5, 2012

Hi, Kyle, I also met the familiar errors when I compiled blink example. I wonder if you have same errors.

error LNK2019: unresolved external symbol "public: __thiscall ofxOscSender::
error LNK2019: unresolved external symbol "public: __thiscall ofxOscMessage:

@kylemcdonald
Copy link
Owner

these errors occur when you haven't added ofxOsc to your project correctly. for more information you could try posting on the openFrameworks forum, but i don't have the time right now to craft a compiling example for you. sorry!

@tommysky
Copy link
Author

I see, Kyle. Thank you for your helps recently.

@tommysky
Copy link
Author

Hi, Kyle, checking many times, I still cannot add ofxOsc into blink and faceOSC example correctly. openFrameworks forum suggests me get someone knowledgeable. I hope you could help me when you are available. advanced example tracks eyebrows and mouth well but eyes, so I want to try blink example. Thank you.

@BinaryBrother
Copy link

After killing myself for a week, I've managed to get it compiled on Windows, but all I see is a grey window. No compile errors. Dependency walker looks good. etc.

Any ideas? ^.^

@kylemcdonald
Copy link
Owner

oh man, congratulations... if there's just a grey window the first thing i'd check is that the video grabber is actually working. can you try running one of the OF video grabber examples?

if that works, then maybe try going into debug mode and walking through the update() in the OF app, all the way into the face tracker update() to see if things are working correctly, or if something is getting skipped.

@BinaryBrother
Copy link

Hey, Kyle. I've actually came a long way since I left that last message. Thanks for your response!

I've got some interesting news. I've managed to get it functional on Windows without the ofxFaceTrackerThreaded module and just used the ofxFaceTracker, directly. Running through the ofxFaceTrackerThreaded module causes face detection to be very sporadic and rarely ever actually detects the face. However, without multi-threading this project is unfeasible due to the performance requirements. Frame-rates become very unstable and drop to something less than 1FPS.

What information should I provide, to aid in diagnostics?

@kylemcdonald
Copy link
Owner

if you're not using the threaded tracker, is the face detected continuously, or does it lose track as well?

does the tracking consistency vary with respect to how quickly you are moving? if the tracking framerate is poor, then any small movements are amplified.

i can't imagine a situation where the tracker would run at 1fps, unless you're using an embedded system / mobile device? can you describe more about the system you're using, your lighting situation, and more precisely describe what happens with the standard tracker vs the threaded tracker (e.g., what framerate you're running at in both cases, how often the tracking fails, what framerate the camera is running at, etc)

also it might make sense to open this as a new issue like "ofxFaceTrackerThreaded poor performance on windows" or similar.

@Shaderboy
Copy link

Shaderboy commented Dec 2, 2016

Hi all, I just tried compiling for windows with 0.9.7 and am running into the same issue. The empty example from ofxCv compiles with no problem, but the empty example for ofxFaceTracker gives me this output:

Severity	Code	Description	Project	File	Line	Suppression State
Error	LNK2019	unresolved external symbol "float __cdecl ofxCv::trackingDistance(class cv::Rect_<int> const &,class cv::Rect_<int> const &)" (?trackingDistance@ofxCv@@YAMABV?$Rect_@H@cv@@0@Z) referenced in function "public: virtual class std::vector<unsigned int,class std::allocator<unsigned int> > const & __thiscall ofxCv::Tracker<class cv::Rect_<int> >::track(class std::vector<class cv::Rect_<int>,class std::allocator<class cv::Rect_<int> > > const &)" (?track@?$Tracker@V?$Rect_@H@cv@@@ofxCv@@UAEABV?$vector@IV?$allocator@I@std@@@std@@ABV?$vector@V?$Rect_@H@cv@@V?$allocator@V?$Rect_@H@cv@@@std@@@4@@Z)	example-empty	C:\Users\chris\Documents\Projects\of_v0.9.7_vs_release\addons\ofxFaceTracker\example-empty\ContourFinder.obj	1	
Severity	Code	Description	Project	File	Line	Suppression State
Error	LNK2001	unresolved external symbol "float __cdecl ofxCv::trackingDistance(class cv::Rect_<int> const &,class cv::Rect_<int> const &)" (?trackingDistance@ofxCv@@YAMABV?$Rect_@H@cv@@0@Z)	example-empty	C:\Users\chris\Documents\Projects\of_v0.9.7_vs_release\addons\ofxFaceTracker\example-empty\ObjectFinder.obj	1

This is in visual studio 2015

Edit: I finally got it to compile by changing the Tracker class and all references/filenames to ofxCvTracker. @kylemcdonald, I know you had specifically tried to avoid that, but it seems to be the simplest solution here.

@ch3gr
Copy link

ch3gr commented Dec 26, 2016

I am having the same issue as well on VS2015.

Renaming the class as @Shaderboy said does work indeed, just a little adventurous for my novice skills though.
=]

Curious to why this is not a problem for other users.

@krisrok
Copy link

krisrok commented Feb 7, 2017

as @kylemcdonald already said 5 years ago, this should fix the issue without the renaming adventure:

http://stackoverflow.com/a/3731643

i just wanted to make this tip more visible again

@reedjones
Copy link

as @kylemcdonald already said 5 years ago, this should fix the issue without the renaming adventure:

http://stackoverflow.com/a/3731643

i just wanted to make this tip more visible again

This worked for me

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants