gadomski / cpd

C++ implementation of the Coherent Point Drift point set registration algorithm.
http://www.gadom.ski/cpd
GNU General Public License v2.0
385 stars 122 forks source link

Link errors with fgt on Windows, vs2015 #121

Closed lujaindong closed 3 years ago

lujaindong commented 7 years ago

I have met these errors when i tried to build the CPD with fgt:

error LNK1181 can't open input file“fgt-lib-C++.lib” normalization-test F:\CPD_Registration\cpd-build\tests\LINK 1
error LNK1181 can't open input file“fgt-lib-C++.lib” version-test F:\CPD_Registration\cpd-build\tests\LINK 1
error LNK1181 can't open input file“fgt-lib-C++.lib” gauss_transform-test F:\CPD_Registration\cpd-build\tests\LINK 1
error LNK1181 can't open input file“fgt-lib-C++.lib” utils-test F:\CPD_Registration\cpd-build\tests\LINK 1
error LNK1181 can't open input file“fgt-lib-C++.lib” nonrigid-test F:\CPD_Registration\cpd-build\tests\LINK 1
error LNK1181 can't open input file“fgt-lib-C++.lib” rigid-test F:\CPD_Registration\cpd-build\tests\LINK 1
error LNK1181 can't open input file“fgt-lib-C++.lib” gauss_transform_fgt-test F:\CPD_Registration\cpd-build\tests\LINK 1
error LNK1181 can't open input file“fgt-lib-C++.lib” affine-test F:\CPD_Registration\cpd-build\tests\LINK 1

I didn't find the fgt-lib-C++.lib in the building directory of fgt. Any idea? Thanks.

lujaindong commented 7 years ago

Hi I solved this error by copy the .lib file into the build tests directory. And now it works. But I think there must be method that we can do something with the configuration, right?

gadomski commented 7 years ago

I'm sorry, I missed this ticket yesterday. Did you run the INSTALL target for fgt, then point the cpd CMake configuration to that installed location?

lujaindong commented 7 years ago

yes of course I did. I built fgt sucessfully and set the fgt_DIR in the Cmake configuration. Actually the lib that built is named fgt not fgt-lib-C++. It is a little strange. But now it work fine.

gadomski commented 7 years ago

CMake is (sometimes) case-sensitive, so make sure you are importing and using fgt like this:

find_package(Fgt REQUIRED)
target_link_libraries(my-great-target PUBLIC Fgt::Library-C++)

You are correct that the fgt library is named fgt, but the CMake imported target is called Fgt::Library-C++.

hobu commented 3 years ago

148 should have things linking again.

gadomski commented 3 years ago

Closed by #148.