Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

complie smooth in ubuntu18.04,but not in win10 with VS2017 #56

Closed
CarlLyt opened this issue Oct 26, 2020 · 2 comments
Closed

complie smooth in ubuntu18.04,but not in win10 with VS2017 #56

CarlLyt opened this issue Oct 26, 2020 · 2 comments

Comments

@CarlLyt
Copy link

CarlLyt commented Oct 26, 2020

hi, Sorry to interrupt your life
This is a amazing project, i use and complies smooth in ubuntu18.04, but now i need complies this project in win10, so there is so many trouble when i use cmake and VS2017 complie, I have complied Eigen3 and Panolin in my computer successfully, and cilantro project succeeded in finding Eigen3 and Panolin like
image
But it still compiles with various errors ,so I add
#find_package(Pangolin QUIET) #if(Pangolin_FOUND) #set(HAVE_PANGOLIN ON) #set(HAVE_PANGOLIN OFF) #set(DEPENDS_Pangolin "find_dependency(Pangolin)") #endif()
I successfully compiled cilantro . but can't use in my project, the wrong message like:

Severity Code Description Project File Line Suppression State
Error LNK2019 unresolved external symbol "public: __cdecl tinyply::PlyFile::PlyFile(void)" (??0PlyFile@tinyply@@qeaa@XZ) referenced in function "public: __cdecl cilantro::PLYReader::PLYReader(class std::basic_string<char,struct std::char_traits,class std::allocator > const &,bool)" (??0PLYReader@cilantro@@qeaa@AEBV?$basic_string@DU?$char_traits@D@std@@v?$allocator@D@2@@std@@_N@Z) FaceScanViewerApp E:\FaceScan\FaceScanViwer\FaceScanViewerApp\facealign.obj 1

Error LNK2019 unresolved external symbol "public: __cdecl tinyply::PlyFile::~PlyFile(void)" (??1PlyFile@tinyply@@qeaa@XZ) referenced in function "int public: __cdecl cilantro::PLYReader::PLYReader(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,bool)'::1'::dtor$2" (?dtor$2@?0???0PLYReader@cilantro@@qeaa@AEBV?$basic_string@DU?$char_traits@D@std@@v?$allocator@D@2@@std@@_N@Z@4HA) FaceScanViewerApp E:\FaceScan\FaceScanViwer\FaceScanViewerApp\facealign.obj 1

Error LNK2019 unresolved external symbol "public: bool __cdecl tinyply::PlyFile::parse_header(class std::basic_istream<char,struct std::char_traits > &)" (?parse_header@PlyFile@tinyply@@QEAA_NAEAV?$basic_istream@DU?$char_traits@D@std@@@std@@@z) referenced in function "public: __cdecl cilantro::PLYReader::PLYReader(class std::basic_string<char,struct std::char_traits,class std::allocator > const &,bool)" (??0PLYReader@cilantro@@qeaa@AEBV?$basic_string@DU?$char_traits@D@std@@v?$allocator@D@2@@std@@_N@Z) FaceScanViewerApp E:\FaceScan\FaceScanViwer\FaceScanViewerApp\facealign.obj 1

Error LNK2019 unresolved external symbol "public: void __cdecl tinyply::PlyFile::read(class std::basic_istream<char,struct std::char_traits > &)" (?read@PlyFile@tinyply@@QEAAXAEAV?$basic_istream@DU?$char_traits@D@std@@@std@@@z) referenced in function "public: void __cdecl cilantro::PLYReader::readData(void)" (?readData@PLYReader@cilantro@@QEAAXXZ) FaceScanViewerApp E:\FaceScan\FaceScanViwer\FaceScanViewerApp\facealign.obj 1

