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

Error D8016 '/RTC1' and '/O2' command-line options are incompatible #21

Open
SuperMoran opened this issue Mar 31, 2017 · 15 comments
Open

Comments

@SuperMoran
Copy link

Hi, I am using thexFaceTracker2 when there is a problem, add the plugin, do not add code to run will appear '/ RTC1' and '/ O2 error, can you help me, thanks

@SuperMoran
Copy link
Author

@HalfdanJ please help me

@HalfdanJ
Copy link
Owner

Sorry, but I don't understand your problem. Don't know what rtc1 means

@SuperMoran
Copy link
Author

I use the visual studio 2015, I would like to ask the use ofxFaceTracker2 what needs to build what environment, because the compiler will show unresolved external symbol

@HalfdanJ
Copy link
Owner

I'm sorry, I dont have experience with visual studio. I would probably recommend you look at ofxDlib

@sebasobotka
Copy link

sebasobotka commented Apr 21, 2017

Hi @SuperMoran. I am using VS2015 and I've got the same error.
Here is more info about this problem:
http://stackoverflow.com/questions/23179136/visual-studio-command-line-error-d8016-ox-and-rtc-command-line-options-a

  1. Switching to release mode helps. It goes farther.
    or
  2. Deleting the Command line option in Project->Properties->C/C++->Command Line->Additional Options. You need to do it for all configurations and platforms. I checked the "Inherit from parent..." option also. The same situation here. It goes farther but we need to compile in release mode anyway because there is no dlib.lib for debug mode compiled.

EDIT!
This special flag -O2 is passed by addon_config.mk file. Delete it and no need to delete it manually in each example-project.

vs_command_line_error

Finally I got it.

  1. "CreateSemaphore not found" - fixed in window_magic.h
  2. "Error D8016 '/RTC1' and '/O2' command-line options are incompatible" - compiling in release mode or changing Command Line options.
  3. Add to Project Property -> Configuration Properties -> Linker -> Additional Library Directories path to addons\ofxFaceTracker2\libs\dlib\lib\win\Release
  4. Add "dlib.lib" value to Project Property -> Configuration Properties -> Linker -> Input -> Additional...
  5. Copy "shape_predictor_68_face_landmarks.dat" to bin\data folder
    some changes in setup()
    string predictorDatFilePath = ofToDataPath("shape_predictor_68_face_landmarks.dat");
    tracker.setup(predictorDatFilePath);
  6. There is no preprocessor flag __ OPTIMIZE __ in Visual Studio... I fixed it in this way or we can delete it..
    #ifndef TARGET_WIN32
    #ifndef __ OPTIMIZE __
    ofSetColor(ofColor::red);
    ofDrawBitmapString("Warning! Run this app in release mode to get proper performance!",10,60);
    ofSetColor(ofColor::white);
    #endif
    #endif

@Bendegreef
Copy link

hi @sebasobotka ,

Thanks for the instructions!
But i'm still getting "cannot open input file 'dlib.lib'.

I'm sure I followed your instructions right.

Any idea?

Thanks!

@sebasobotka
Copy link

sebasobotka commented Apr 26, 2017

Be sure that you have that file in folder /libs/dlib/lib/win/Release
Check the Configuration and Platform options marked by red rectangle out, there are 4 possibilities:
debug win32
release win32
debug x64
release x64
The static lib file was compiled for 64 bit so you need to compile project in Release mode, x64 and set path and input for Release and x64.

linker_option01
linker_option02

@SuperMoran
Copy link
Author

hi @sebasobotka

Thanks for the instructions!
It's very helpful to me.

@sebasobotka
Copy link

Please, read again above carefully. You need to have compiled library (dlib) to static file (in your case in 64bit mode) and add it as described above. Chosen platform is very important.

@teganscott
Copy link

Hi @sebasobotka

I'm getting the 'CreateSemaphore' error, and you said the fix was in the window_magic.h file. What exactly did you do to this file to make it work?

Thanks!

@sebasobotka
Copy link

Hi @teganscott,
Please check my file:
https://github.com/sebasobotka/ofxFaceTracker2/blob/master/libs/dlib/include/dlib/windows_magic.h
These lines are important:

#ifdef WIN32

#ifndef CreateSemaphore
#ifdef UNICODE
#define CreateSemaphore CreateSemaphoreW
#endif
#endif

@teganscott
Copy link

Thank you! That fixed it!

@mhaghighat
Copy link

mhaghighat commented Jan 5, 2018

Right click on the project in the Solution Explorer and click on Properties and go to:
Configuration Properties => C/C++ => Code Generation
Set the "Basic Runtime Checks" to "Default". You'll be OK then.

image

@gbernal
Copy link

gbernal commented Nov 17, 2018

Thank you, everyone, for the collective effort, a lot of the pointers help me get rid of errors, however, I'm getting more errors now.

