vcg-uvic / TILDE

Repository for "TILDE: A Temporally Invariant Learned DEtector", CVPR2015
50 stars 23 forks source link

Does anyone success run this codes on Visual Studio in Windows7, I meet some problems #2

Open ruizengalways opened 8 years ago

ruizengalways commented 8 years ago

First, I download the codes and unzip them to my C Drive. After that, I use CMake, VS2012, openCV 3.0 to generate the project. CMake Shows

OPENMP FOUND OPENMP FOUND Configuring done Generating done

Then I build ALL_BUILD, the project says "LNK1104 cannot open file '..\Lib\Debug\TILDE.lib'" and a lot of grammar errors due to my complier isn't compatible to C++11.

Then I immediately download VS2015 from Microsoft. and try to generate above project again by using above method again. VS only report "LNK1104 cannot open file '..\Lib\Debug\TILDE.lib'" and a lot of warnings.

I think the openCV in my desktop may be problematic. So I download openCV 2.4.11 from opencv.org and try use CMAKE to generate opencv Project. Jesus, I failed. I note that my graphic card is AMD, rather than NVIDIA. I cannot use CUDA. Then I generate the openCV project without CUDA. I succussed to build the Debug, win 32. In the following step, The TILDE project is generated by CMAKE, openCV 2.4.11, VS2015. But at last, I still get "LNK1104 cannot open file '..\Lib\Debug\TILDE.lib'".

I don't know which step of my above method is wrong? Could anyone tell me how to run this example correctly. I am a beginner in openCV, Visual Studio and C++. All my previous work is done in matlab. It really make me crazy.

Thank you for reading. Please help me.

kmyi commented 8 years ago

Hi, sorry for the trouble you are having. Can you tell me the structure of your c++ directory after you run CMake? It should be something like

C++ -- CMakeLists.txt |- Demo |- Libs |- build

and everything CMake generates should be in the build directory. I suspect you set the CMake build directory to the C++ folder.

ruizengalways commented 8 years ago

Hi Kmyid, Thank you for your kind reply. Let me describe my setup process in details.

  1. I installed opencv in ‘C:\opencv’. Then I used ‘C:\opencv\source’ and CMake to build a new opencv in VS2015 in ‘C:\opencv\mybuild’
  2. The CMake is installed in ‘C:\Program Files (x86)\CMake’.
  3. TILDE-1.0.3.zip is unzipped to ‘C:\Users\n9544453\Documents\TILDE-1.0.3’ The directory of TILDE-1.0.3 is represented as

TILDE-1.0.3 |- C++ |- data |- matlab -- .gitgnore -- README

  1. Then I open CMake. The options of CMake is shown as follows

Where is the source code: C:/Users/n9544453/Documents/TILDE-1.0.3/c++ Where to build the binaries: C:/Users/n9544453/Documents/TILDE-1.0.3/c++/build

TILDE_LIBRARY_PROJECT TILDE CMAKE_CONFIGURATION_TYPES Debug;Release;MinSizeRel;RelWithDebInfo CMAKE_INSTALL_PREFIX C:/Program Files (x86)/Lib and Demo OpenCV_DIR C:\opencv\mybuild

Now I click Configure, CMake-gui.exe says

OPENMP FOUND CMake Error at Lib/CMakeLists.txt:56 (install): install Library TARGETS given no DESTINATION!

OPENMP FOUND Configuring incomplete, errors occurred!

I searched on Internet to solve this problem and followed this solution http://stackoverflow.com/questions/14990343/cmake-error-targets-given-no-library-destination-for-shared-library-target

Then I added ARCHIVE DESTINATION ${PROJECT_SOURCE_DIR} in C:\Users\n9544453\Documents\TILDE-1.0.3\c++\Lib\CMakeLists.txt – line 56.

Repeat step 4, I get

OPENMP FOUND OPENMP FOUND Configuring done After this I click Generate button on CMake. It shows

OPENMP FOUND OPENMP FOUND Configuring done Generating done

I open ‘Lib and Demo.sln’ in ‘C:\Users\n9544453\Documents\TILDE-1.0.3\c++\build’ and click Build ALL_BUILD

At last, It shows

Code || Description || Project || File || Line Active || Command Line error – specified director C2131 || Expression did not evaluate to a constant ||TILDE || libTILDE.cpp || 261
C2131 || Expression did not evaluate to a constant ||TILDE_static || libTILDE.cpp|| 261 LNK1104|| cannot open file ‘..\Lib\Debug\TILDE.lib|| demo || LINK || 1
Undefined uint || TILDE || libTILDE.cpp|| 1320

For the first problem, I deleted TILDE-1.0.3 in my directory and use ‘C:\Users\n9544453\Documents\c++ as my new directory. It fixed.

For the second problem C2131, I modified libTILDE.cpp. I modified the code in Line 261 as follows float* pixelin1 = new float[nbChannels]; float* pixelin2 = new float[nbChannels];

and added delete [] pixelin1; delete [] pixelin2; in Line 295.

At last C2131 fixed

For the third problem, I rebuild TILDE and TILDE_static and get success. But for demo and ALL_BUILD, the problem remains in project.

kmyi commented 8 years ago

Hi Again,

Sorry that you had to go through all this hassle. I pushed the change in CMakeList you did for the Lib and now that should be fine. For the pointer allocation issue, I will have to double check if it breaks anything else, but the changes seem correct. As I don't have windows and visual studio, I cannot reproduce your problem directly. I will try once I get the chance, but that would require some time. In the mean-time the demo is quite simple (just a single demo.cpp), so once you have the libraries built, you can try yourself manually at the moment.

I will update you through this issue once I have it solved.

Thanks, Kwang

kmyi commented 8 years ago

Hi,

Maybe it's a bit too late, but I recently had to compile this library in windows and it worked without much trouble. I however did not use visual studio. Instead i used mingw and CMake. As mingw is basically providing gnu environment in windows, it should work :-)

I also used Qt Creator as the IDE.

Cheers, Kwang

ruizengalways commented 8 years ago

Hi,

Thanks a lot for your efforts. I'll try compile them by mingw and Cmake ^_^

Cheers, Rui Zeng

kmyi commented 8 years ago

Also,Ithink you can safely delete eigen from dependencies in cmakelists. I'll push an update Today