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

编译错误:xxx未定义的引用 #8

Open
ghost opened this issue May 13, 2019 · 2 comments
Open

编译错误:xxx未定义的引用 #8

ghost opened this issue May 13, 2019 · 2 comments

Comments

@ghost
Copy link

ghost commented May 13, 2019

这是添加了#include<assert.h>并且注释了代码中含有isnan的语句,然后编译的时候报错如下:

[ 98%] Linking CXX executable task7_texturing
../../texturing/libtexturing.a(texture_atlas.cpp.o):在函数‘TextureAtlas::TextureAtlas(unsigned int)’中:
texture_atlas.cpp:(.text+0x27a): 警告: the use of tmpnam' is dangerous, better use mkstemp'
../../texturing/libtexturing.a(generate_texture_views.cpp.o):在函数‘tex::from_nvm_scene(std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&, std::vector<TextureView, std::allocator >)’中:
generate_texture_views.cpp:(.text+0x18fc):对‘core::load_nvm_bundle(std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&, std::vector<core::NVMCameraInfo, std::allocatorcore::NVMCameraInfo >
)’未定义的引用
../../texturing/libtexturing.a(generate_texture_views.cpp.o):在函数‘core::Scene::create(std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&)’中:
generate_texture_views.cpp:(.text._ZN4core5Scene6createERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE[_ZN4core5Scene6createERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE]+0x6e):对‘core::Scene::load_scene(std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&)’未定义的引用
collect2: error: ld returned 1 exit status
examples/task7/CMakeFiles/task7_texturing.dir/build.make:132: recipe for target 'examples/task7/task7_texturing' failed
make[2]: *** [examples/task7/task7_texturing] Error 1
CMakeFiles/Makefile2:1247: recipe for target 'examples/task7/CMakeFiles/task7_texturing.dir/all' failed
make[1]: *** [examples/task7/CMakeFiles/task7_texturing.dir/all] Error 2
Makefile:83: recipe for target 'all' failed
make: *** [all] Error 2

@ghost
Copy link
Author

ghost commented May 13, 2019

注释了所有包含"isnan"的语句是因为,我添加了头文件:#include<math.h>之后,
还是报错说"isnan不在包含的范围内".
于是我就注释掉这些语句.

@ghost
Copy link
Author

ghost commented May 13, 2019

OK ,我已经解决了,因为在https://github.com/swayfreeda/ImageBasedModellingEduV1.0/blob/master/texturing/CMakeLists.txt这里代码错误.
我们需要吧CMakeLists.txt中改正为:
target_link_libraries(texturing core util sfm features)
哎,这种手误真的是太花时间了,希望老师改正一下.

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

0 participants