Severity Code Description Project File Line Suppression State Error LNK1120 9 unresolved externals facetracking01 C:\Users\gbernal\Documents\of_v0.9.8_vs_release\apps\myApps\facetracking01\bin\facetracking01.exe 1 Error LNK2001 unresolved external symbol "public: unsigned int __cdecl dlib::entropy_decoder_kernel_2::get_target(unsigned int)" (?get_target@entropy_decoder_kernel_2@dlib@@QEAAII@Z) facetracking01 C:\Users\gbernal\Documents\of_v0.9.8_vs_release\apps\myApps\facetracking01\ofxFaceTracker2.obj 1 Error LNK2001 unresolved external symbol "public: virtual __cdecl dlib::base64::~base64(void)" (??1base64@dlib@@UEAA@XZ) facetracking01 C:\Users\gbernal\Documents\of_v0.9.8_vs_release\apps\myApps\facetracking01\ofxFaceTracker2.obj 1 Error LNK2001 unresolved external symbol "public: virtual __cdecl dlib::entropy_decoder_kernel_2::~entropy_decoder_kernel_2(void)" (??1entropy_decoder_kernel_2@dlib@@UEAA@XZ) facetracking01 C:\Users\gbernal\Documents\of_v0.9.8_vs_release\apps\myApps\facetracking01\ofxFaceTracker2.obj 1 Error LNK2001 unresolved external symbol "public: void __cdecl dlib::base64::decode(class std::basic_istream<char,struct std::char_traits<char> > &,class std::basic_ostream<char,struct std::char_traits<char> > &)const " (?decode@base64@dlib@@QEBAXAEAV?$basic_istream@DU?$char_traits@D@std@@@std@@AEAV?$basic_ostream@DU?$char_traits@D@std@@@4@@Z) facetracking01 C:\Users\gbernal\Documents\of_v0.9.8_vs_release\apps\myApps\facetracking01\ofxFaceTracker2.obj 1 Error LNK2001 unresolved external symbol "public: void __cdecl dlib::entropy_decoder_kernel_2::decode(unsigned int,unsigned int)" (?decode@entropy_decoder_kernel_2@dlib@@QEAAXII@Z) facetracking01 C:\Users\gbernal\Documents\of_v0.9.8_vs_release\apps\myApps\facetracking01\ofxFaceTracker2.obj 1 Error LNK2001 unresolved external symbol "public: void __cdecl dlib::entropy_decoder_kernel_2::set_stream(class std::basic_istream<char,struct std::char_traits<char> > &)" (?set_stream@entropy_decoder_kernel_2@dlib@@QEAAXAEAV?$basic_istream@DU?$char_traits@D@std@@@std@@@Z) facetracking01 C:\Users\gbernal\Documents\of_v0.9.8_vs_release\apps\myApps\facetracking01\ofxFaceTracker2.obj 1 Error LNK2001 unresolved external symbol "public: __cdecl dlib::base64::base64(void)" (??0base64@dlib@@QEAA@XZ) facetracking01 C:\Users\gbernal\Documents\of_v0.9.8_vs_release\apps\myApps\facetracking01\ofxFaceTracker2.obj 1 Error LNK2001 unresolved external symbol "public: __cdecl dlib::entropy_decoder_kernel_2::entropy_decoder_kernel_2(void)" (??0entropy_decoder_kernel_2@dlib@@QEAA@XZ) facetracking01 C:\Users\gbernal\Documents\of_v0.9.8_vs_release\apps\myApps\facetracking01\ofxFaceTracker2.obj 1 Error LNK2001 unresolved external symbol USER_ERROR__missing_dlib_all_source_cpp_file__OR__inconsistent_use_of_DEBUG_or_ENABLE_ASSERTS_preprocessor_directives_ facetracking01 C:\Users\gbernal\Documents\of_v0.9.8_vs_release\apps\myApps\facetracking01\ofxFaceTracker2Landmarks.obj 1 Error LNK2001 unresolved external symbol USER_ERROR__missing_dlib_all_source_cpp_file__OR__inconsistent_use_of_DEBUG_or_ENABLE_ASSERTS_preprocessor_directives_ facetracking01 C:\Users\gbernal\Documents\of_v0.9.8_vs_release\apps\myApps\facetracking01\main.obj 1 Error LNK2001 unresolved external symbol USER_ERROR__missing_dlib_all_source_cpp_file__OR__inconsistent_use_of_DEBUG_or_ENABLE_ASSERTS_preprocessor_directives_ facetracking01 C:\Users\gbernal\Documents\of_v0.9.8_vs_release\apps\myApps\facetracking01\ofApp.obj 1 Error LNK2001 unresolved external symbol USER_ERROR__missing_dlib_all_source_cpp_file__OR__inconsistent_use_of_DEBUG_or_ENABLE_ASSERTS_preprocessor_directives_ facetracking01 C:\Users\gbernal\Documents\of_v0.9.8_vs_release\apps\myApps\facetracking01\ofxFaceTracker2.obj 1 Error LNK2001 unresolved external symbol USER_ERROR__missing_dlib_all_source_cpp_file__OR__inconsistent_use_of_DEBUG_or_ENABLE_ASSERTS_preprocessor_directives_ facetracking01 C:\Users\gbernal\Documents\of_v0.9.8_vs_release\apps\myApps\facetracking01\ofxFaceTracker2Instance.obj 1

@Phsyxx
Copy link

Phsyxx commented Nov 14, 2024

ME TOO

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