HalfdanJ / ofxFaceTracker2

Landmark detection addon for openFrameworks using DLIB
Other
207 stars 60 forks source link

Compiling in VS2017 - OF0.10 #47

Open ch3gr opened 6 years ago

ch3gr commented 6 years ago

Hi,

I just upgraded to VS2017 and Openframeworks 0.10 as I would like to try this addon, but I can't get it to compile. I used OF's project generator to update the project and I get this error while building one of the the examples

Thank you and sorry if it's a rather basic question

In debug mode

1>------ Build started: Project: openframeworksLib, Configuration: Debug x64 ------
1>openframeworksLib.vcxproj -> D:\myStuff\ch3\dev\Visual studio 2017\of_v0.10.0_vs2017_release\libs\openFrameworksCompiled\project\vs\..\..\lib\vs\x64\openframeworksLib_debug.lib
2>------ Build started: Project: example-pose, Configuration: Debug x64 ------
2>cl : Command line warning D9025: overriding '/Od' with '/O2'
2>cl : Command line error D8016: '/RTC1' and '/O2' command-line options are incompatible
2>Done building project "example-pose.vcxproj" -- FAILED.
========== Build: 1 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

In Release mode

1>------ Build started: Project: openframeworksLib, Configuration: Release x64 ------
1>openframeworksLib.vcxproj -> D:\myStuff\ch3\dev\Visual studio 2017\of_v0.10.0_vs2017_release\libs\openFrameworksCompiled\project\vs\..\..\lib\vs\x64\openframeworksLib.lib
2>------ Build started: Project: example-pose, Configuration: Release x64 ------
2>main.cpp
2>ofApp.cpp
2>d:\mystuff\ch3\dev\visual studio 2017\of_v0.10.0_vs2017_release\libs\openframeworks\math\ofmatrix4x4.h(326): warning C4267: 'argument': conversion from 'size_t' to 'int', possible loss of data (compiling source file src\main.cpp)
2>d:\mystuff\ch3\dev\visual studio 2017\of_v0.10.0_vs2017_release\libs\openframeworks\math\ofmatrix4x4.h(331): warning C4267: 'argument': conversion from 'size_t' to 'int', possible loss of data (compiling source file src\main.cpp)
2>d:\mystuff\ch3\dev\visual studio 2017\of_v0.10.0_vs2017_release\libs\openframeworks\math\ofmatrix4x4.h(912): warning C4267: 'argument': conversion from 'size_t' to 'int', possible loss of data (compiling source file src\main.cpp)
2>d:\mystuff\ch3\dev\visual studio 2017\of_v0.10.0_vs2017_release\libs\openframeworks\math\ofmatrix4x4.h(913): warning C4267: 'argument': conversion from 'size_t' to 'int', possible loss of data (compiling source file src\main.cpp)
2>d:\mystuff\ch3\dev\visual studio 2017\of_v0.10.0_vs2017_release\libs\openframeworks\math\ofmatrix4x4.h(914): warning C4267: 'argument': conversion from 'size_t' to 'int', possible loss of data (compiling source file src\main.cpp)
2>d:\mystuff\ch3\dev\visual studio 2017\of_v0.10.0_vs2017_release\libs\openframeworks\math\ofmatrix4x4.h(915): warning C4267: 'argument': conversion from 'size_t' to 'int', possible loss of data (compiling source file src\main.cpp)
2>d:\mystuff\ch3\dev\visual studio 2017\of_v0.10.0_vs2017_release\libs\openframeworks\math\ofmatrix4x4.h(326): warning C4267: 'argument': conversion from 'size_t' to 'int', possible loss of data (compiling source file src\ofApp.cpp)
2>d:\mystuff\ch3\dev\visual studio 2017\of_v0.10.0_vs2017_release\libs\openframeworks\math\ofmatrix4x4.h(331): warning C4267: 'argument': conversion from 'size_t' to 'int', possible loss of data (compiling source file src\ofApp.cpp)
2>d:\mystuff\ch3\dev\visual studio 2017\of_v0.10.0_vs2017_release\libs\openframeworks\math\ofmatrix4x4.h(912): warning C4267: 'argument': conversion from 'size_t' to 'int', possible loss of data (compiling source file src\ofApp.cpp)
2>d:\mystuff\ch3\dev\visual studio 2017\of_v0.10.0_vs2017_release\libs\openframeworks\math\ofmatrix4x4.h(913): warning C4267: 'argument': conversion from 'size_t' to 'int', possible loss of data (compiling source file src\ofApp.cpp)
2>d:\mystuff\ch3\dev\visual studio 2017\of_v0.10.0_vs2017_release\libs\openframeworks\math\ofmatrix4x4.h(914): warning C4267: 'argument': conversion from 'size_t' to 'int', possible loss of data (compiling source file src\ofApp.cpp)
2>d:\mystuff\ch3\dev\visual studio 2017\of_v0.10.0_vs2017_release\libs\openframeworks\math\ofmatrix4x4.h(915): warning C4267: 'argument': conversion from 'size_t' to 'int', possible loss of data (compiling source file src\ofApp.cpp)
2>d:\mystuff\ch3\dev\visual studio 2017\of_v0.10.0_vs2017_release\addons\ofxfacetracker2\src\ofxfacetracker2.h(12): fatal error C1083: Cannot open include file: 'dlib/image_processing/frontal_face_detector.h': No such file or directory (compiling source file src\main.cpp)
2>d:\mystuff\ch3\dev\visual studio 2017\of_v0.10.0_vs2017_release\addons\ofxfacetracker2\src\ofxfacetracker2.h(12): fatal error C1083: Cannot open include file: 'dlib/image_processing/frontal_face_detector.h': No such file or directory (compiling source file src\ofApp.cpp)
2>Done building project "example-pose.vcxproj" -- FAILED.
========== Build: 1 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
carlesgutierrez commented 6 years ago

