Page 1 of 2

DGM compile error

Posted: Mon Jun 12, 2017, 00:25
by Bryan
Hi! I followed your instruction to install DGM. After installing the opencv, I opened .sln and compiled the DGM all build in Debug mode. So many errors in VS2013.
Random.h CameraControl.h AveragePrecision.cpp have errors which are in the attachment in detail. Could you please tell me what is wrong?

Re: DGM compile error

Posted: Sat Jun 17, 2017, 12:03
by Creator
Which version of the DGM do you use? 1.5.1 or 1.4.2?
As far as I understand from the mistakes, you have to update your Visual Studio at least till Visual Studio 2015. You can download a free version of the visual studio from the Microsoft web site.

Re: DGM compile error

Posted: Sun Jun 18, 2017, 14:30
by Bryan
I use DGM 1.5.1. So I must change my VS to 2015. If i use 1.4.2, could I still use vs2013?

Re: DGM compile error

Posted: Sun Jun 18, 2017, 14:30
by Creator
These mistakes may be result of that fact that vc2013 does not fully support c++11. DGM 1.4.2 also uses c++11.
If you use 1.5.1 you have to apply CMake for generating the visual studio solution. You can try to uncheck the support of the PPL in CMake configuration procedure. That must reduce the number of errors. But I suggest you to switch to the Visual Studio 2015 or 2017, rebuild OpenCV with it and then compile DGM library. I think this is the optimal solution.

Re: DGM compile error

Posted: Tue Jun 20, 2017, 21:57
by Bryan
I have downloaded the DGM opencv_2.4.13 branch from github. And I downloaded opencv2.4.13.exe and extracted the folder including build and source folder. And I compiled with cmake-gui and open .sln with 2013 VS and compile, then get the following result.

Re: DGM compile error

Posted: Wed Jun 21, 2017, 21:48
by Creator
The errors in Random.h CameraControl.h and AveragePrecision.cpp are caused by the fact, that your Visual Studio does not fully support the C++11 standard. Here, I can suggest you 2 solutions:
  1. Download and Install Visual Studio 2015 (or 2017) Community (free): https://www.visualstudio.com/downloads/ (the best silution). In this case you will be obliged to re-build the OpenCV library. This procedure is very the same as for building the DGM
  2. Exclude the C++11 code from the library:
    • delete AveragePrecision.cpp and AveragePrecision.h and exclude it from the CMakeLists.txt file and from the “#include” directives
    • disable ENABLE_PPL in the types.h file
    • rewrite the function T rand(T min, T max) in random.h file

Re: DGM compile error

Posted: Sun Jun 25, 2017, 21:43
by Bryan
Thank you for your patient reply. I have followed your first propose and change to VS2015 platform. I built 14 projects successfully. Then I didn't move content of install folder to build folder as the instruction (http://research.project-10.de/dgm/doc/a ... nstall_dgm) said. Next I new a project with VS2015 and added two property (opencv32.props,debug__.props), one for opencv3.2 setting(opencv setting is ok, I think) and another for DGM. At the same time I copied code of demo train to main.cpp and compiled them but error appeared just like attachment showed.

Re: DGM compile error

Posted: Tue Jun 27, 2017, 21:07
by Creator
I can’t say from the attached image the reason for these two errors... “print_help” seems very strange to me, have you copied the source code of the demo_train completely?
As a remedy, and in order to gain fast results, I would suggest you to edit the demo_train code directly in the library. Optionally, f you need to work in a separate project, please try to edit your new project setting manually, with respect to the demo_train settings. Just add new dependencies in the C/C++ and Linker directories of the project’s property pages.

Re: DGM compile error

Posted: Sun Jul 02, 2017, 00:46
by Bryan
I found I missed something so I renew a project add DGM/demos/demo_train.cpp and the two properties (debug__.props and opencv32.props) and compiled. Many LNK errors. Then I removed demo_train.cpp and add extract.cpp and extract.h, the errors is the same with above. Maybe I met something serious. If you can, I think remote assistant is the best way. You can control my PC and figure it out. Thank you!

Re: DGM compile error

Posted: Sun Jul 02, 2017, 14:36
by Creator
It looks like the errors with linking visual studio libraries. I think that copying the properties files does not work.