即使与 libole32 链接,外部库中也未定义 OLE 引用

发布于 2024-10-10 06:45:57 字数 2683 浏览 5 评论 0原文

使用 MINGW,我尝试将我的 C 代码与执行一些 OLE 操作的静态 C++ 库链接:

mingw32-gcc main.o resources.o -o mbcom.exe -L../../Lib/Iup -liup -liupole -lole32 -lcomctl32 -lstdc++ -mwindows

不幸的是,我得到了这个:

../../Lib/Iup/libiupole.a(tOleHandler.o):tOleHandler.cpp:(.text+0x341): undefined reference to `IID_IOleControl'
../../Lib/Iup/libiupole.a(tOleHandler.o):tOleHandler.cpp:(.text+0x9b0): undefined reference to `IID_IViewObject2'
../../Lib/Iup/libiupole.a(tOleHandler.o):tOleHandler.cpp:(.text+0xcb5): undefined reference to `IID_IUnknown'
../../Lib/Iup/libiupole.a(tOleHandler.o):tOleHandler.cpp:(.text+0xce8): undefined reference to `IID_IPersistStorage'
../../Lib/Iup/libiupole.a(tOleHandler.o):tOleHandler.cpp:(.text+0xd1b): undefined reference to `IID_IOleObject'
../../Lib/Iup/libiupole.a(tOleHandler.o):tOleHandler.cpp:(.text+0xd9d): undefined reference to `IID_IUnknown'
../../Lib/Iup/libiupole.a(tOleHandler.o):tOleHandler.cpp:(.text+0xdbf): undefined reference to `IID_IOleClientSite'
../../Lib/Iup/libiupole.a(tOleHandler.o):tOleHandler.cpp:(.text+0xde1): undefined reference to `IID_IOleWindow'
../../Lib/Iup/libiupole.a(tOleHandler.o):tOleHandler.cpp:(.text+0xe03): undefined reference to `IID_IOleControlSite'
../../Lib/Iup/libiupole.a(tOleHandler.o):tOleHandler.cpp:(.text+0xe25): undefined reference to `IID_IDispatch'
../../Lib/Iup/libiupole.a(tOleHandler.o):tOleHandler.cpp:(.text+0xe51): undefined reference to `IID_IOleInPlaceSite'
../../Lib/Iup/libiupole.a(tOleHandler.o):tOleHandler.cpp:(.text+0x1129): undefined reference to `GUID_NULL'
../../Lib/Iup/libiupole.a(tOleHandler.o):tOleHandler.cpp:(.text+0x124d): undefined reference to `GUID_NULL'
../../Lib/Iup/libiupole.a(tOleInPlaceSite.o):tOleInPlaceSite.cpp:(.text+0xc8): undefined reference to `IID_IOleInPlaceObject'
../../Lib/Iup/libiupole.a(tDispatch.o):tDispatch.cpp:(.text+0x108): undefined reference to `GUID_NULL'
../../Lib/Iup/libiupole.a(tDispatch.o):tDispatch.cpp:(.text+0x137): undefined reference to `VariantInit@4'
../../Lib/Iup/libiupole.a(tOleInPlaceFrame.o):tOleInPlaceFrame.cpp:(.text+0x1d9): undefined reference to `IID_IUnknown'
../../Lib/Iup/libiupole.a(tOleInPlaceFrame.o):tOleInPlaceFrame.cpp:(.text+0x211): undefined reference to `IID_IOleInPlaceUIWindow'
../../Lib/Iup/libiupole.a(tOleInPlaceFrame.o):tOleInPlaceFrame.cpp:(.text+0x22b): undefined reference to `IID_IOleWindow'
../../Lib/Iup/libiupole.a(tOleInPlaceFrame.o):tOleInPlaceFrame.cpp:(.text+0x245): undefined reference to `IID_IOleInPlaceFrame'
collect2: ld returned 1 exit status
mingw32-make: *** [mbcom.exe] Error 1

我能找到的唯一解决方案是与 libole32 链接,但正如你所看到的,我已经在这样做了。

还有其他想法吗?

