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

unresolved symbol trackingDistance still exists #115

Open
vertgo opened this issue Jan 28, 2016 · 3 comments
Open

unresolved symbol trackingDistance still exists #115

vertgo opened this issue Jan 28, 2016 · 3 comments

Comments

@vertgo
Copy link

vertgo commented Jan 28, 2016

I know this used to be a problem for people in older versions of this library, but if I download the latest 0.9.0 ofx release, clone faceTracker and ofxCV into the addons, and use project generator to generate a new project with ofxCV, ofxFaceTracker and ofxOpenCv, i still get this error on compile of an otherwise empty project. Those are all the steps necessary. I'm using visualStudio 2015

For what it's worth, I have no such problem on mac

@yhancik
Copy link

yhancik commented Mar 16, 2016

I spent hours last night trying to figure it out.

I think most of us ended up finding that issue after googling for the error message.

It usually points you to this stackoverflow answer. It's actually pointing in the right direction, but changing the properties for the entire project didn't work for me.

What DID work, though, was to apply this setting only on some files:

In the Solution Explorer, go to your project > addons > ofxFaceTracker > libs > FaceTracker > src > lib.

There you'll find a series of .cc files, including Tracker.cc.

Select them all, right-click > Properties. In the Property page, go to Configuration Properties > C/C++ > Output Files

There, for Object File Name, replace $(IntDir) by $(IntDir)/%(RelativeDir)/

It worked for me for compiling FaceOSC (after adding the proper addons as well, ofxOsc & ofxXmlSettings were missing). From what I understood, the "unresolved symbol trackingDistance" issue comes from a confusion between ofxFaceTracker's Tracker and ofxCV's Tracker.

@kylemcdonald, what would be the best way to help Windows user compile ofxFaceTracker projects and/or FaceOSC? Add instructions in the readme? Share a Visual Studio solution?
It would also be great if we could add a Windows binary of FaceOSC back to https://github.com/kylemcdonald/ofxFaceTracker/releases ;) What do you think? How can we help?

@mattfelsen
Copy link

Just ran into this myself. A very similar, but slightly less tedious fix, is to change the Output Files setting on the project itself, rather than on individual files, as in this post from StackOverflow. Modifying what was shared above:

In the Solution Explorer, right-click on your project > Properties. In the Property page, go to Configuration Properties > C/C++ > Output Files

There, for Object File Name, replace $(IntDir) by $(IntDir)/%(RelativeDir)/

In response to @yhancik's question about fixing the issues for Visual Studio, I would say that if there were project files, they could be fixed, but they've been removed in favor of using the projectGenerator to create the needed project files for whichever platform. I agree a short-term/easy solution would be to add some info to the README. I'm happy to put together a PR for this later.

Probably a better approach would be to have the projectGenerator create VS files with this change in the sln/vcxproj file (not sure which, I'd need to look into them). I'll open an issue for this later on as well.

I'm including these errors below so that others searching can find this issue easier since the issue title doesn't include them:
LNK2001 unresolved external symbol
Tracker.obj : warning LNK4042: object specified more than once; extras ignored

@mathieu-b
Copy link

I ran into the same problem yesterday.
Suspecting it might be the way the compiler and linker interact in MSVS, I renamed the ofxCv Tracker.* files (not classes, they already have distinct enclosing namespaces) to ofxcv_Tracker.* and... voilà!
Not the first tine Microsoft's VC compiler screws up things... I've found that XCode / clang tends to be more flexible / functional.

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

4 participants