-
Notifications
You must be signed in to change notification settings - Fork 35
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
编译报错,多次定义,编译-用的std=c++11 #1
Comments
抱歉,前些日子出去度假了,今天抽空我看一下,初步看是条件编译的问题。 |
非常抱歉,之前因为加班和其他原因,文档还未及时补全,导致使用手册缺失。 |
是这样的,我先在本地编译成功后,得到静态lib,然后把头文件加入include文件夹下,并在CMakeLists中加入该目录,并且一同将静态lib加入lib目录中,进行链接, |
好的,收到反馈,我也尝试本地复现一下。 |
如果是在msvc环境下,实在无法很快解决,也可以考虑在编译选项中添加“/FORCE:MULTIPLE”来强制忽略重复定义的错误哈。 |
:在函数‘emock::InvocationMockBuilderGetter emock::mockAPI(std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&, char const*)’中:
reg_son_log.cpp:(.text+0x4d): emock::InvocationMockBuilderGetter emock::mockAPI(std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&, char const*) 的多重定义
CMakeFiles/main.dir/main.cpp.o:main.cpp:(.text+0x4d):第一次在此定义
src/libMysrc.a(grammar.cpp.o):在函数‘emock::InvocationMockBuilderGetter emock::mockAPI(std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&, char const*)’中:
grammar.cpp:(.text+0xf1): emock::InvocationMockBuilderGetter emock::mockAPI(std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&, char const*) 的多重定义
CMakeFiles/main.dir/main.cpp.o:main.cpp:(.text+0x4d):第一次在此定义
src/libMysrc.a(stonewt.cpp.o):在函数‘emock::InvocationMockBuilderGetter emock::mockAPI(std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&, char const*)’中:
stonewt.cpp:(.text+0x4d): emock::InvocationMockBuilderGetter emock::mockAPI(std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&, char const*) 的多重定义
CMakeFiles/main.dir/main.cpp.o:main.cpp:(.text+0x4d):第一次在此定义
The text was updated successfully, but these errors were encountered: