我试图将Chilkat C / C ++库添加到Windows 7的CodeBlocks(32位版本12.11)中的项目中。
所以我去了http://www.chilkatsoft.com/downloads_mingw.asp,并下载了32位的MinGW库。
然后在CodeBlocks中我做了:
最后,我遇到了这两个问题:
#include<...>
并在括号内按 Ctrl + Space 时,没有任何与Chilkat库相关的建议。请参阅下面的第一个代码块以获取完整代码(非常简单)。CkMailMan.h
的情况下成功构建,但在我实例化CkMailMan
时它会中断,并在下面的第二个代码块中显示错误。我怀疑它与图书馆扩展名是&#34; .a,&#34;这是为Linux。 但是,当我执行此库的Visual Basic版本(扩展名.dll)并使用Microsoft Visual C ++ 2010编译器时,我遇到了同样的问题。任何想法?
代码:
#include <iostream>
#include <CkMailMan.h>
using namespace std;
CkMailMan mailman;
int main()
{
cout << "Hello world!" << endl;
return 0;
}
运行代码时构建日志中的错误消息:
-------------- Build: Debug in TimeButler (compiler: GNU GCC Compiler)---------------
mingw32-g++.exe -Wall -fexceptions -g -IC:\chilkat-9.5.0-x86-vc10\include -IC:\chilkat-9.5.0-mingw32\include -IC:\chilkat-9.5.0-mingw32\include -c C:\TimeButler\main.cpp -o obj\Debug\main.o
mingw32-g++.exe -LC:\chilkat-9.5.0-x86-vc10\libs -LC:\chilkat-9.5.0-mingw32 -LC:\chilkat-9.5.0-mingw32 -o bin\Debug\TimeButler.exe obj\Debug\main.o C:\chilkat-9.5.0-x86-vc10\libs\ChilkatDbg.lib C:\chilkat-9.5.0-x86-vc10\libs\ChilkatDbgDll.lib C:\chilkat-9.5.0-x86-vc10\libs\ChilkatRel.lib C:\chilkat-9.5.0-x86-vc10\libs\ChilkatRelDll.lib C:\chilkat-9.5.0-x86-vc10\libs\ChilkatDbg.lib C:\chilkat-9.5.0-x86-vc10\libs\ChilkatDbgDll.lib C:\chilkat-9.5.0-x86-vc10\libs\ChilkatRel.lib C:\chilkat-9.5.0-x86-vc10\libs\ChilkatRelDll.lib C:\chilkat-9.5.0-mingw32\libchilkat-9.5.0.a
C:\chilkat-9.5.0-mingw32\libchilkat-9.5.0.a(CkMailMan.o):CkMailMan.cpp:(.text+0x51): undefined reference to `_Unwind_Resume'
C:\chilkat-9.5.0-mingw32\libchilkat-9.5.0.a(CkMailMan.o):CkMailMan.cpp:(.text+0x14a): undefined reference to `_Unwind_Resume'
C:\chilkat-9.5.0-mingw32\libchilkat-9.5.0.a(CkMailMan.o):CkMailMan.cpp:(.text+0x395): undefined reference to `_Unwind_Resume'
C:\chilkat-9.5.0-mingw32\libchilkat-9.5.0.a(CkMailMan.o):CkMailMan.cpp:(.text+0x4cf): undefined reference to `_Unwind_Resume'
C:\chilkat-9.5.0-mingw32\libchilkat-9.5.0.a(CkMailMan.o):CkMailMan.cpp:(.text+0x5d7): undefined reference to `_Unwind_Resume'
C:\chilkat-9.5.0-mingw32\libchilkat-9.5.0.a(CkMailMan.o):CkMailMan.cpp:(.text+0x6df): more undefined references to `_Unwind_Resume' follow
C:\chilkat-9.5.0-mingw32\libchilkat-9.5.0.a(CkMailMan.o):CkMailMan.cpp:(.eh_frame+0x13): undefined reference to `__gxx_personality_v0'
C:\chilkat-9.5.0-mingw32\libchilkat-9.5.0.a(ClsBase.o):ClsBase.cpp:(.text+0x15a): undefined reference to `_Unwind_Resume'
C:\chilkat-9.5.0-mingw32\libchilkat-9.5.0.a(ClsBase.o):ClsBase.cpp:(.text+0x247): undefined reference to `_Unwind_Resume'
C:\chilkat-9.5.0-mingw32\libchilkat-9.5.0.a(ClsBase.o):ClsBase.cpp:(.text+0x30b): undefined reference to `_Unwind_Resume'
C:\chilkat-9.5.0-mingw32\libchilkat-9.5.0.a(ClsBase.o):ClsBase.cpp:(.text+0x35b): undefined reference to `_Unwind_Resume'
C:\chilkat-9.5.0-mingw32\libchilkat-9.5.0.a(ClsBase.o):ClsBase.cpp:(.text+0x805): undefined reference to `_Unwind_Resume'
C:\chilkat-9.5.0-mingw32\libchilkat-9.5.0.a(ClsBase.o):ClsBase.cpp:(.text+0x9c8): more undefined references to `_Unwind_Resume' follow
C:\chilkat-9.5.0-mingw32\libchilkat-9.5.0.a(ClsBase.o):ClsBase.cpp:(.eh_frame+0x173): undefined reference to `__gxx_personality_v0'
C:\chilkat-9.5.0-mingw32\libchilkat-9.5.0.a(CkMultiByteBase.o):CkMultiByteBase.cpp:(.text+0x6a): undefined reference to `_Unwind_Resume'
C:\chilkat-9.5.0-mingw32\libchilkat-9.5.0.a(CkMultiByteBase.o):CkMultiByteBase.cpp:(.text+0x522): undefined reference to `_Unwind_Resume'
C:\chilkat-9.5.0-mingw32\libchilkat-9.5.0.a(CkMultiByteBase.o):CkMultiByteBase.cpp:(.text+0x666): undefined reference to `_Unwind_Resume'
C:\chilkat-9.5.0-mingw32\libchilkat-9.5.0.a(CkMultiByteBase.o):CkMultiByteBase.cpp:(.eh_frame+0x13): undefined reference to `__gxx_personality_v0'
C:\chilkat-9.5.0-mingw32\libchilkat-9.5.0.a(ClsMailMan.o):ClsMailMan.cpp:(.text+0xa5): undefined reference to `_Unwind_Resume'
C:\chilkat-9.5.0-mingw32\libchilkat-9.5.0.a(ClsMailMan.o):ClsMailMan.cpp:(.text+0x151): undefined reference to `_Unwind_Resume'
C:\chilkat-9.5.0-mingw32\libchilkat-9.5.0.a(ClsMailMan.o):ClsMailMan.cpp:(.text+0x3fd): undefined reference to `_Unwind_Resume'
C:\chilkat-9.5.0-mingw32\libchilkat-9.5.0.a(ClsMailMan.o):ClsMailMan.cpp:(.text+0x587): undefined reference to `_Unwind_Resume'
C:\chilkat-9.5.0-mingw32\libchilkat-9.5.0.a(ClsMailMan.o):ClsMailMan.cpp:(.text+0x8af): undefined reference to `_Unwind_Resume'
C:\chilkat-9.5.0-mingw32\libchilkat-9.5.0.a(ClsMailMan.o):ClsMailMan.cpp:(.text+0xbd3): more undefined references to `_Unwind_Resume' follow
C:\chilkat-9.5.0-mingw32\libchilkat-9.5.0.a(ClsMailMan.o):ClsMailMan.cpp:(.eh_frame+0x3f): undefined reference to `__gxx_personality_v0'
C:\chilkat-9.5.0-mingw32\libchilkat-9.5.0.a(_clsTcp.o):_clsTcp.cpp:(.text+0x117): undefined reference to `_Unwind_Resume'
C:\chilkat-9.5.0-mingw32\libchilkat-9.5.0.a(_clsTcp.o):_clsTcp.cpp:(.text+0x253): undefined reference to `_Unwind_Resume'
C:\chilkat-9.5.0-mingw32\libchilkat-9.5.0.a(_clsTcp.o):_clsTcp.cpp:(.text+0x3bf): undefined reference to `_Unwind_Resume'
C:\chilkat-9.5.0-mingw32\libchilkat-9.5.0.a(_clsTcp.o):_clsTcp.cpp:(.text+0x5ff): undefined reference to `_Unwind_Resume'
C:\chilkat-9.5.0-mingw32\libchilkat-9.5.0.a(_clsTcp.o):_clsTcp.cpp:(.text+0x806): undefined reference to `_Unwind_Resume'
C:\chilkat-9.5.0-mingw32\libchilkat-9.5.0.a(_clsTcp.o):_clsTcp.cpp:(.text+0x88b): more undefined references to `_Unwind_Resume' follow
C:\chilkat-9.5.0-mingw32\libchilkat-9.5.0.a(_clsTcp.o):_clsTcp.cpp:(.eh_frame+0xcb): undefined reference to `__gxx_personality_v0'
C:\chilkat-9.5.0-mingw32\libchilkat-9.5.0.a(CkString.o):CkString.cpp:(.text+0x5b): undefined reference to `_Unwind_Resume'
C:\chilkat-9.5.0-mingw32\libchilkat-9.5.0.a(CkString.o):CkString.cpp:(.text+0xd6): undefined reference to `_Unwind_Resume'
C:\chilkat-9.5.0-mingw32\libchilkat-9.5.0.a(CkString.o):CkString.cpp:(.text+0x142): undefined reference to `_Unwind_Resume'
C:\chilkat-9.5.0-mingw32\libchilkat-9.5.0.a(CkString.o):CkString.cpp:(.text+0x3dd): undefined reference to `_Unwind_Resume'
C:\chilkat-9.5.0-mingw32\libchilkat-9.5.0.a(CkString.o):CkString.cpp:(.text+0x451): undefined reference to `_Unwind_Resume'
C:\chilkat-9.5.0-mingw32\libchilkat-9.5.0.a(CkString.o):CkString.cpp:(.text+0x4e2): more undefined references to `_Unwind_Resume' follow
C:\chilkat-9.5.0-mingw32\libchilkat-9.5.0.a(CkString.o):CkString.cpp:(.eh_frame+0x13): undefined reference to `__gxx_personality_v0'
C:\chilkat-9.5.0-mingw32\libchilkat-9.5.0.a(XString.o):XString.cpp:(.text+0xd3): undefined reference to `_Unwind_Resume'
C:\chilkat-9.5.0-mingw32\libchilkat-9.5.0.a(XString.o):XString.cpp:(.text+0x163): undefined reference to `_Unwind_Resume'
C:\chilkat-9.5.0-mingw32\libchilkat-9.5.0.a(XString.o):XString.cpp:(.text+0x21b): undefined reference to `_Unwind_Resume'
C:\chilkat-9.5.0-mingw32\libchilkat-9.5.0.a(XString.o):XString.cpp:(.text+0x862): undefined reference to `_Unwind_Resume'
C:\chilkat-9.5.0-mingw32\libchilkat-9.5.0.a(XString.o):XString.cpp:(.text+0xfd9): undefined reference to `_Unwind_Resume'
C:\chilkat-9.5.0-mingw32\libchilkat-9.5.0.a(XString.o):XString.cpp:(.text+0xff3): more undefined references to `_Unwind_Resume' follow
C:\chilkat-9.5.0-mingw32\libchilkat-9.5.0.a(XString.o):XString.cpp:(.eh_frame+0x13): undefined reference to `__gxx_personality_v0'
C:\chilkat-9.5.0-mingw32\libchilkat-9.5.0.a(ClsHttpProxyClient.o):ClsHttpProxyClient.cpp:(.text+0xaf): undefined reference to `_Unwind_Resume'
C:\chilkat-9.5.0-mingw32\libchilkat-9.5.0.a(ClsHttpProxyClient.o):ClsHttpProxyClient.cpp:(.text+0x15f): undefined reference to `_Unwind_Resume'
C:\chilkat-9.5.0-mingw32\libchilkat-9.5.0.a(ClsHttpProxyClient.o):ClsHttpProxyClient.cpp:(.text+0x482): undefined reference to `_Unwind_Resume'
C:\chilkat-9.5.0-mingw32\libchilkat-9.5.0.a(ClsHttpProxyClient.o):ClsHttpProxyClient.cpp:(.text+0x733): undefined reference to `_Unwind_Resume'
Process terminated with status 1 (0 minutes, 10 seconds)
50 errors, 0 warnings (0 minutes, 10 seconds)
答案 0 :(得分:0)
原来我需要切换到visual Studio C ++编译器并以该编译器的格式下载库。我不能使用'.a'扩展库是对的。