For Release Error: fatal error C1083: Cannot open include file: 'dlib/image_processing/frontal_face_detector.h': No such file or directory (compiling source file src\main.cpp)

you can add dlib include folder to your project settings. ..\..\..\addons\ofxFaceTracker2\libs\dlib\include

carlesgutierrez commented 6 years ago

I'm compiling it too ( VS2017, of_v0.10.0RC4 ) and I've arrived until to following error that I don't know how to solve it.

getImageMesh() returns incomplete type of "ofMesh"

ofMesh ofxFaceTracker2Landmarks::getImageMesh() const{ return getMesh(getCvImagePoints()); }

Error:

error C2027: use of undefined type 'ofMesh_<ofDefaultVertexType,ofDefaultNormalType,ofDefaultColorType,ofDefaultTexCoordType>'

WozLai commented 6 years ago

hi~ @carlesgutierrez I'm a new to openframeworks and c++ I try to change ofxFaceTracker2Landmarks.cpp Line 40 to template <class T> ofMesh getImageMesh() const; It get work maybe you can try it too.

vvzen commented 6 years ago

hi @GambleV , I tried your solution but I got this error:

blablabla/addons/ofxFaceTracker2/src/ofxFaceTracker2Landmarks.cpp:42:52: error: implicit instantiation of undefined template 'ofMesh_<glm::tvec3<float,
      glm::precision::packed_highp>, glm::tvec3<float, glm::precision::packed_highp>, ofColor_<float>, glm::tvec2<float, glm::precision::packed_highp> >'
template <class T>ofMesh ofxFaceTracker2Landmarks::getImageMesh() const{
                                                   ^
blablabla/of_v0.10.0_osx_release/libs/openFrameworks/graphics/ofGraphicsBaseTypes.h:45:7: note: template is declared here
class ofMesh_;

Did you just rename the getImageMesh() from this:

ofMesh ofxFaceTracker2Landmarks::getImageMesh() const{
    return getMesh(getCvImagePoints());
}

to this:

template <class T>ofMesh ofxFaceTracker2Landmarks::getImageMesh() const{
    return getMesh(getCvImagePoints());
}
dstavy commented 6 years ago

have the same problem

vvzen commented 6 years ago

@dstavy just to say - I've switched to bakercp version of this addon, which is tested against 0.10 and works good if you compile from XCode and not using make. You can find it in bakercp repos

WozLai commented 6 years ago

hi @vvzen and @dstavy ,I forgot that. But I check my ofxFaceTracker2Landmarks.h Line 40 is changed to template <class T> ofMesh getImageMesh() const; Maybe you can try :)

The last I say wrong, not ofxFaceTracker2Landmarks.cpp is ofxFaceTracker2Landmarks.h and ofxFaceTracker2Landmarks.cpp Line 42 change like @vvzen said.

dstavy commented 6 years ago

thanks bakercp version works