Mohammed El Moumni
Mohammed El Moumni

Reputation: 267

How to compile a dlib example using eclipse in windows?

I downloaded dlib and I want to compile one of the files in the examples directory using eclipse-cdt in windows. Here is what I did for now :

When I try to build my project, I get the following error :

..\src\source.cpp:7:41: fatal error: ../base64/base64_kernel_1.cpp: No such file or directory #include "../base64/base64_kernel_1.cpp" ^ compilation terminated

Can you pkease tell me what I am missing ?

Upvotes: 1

Views: 1579

Answers (1)

Mohammed El Moumni
Mohammed El Moumni

Reputation: 267

I finally found out how to achieve this thanks to Davis' suggestions.

Requirements :

Steps :

  • cd examples
  • cmake -G "Eclipse CDT4 - MinGW Makefiles" -D CMAKE_C_COMPILER=gcc -D CMAKE_CXX_COMPILER=g++ .
  • This last command will generate the required files for an eclipse project
  • Now Open eclipse and new->import->general->import existing projects into workspace , then choose examples directory. This will import the project generated by cmake to your workspace.
  • Enjoy your developements with dlib !!

Note :

These steps can also work if you create a new project that uses dlib. All you have to do is copy the CMakeLists file to your directory and adapt it to your project.

Upvotes: 1

Related Questions