C++头文件已包含但仍然提示 reference to...
vscode吧
全部回复
仅看楼主
level 2
如题
引用的是json.h(与cpp文件同目录)
这是报错:
E:\Temp\ccS2tqRs.o: In function `Register()':
e:/ComputerProgrammer/C++/LibrarySystem/LibrarySystem.cpp:29: undefined reference to `Json::Value::Value(Json::ValueType)'
e:/ComputerProgrammer/C++/LibrarySystem/LibrarySystem.cpp:37: undefined reference to `Json::Value::Value(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
e:/ComputerProgrammer/C++/LibrarySystem/LibrarySystem.cpp:37: undefined reference to `Json::Value::operator[](char const*)'
e:/ComputerProgrammer/C++/LibrarySystem/LibrarySystem.cpp:37: undefined reference to `Json::Value::operator=(Json::Value&&)'
e:/ComputerProgrammer/C++/LibrarySystem/LibrarySystem.cpp:37: undefined reference to `Json::Value::~Value()'
e:/ComputerProgrammer/C++/LibrarySystem/LibrarySystem.cpp:29: undefined reference to `Json::Value::~Value()'
e:/ComputerProgrammer/C++/LibrarySystem/LibrarySystem.cpp:37: undefined reference to `Json::Value::~Value()'
e:/ComputerProgrammer/C++/LibrarySystem/LibrarySystem.cpp:29: undefined reference to `Json::Value::~Value()'
collect2.exe: error: ld returned 1 exit status
头文件里这些定义全部存在
c_cpp_properties.json里添加了路径
2022年08月10日 08点08分 1
level 13
c_cpp_properties.json仅仅影响intellisense,不会影响编译。
我说了,你需要学习命令行知识。
然而我不会C++,所以我无法直接解答你的问题。你要是觉得我是谜语人就当我没回复过。
2022年08月10日 14点08分 3
1