내 Dlib 설치가 여러 위치에 작동하지 않습니다 시도 ++, 그래서 내 필요한 파일을 컴파일하는 여러 개의 위치를 검색하는 스크립트를 쓰고 있어요 :C 문은 "사용법 #include"
int main()
{
try{
#include <dlib/image_processing/frontal_face_detector.h>
#include <dlib/image_io.h>
}catch(...){
cout << "Location A is incorrect: " << e << endl;
}
try{
#include <dlib/dlib/image_processing/frontal_face_detector.h>
#include <dlib/dlib/image_io.h>
}catch(...){
cout << "Location B is incorrect: " << e << endl;
}
return 0;
}
을하지만, 어떤 이유로, g++
는 여전히 나에게 같은 No such file...
오류 제공 : 이제
g++ IWillFindLib--00.cpp -o IWillFindLib--00.o
IWillFindLib--00.cpp:8:59: fatal error: dlib/image_processing/frontal_face_detector.h: No such file or directory
#include <dlib/image_processing/frontal_face_detector.h>
^
compilation terminated.
을, 난 그냥 g++ -I home/name/dlib
와 위치를 추가 할 수 알지만, 완성 된 프로젝트가 가입일 입력을 완전히 손 - 오프를 실행하려면 사용자. 이 작품을 어떻게 만들 수 있습니까?
이이 같은 일을 할 수있는 방법이 많이 있습니다,하지만 그들 중 하나가 아닙니다. 문제의 세부 사항에 대해 많은 정보를 제공하지 않으므로이를 해결하는 합리적인 방법을 조언하기가 어렵습니다. 아마도 필요한'#include '가 들어있는 헤더 파일을 생성하고 그 파일에'#include'라는 파일을 갖는 프로그램 (또는 스크립트)을 포함 할 수도 있습니다. –
가능한 [C 전처리 기가 파일 존재 여부를 알 수 있습니까?] (http://stackoverflow.com/questions/142877/can-the-c-preprocessor-be-used-to-tell-if- a-file-exists) –
2008 년부터? – Rich