Mingw 和 libraw 导致未定义的引用
Mingw and libraw results in undefined reference
有人在mingw中使用libraw吗?我正在尝试编译程序并收到以下错误:
objReleaseincimgcimg.o:cimg.cpp|| undefined reference to `_imp___ZN6LibRawC1Ej'|
objReleaseincimgcimg.o:cimg.cpp|| undefined reference to `_imp___ZN6LibRaw9open_fileEPKcx'|
objReleaseincimgcimg.o:cimg.cpp|| undefined reference to `_imp___ZN6LibRaw6unpackEv'|
objReleaseincimgcimg.o:cimg.cpp|| undefined reference to `_imp___ZN6LibRaw13dcraw_processEv'|
objReleaseincimgcimg.o:cimg.cpp|| undefined reference to `_imp___ZN6LibRaw20dcraw_make_mem_imageEPi'|
objReleaseincimgcimg.o:cimg.cpp|| undefined reference to `_imp___ZN6LibRaw7recycleEv'|
objReleaseincimgcimg.o:cimg.cpp:(.text$_ZN6LibRawD1Ev[LibRaw::~LibRaw()]+0xf)||undefined reference to `_imp___ZN6LibRaw7recycleEv'|
||=== Build finished: 7 errors, 0 warnings ===|
我将libraw.a添加到我的项目中。无法弄清楚问题所在。有人知道吗?
从这些符号名称来看,您似乎正在尝试针对 libraw 的 DLL 版本进行编译(由 _imp___
前缀暗示)。 检查您的 libraw 头文件,并确保函数名称前面没有类似 __declspec(dllimport)
或 __attribute__((dllimport))
的内容。 这些有时被宏定义隐藏,因此请检查头文件以查看是否有另一个宏可以定义,这将导致它在函数原型中不使用该属性。
相关文章:
- 对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()' 错误的未定义引用