Error LNK2019 unresolved external symbol "public: class std::vector<struct tinyply::PlyElement,class std::allocator > __cdecl tinyply::PlyFile::get_elements(void)const " (?get_elements@PlyFile@tinyply@@qeba?AV?$vector@UPlyElement@tinyply@@v?$allocator@UPlyElement@tinyply@@@std@@@std@@xz) referenced in function "public: bool __cdecl cilantro::PLYReader::elementPropertyExists(class std::basic_string<char,struct std::char_traits,class std::allocator > const &,class std::vector<class std::basic_string<char,struct std::char_traits,class std::allocator >,class std::allocator<class std::basic_string<char,struct std::char_traits,class std::allocator > > > const &)const " (?elementPropertyExists@PLYReader@cilantro@@QEBA_NAEBV?$basic_string@DU?$char_traits@D@std@@v?$allocator@D@2@@std@@aebv?$vector@V?$basic_string@DU?$char_traits@D@std@@v?$allocator@D@2@@std@@v?$allocator@V?$basic_string@DU?$char_traits@D@std@@v?$allocator@D@2@@std@@@2@@4@@z) FaceScanViewerApp E:\FaceScan\FaceScanViwer\FaceScanViewerApp\facealign.obj 1

Error LNK2019 unresolved external symbol "public: class std::shared_ptr __cdecl tinyply::PlyFile::request_properties_from_element(class std::basic_string<char,struct std::char_traits,class std::allocator > const &,class std::vector<class std::basic_string<char,struct std::char_traits,class std::allocator >,class std::allocator<class std::basic_string<char,struct std::char_traits,class std::allocator > > >,unsigned int)" (?request_properties_from_element@PlyFile@tinyply@@qeaa?AV?$shared_ptr@UPlyData@tinyply@@@std@@aebv?$basic_string@DU?$char_traits@D@std@@v?$allocator@D@2@@4@V?$vector@V?$basic_string@DU?$char_traits@D@std@@v?$allocator@D@2@@std@@v?$allocator@V?$basic_string@DU?$char_traits@D@std@@v?$allocator@D@2@@std@@@2@@4@I@Z) referenced in function "public: class std::shared_ptr __cdecl cilantro::PLYReader::requestData(class std::basic_string<char,struct std::char_traits,class std::allocator > const &,class std::vector<class std::basic_string<char,struct std::char_traits,class std::allocator >,class std::allocator<class std::basic_string<char,struct std::char_traits,class std::allocator > > > const &,unsigned int)" (?requestData@PLYReader@cilantro@@qeaa?AV?$shared_ptr@UPlyData@tinyply@@@std@@aebv?$basic_string@DU?$char_traits@D@std@@v?$allocator@D@2@@4@AEBV?$vector@V?$basic_string@DU?$char_traits@D@std@@v?$allocator@D@2@@std@@v?$allocator@V?$basic_string@DU?$char_traits@D@std@@v?$allocator@D@2@@std@@@2@@4@I@Z) FaceScanViewerApp E:\FaceScan\FaceScanViwer\FaceScanViewerApp\facealign.obj 1

I know if i sucecss complie Eigen3 and Panolin in ubuntu18, cilantro also complie smoothly, but there is not in Win10. why?

@kzampog
Copy link
Owner

kzampog commented Oct 27, 2020

Hi! Unfortunately, I haven't given VS a proper try in a very long time :(
One reason is that VS only supports a very old version of OpenMP, so some (if not all) of the multi-threading will not work (and may even fail to compile).

The error you're quoting seems to be at the linking stage and you mention that you were able to build the library. Are you linking your project against the library (e.g. using something like target_link_libraries(my_executable ${cilantro_LIBRARIES})?

BTW, did you manage to build the examples?

Not sure if it helps, but you should have no issues building everything within WSL on Windows :) (you might need an X server for the visualization stuff though).

Edit: this might also be interesting if you don't mind switching compilers:
https://stackoverflow.com/questions/43318137/using-openmp-3-4-in-visual-studio-2017

@CarlLyt
Copy link
Author

CarlLyt commented Oct 27, 2020

Thank you very much for your reply,
After an afternoon of hard work, I fixed this promble,I just tested the project , it worked well .
I made the following adjustments

  1. OPenMP 2.0 seem not to be able use size_t in the for loop, so i replaced size_t with int.
  2. It look some promblem when i use the visualization stuff, so i add #find_package(Pangolin QUIET), Display functionality is not used
  3. I git clone tinyply in my computer, (cmake && make),and add the tinyply.lib in my own project

So, it work well without display function, that also satisfy my need
Thank you again for taking the time to reply to my question, this issuse can be close :)

@CarlLyt CarlLyt closed this as completed Oct 27, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants