norlab-ulaval / libnabo

A fast K Nearest Neighbor library for low-dimensional spaces
http://norlab-ulaval.github.io/libnabo/
BSD 3-Clause "New" or "Revised" License
440 stars 144 forks source link

Error when using cmake to build libnabo on win10 #92

Closed wzx16 closed 5 years ago

wzx16 commented 6 years ago

Hi, I meet some issue when I use cmake to compile this on win10, this is the error message:

(Link target) ->

invalid_matrix_types.obj : **error** LNK2019: unresolved external symbol "public: static struct Nabo::NearestNeighbourSearch<float,class Eigen::Matrix<float,-1,-1,0,-1,-1> > * __cdecl Nabo::NearestNeighbourSearch<float,class Eigen::Matrix<float,-1,-1,0,-1,-1> >::create(class Eigen::Matrix<float,-1,-1,0,-1,-1> const &,int,enum Nabo::NearestNeighbourSearch<float,class Eigen::Matrix<float,-1,-1,0,-1,-1> >::SearchType,unsigned int,struct Nabo::Parameters const &)" (?create@?$NearestNeighbourSearch@MV?$Matrix@M$0?0$0?0$0A@$0?0$0?0@Eigen@@@Nabo@@SAPEAU12@AEBV?$Matrix@M$0?0$0?0$0A@$0?0$0?0@Eigen@@HW4SearchType@12@IAEBUParameters@2@@Z) referenced in function "int __cdecl testFunction<class Eigen::Matrix<float,-1,-1,0,-1,-1> >(void)" (??$testFunction@V?$Matrix@M$0?0$0?0$0A@$0?0$0?0@Eigen@@@@YAHXZ) [C:\libnabo\build_libnabo_vs2017_x64\tests\CMakeFiles\CMakeTmp\cmTC_b6580.vcxproj]

C:\libnabo\build_libnabo_vs2017_x64\tests\CMakeFiles\CMakeTmp\Debug\cmTC_b6580.exe : fatal **error** LNK1120: 1 unresolved externals [C:\libnabo\build_libnabo_vs2017_x64\tests\CMakeFiles\CMakeTmp\cmTC_b6580.vcxproj]

  1 Warning(s)

  2 Error(s)

And this is my cmake setting:

capture

wzx16 commented 6 years ago

I found a temp solution: Just delete add_subdirectory(test) from root cmakelist

Jx-X commented 6 years ago

newbie to github, i met the same problem , and can't find the ' add_subdirectory(test) from root cmakelist'. can you please help me ?