Using MINGW, I'm trying to link my C code with a static C++ library that performs some OLE operations:

mingw32-gcc main.o resources.o -o mbcom.exe -L../../Lib/Iup -liup -liupole -lole32 -lcomctl32 -lstdc++ -mwindows

Unfortunately, I get this:

../../Lib/Iup/libiupole.a(tOleHandler.o):tOleHandler.cpp:(.text+0x341): undefined reference to `IID_IOleControl'
../../Lib/Iup/libiupole.a(tOleHandler.o):tOleHandler.cpp:(.text+0x9b0): undefined reference to `IID_IViewObject2'
../../Lib/Iup/libiupole.a(tOleHandler.o):tOleHandler.cpp:(.text+0xcb5): undefined reference to `IID_IUnknown'
../../Lib/Iup/libiupole.a(tOleHandler.o):tOleHandler.cpp:(.text+0xce8): undefined reference to `IID_IPersistStorage'
../../Lib/Iup/libiupole.a(tOleHandler.o):tOleHandler.cpp:(.text+0xd1b): undefined reference to `IID_IOleObject'
../../Lib/Iup/libiupole.a(tOleHandler.o):tOleHandler.cpp:(.text+0xd9d): undefined reference to `IID_IUnknown'
../../Lib/Iup/libiupole.a(tOleHandler.o):tOleHandler.cpp:(.text+0xdbf): undefined reference to `IID_IOleClientSite'
../../Lib/Iup/libiupole.a(tOleHandler.o):tOleHandler.cpp:(.text+0xde1): undefined reference to `IID_IOleWindow'
../../Lib/Iup/libiupole.a(tOleHandler.o):tOleHandler.cpp:(.text+0xe03): undefined reference to `IID_IOleControlSite'
../../Lib/Iup/libiupole.a(tOleHandler.o):tOleHandler.cpp:(.text+0xe25): undefined reference to `IID_IDispatch'
../../Lib/Iup/libiupole.a(tOleHandler.o):tOleHandler.cpp:(.text+0xe51): undefined reference to `IID_IOleInPlaceSite'
../../Lib/Iup/libiupole.a(tOleHandler.o):tOleHandler.cpp:(.text+0x1129): undefined reference to `GUID_NULL'
../../Lib/Iup/libiupole.a(tOleHandler.o):tOleHandler.cpp:(.text+0x124d): undefined reference to `GUID_NULL'
../../Lib/Iup/libiupole.a(tOleInPlaceSite.o):tOleInPlaceSite.cpp:(.text+0xc8): undefined reference to `IID_IOleInPlaceObject'
../../Lib/Iup/libiupole.a(tDispatch.o):tDispatch.cpp:(.text+0x108): undefined reference to `GUID_NULL'
../../Lib/Iup/libiupole.a(tDispatch.o):tDispatch.cpp:(.text+0x137): undefined reference to `VariantInit@4'
../../Lib/Iup/libiupole.a(tOleInPlaceFrame.o):tOleInPlaceFrame.cpp:(.text+0x1d9): undefined reference to `IID_IUnknown'
../../Lib/Iup/libiupole.a(tOleInPlaceFrame.o):tOleInPlaceFrame.cpp:(.text+0x211): undefined reference to `IID_IOleInPlaceUIWindow'
../../Lib/Iup/libiupole.a(tOleInPlaceFrame.o):tOleInPlaceFrame.cpp:(.text+0x22b): undefined reference to `IID_IOleWindow'
../../Lib/Iup/libiupole.a(tOleInPlaceFrame.o):tOleInPlaceFrame.cpp:(.text+0x245): undefined reference to `IID_IOleInPlaceFrame'
collect2: ld returned 1 exit status
mingw32-make: *** [mbcom.exe] Error 1

The only solution I can find is to link with libole32, but as you can see, I'm already doing that.

Any other ideas?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

樱&纷飞 2024-10-17 06:45:57

libuuid 是应该找到这些东西的地方。

除了 VariantInit,它位于 liboleaut32 中。

libuuid is where these things should be found.

Except VariantInit, which is in liboleaut32.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文