获取对function_name的未定义引用
Getting Undefined reference to function_name
我有一个用C编写的开源项目,并学习用C++包装它。 C 中使用的所有函数都在标头中定义,我已经将C++代码中的函数链接为静态库(具有包含和 lib 文件(。 现在,如果我尝试从我的 main 访问/使用函数,例如用 C 开源编写的 display(.cpp它会抛出未定义的引用错误。
注意:C 开源目录和包装器目录不在同一位置。刚刚复制了包含和库并链接到C++项目。
错误文本
CMakeFileswrapper.dir/objects.a(main.cpp.obj): In function `main':
G:/Development/wrapper/main.cpp:34: undefined reference to `IedConnection_create'
G:/Development/wrapper/main.cpp:36: undefined reference to `IedConnection_connect'
IedConnection_create 是一个用开源编写的函数,并在我的C++代码中包含相应的标头。
谁能帮我摆脱困境?谢谢
链接器找不到引用的符号。 在这里阅读: https://latedev.wordpress.com/2014/04/22/common-c-error-messages-2-unresolved-reference/
相关文章:
- 对C宏的未定义引用,但在定义它时会出现重新定义错误
- 编译时的 CImg 库返回对"__imp_SetDIBitsToDevice"的未定义引用
- 对Py_Initialize()的未定义引用
- 使用mysql c++连接器的未定义引用
- 对 Scalar ::Scalar() 的未定义引用
- 对复制 CTOR 和 CTOR 的未定义引用
- 对显式实例化的模板函数的未定义引用
- TensorRT (C++ API) 对"createNvOnnxParser_INTERNAL"的未定义引用
- 2个模板化类的非模板友元函数未定义引用错误
- 编译 libfluid 样本控制器时对"event_base_del_virtual"的未定义引用
- 获取对function_name的未定义引用
- 对 'std::thread::_M_start_thread CMake 的未定义引用进行基准测试
- 对结构方法的未定义引用
- 使用内联函数 c++ 的未定义引用
- 对 CMake 中'cudaRegisterLinkedBinary'链接错误的未定义引用?
- 对 DLOPEN 的未定义引用
- QT C++中对全局变量的未定义引用
- 快速数学导致对"__pow_finite"的未定义引用
- 对 boost::system::d etail::system_category_instance 的未定义引用,从
- OpenCV 3.4.3 中对 'cv::String::d eallocate()' 错误的未定义引用