本文介绍了开发人员-cpp链接器错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好,
尝试使用Dev-CPP IDE编译和运行轻量级Client Server软件项目,并且文件均位于正确的目录中,但是存在许多链接器错误.除了标准库,还有其他库吗??
谢谢
抱歉第一次太含糊.这是编译日志.
尼克

编译器:默认编译器
生成Makefile:"C:\ MyCsources \ Makefile.win"
正在执行make ...
mingw32-make.exe -f"C:\ MyCsources \ Makefile.win"全部
g ++.exe -D__DEBUG__ -c"../codeProject代码/myClient.cpp" -o"../codeProject代码/myClient.o" -I"C:/Dev-Cpp/lib/gcc/mingw32/3.4.2 /include"-I" C:/Dev-Cpp/include/c ++/3.4.2/backward"-I" C:/Dev-Cpp/include/c ++/3.4.2/mingw32"-I" C:/Dev -Cpp/include/c ++/3.4.2"-I" C:/Dev-Cpp/include"-I" C:/Dev-Cpp/include/sys"-I" C:/Dev-Cpp/include- I"C:/Dev-Cpp/include/c ++/3.4.2/debug" -g3

g ++.exe -D__DEBUG__"../codeProject代码/myClient.o" -o"sunday222.exe" -L"C:/Dev-Cpp/lib" -L"C:/Dev-Cpp/lib". /Program Files(x86)/Microsoft SDKs/Windows/v7.0A/Lib/WSock32.Lib"C:/Dev-Cpp/lib/debug/libstdc ++.a -g3

../codeProject代码/myClient.o(.text+0x271):在函数main中:

C:/MyCsources/../codeProject代码/myClient.cpp:29:未定义对`myException :: myException(int,std :: string const&)''的引用
../codeProject代码/myClient.o(.text+0x4ef):C:/MyCsources/../codeProject代码/myClient.cpp:48:未定义对`myHostInfo :: myHostInfo()''的引用
../codeProject代码/myClient.o(.text+0x77a):C:/MyCsources/../codeProject代码/myClient.cpp:63:未定义对`myHostInfo :: myHostInfo(std :: string& ;, hostType)的引用''
../codeProject代码/myClient.o(.text+0x9ac):C:/MyCsources/../codeProject代码/myClient.cpp:74:未定义引用`mySocket :: setLingerOnOff(bool)''
../codeProject代码/myClient.o(.text+0x9c2):C:/MyCsources/../codeProject代码/myClient.cpp:75:未定义引用`mySocket :: setLingerSeconds(int)''
../codeProject代码/myClient.o(.text+0x9d8):C:/MyCsources/../codeProject代码/myClient.cpp:77:未定义对`operator<<(std :: ostream& ;, mySocket& )''
../codeProject代码/myClient.o(.text+0xa12):C:/MyCsources/../codeProject代码/myClient.cpp:79:未定义对`operator<<(std :: ostream& ;, mySocket& )''
../codeProject代码/myClient.o(.text+0xac2):C:/MyCsources/../codeProject代码/myClient.cpp:84:未定义对`myTcpSocket :: connectToServer(std :: string& ;, hostType)的引用''
../codeProject代码/myClient.o(.text+0xc98):C:/MyCsources/../codeProject代码/myClient.cpp:102:未定义对`myTcpSocket :: sendMessage(std :: string&)的引用''
../codeProject代码/myClient.o(.text+0xd2d):C:/MyCsources/../codeProject代码/myClient.cpp:107:未定义对`myTcpSocket :: recieveMessage(std :: string&)的引用''
../codeProject代码/myClient.o(.text+0xfa2):C:/MyCsources/../codeProject代码/myClient.cpp:124:未定义对`myException :: myException(int,std :: string const& )''
../codeProject代码/myClient.o(.text+0x193b):在函数"Z41__static_initialization_and_destruction_0ii"中:
C:/MyCsources/../codeProject代码/myClient.cpp:9:对`myLog :: myLog()''的未定义引用
../codeProject代码/myClient.o(.text+0x19fa):C:/MyCsources/../codeProject代码/myClient.cpp:9:未定义对`myLog ::〜myLog()''的引用
../codeProject代码/myClient.o(.text$_ZN11myTcpSocketD1Ev[myTcpSocket::~myTcpSocket()]+0xb):在函数ZN8mySocketD0Ev中:
C:/MyCsources/../codeProject代码/myClient.cpp:对`vtable for myTcpSocket'的未定义引用
../codeProject代码/myClient.o(.text$_ZN11myTcpSocketC1Ei[myTcpSocket::myTcpSocket(int)]+0x14):C:/MyCsources/../codeProject代码/myClient.cpp:未定义对`mySocket :: mySocket的引用(int)''
../codeProject代码/myClient.o(.text$_ZN11myTcpSocketC1Ei[myTcpSocket::myTcpSocket(int)]+0x1d):C:/MyCsources/../codeProject代码/myClient.cpp:未定义对"vtable for myTcpSocket"的引用'
../codeProject代码/myClient.o(.text$_ZN11myExceptionD1Ev[myException::~~myException()]+0xb):C:/MyCsources/../codeProject代码/myClient.cpp:未定义引用"vtable for myException" '
collect2:ld返回了1个退出状态

mingw32-make.exe:*** [sunday222.exe]错误1

执行终止

Hello,
Trying to compile and run the lightweight Client Server software project, with Dev-CPP IDE and the files are all in the correct directories, however there are many linker errors. Are there some other libs to be included other than the standard ones.?
Thanks
Sorry too vague first time. here is compile log.
Nick

Compiler: Default compiler
Building Makefile: "C:\MyCsources\Makefile.win"
Executing make...
mingw32-make.exe -f "C:\MyCsources\Makefile.win" all
g++.exe -D__DEBUG__ -c "../codeProject code/myClient.cpp" -o "../codeProject code/myClient.o" -I"C:/Dev-Cpp/lib/gcc/mingw32/3.4.2/include" -I"C:/Dev-Cpp/include/c++/3.4.2/backward" -I"C:/Dev-Cpp/include/c++/3.4.2/mingw32" -I"C:/Dev-Cpp/include/c++/3.4.2" -I"C:/Dev-Cpp/include" -I"C:/Dev-Cpp/include/sys" -I"C:/Dev-Cpp/include" -I"C:/Dev-Cpp/include/c++/3.4.2/debug" -g3

g++.exe -D__DEBUG__ "../codeProject code/myClient.o" -o "sunday222.exe" -L"C:/Dev-Cpp/lib" -L"C:/Dev-Cpp/lib" "../Program Files (x86)/Microsoft SDKs/Windows/v7.0A/Lib/WSock32.Lib" C:/Dev-Cpp/lib/debug/libstdc++.a -g3

../codeProject code/myClient.o(.text+0x271): In function `main'':

C:/MyCsources/../codeProject code/myClient.cpp:29: undefined reference to `myException::myException(int, std::string const&)''
../codeProject code/myClient.o(.text+0x4ef):C:/MyCsources/../codeProject code/myClient.cpp:48: undefined reference to `myHostInfo::myHostInfo()''
../codeProject code/myClient.o(.text+0x77a):C:/MyCsources/../codeProject code/myClient.cpp:63: undefined reference to `myHostInfo::myHostInfo(std::string&, hostType)''
../codeProject code/myClient.o(.text+0x9ac):C:/MyCsources/../codeProject code/myClient.cpp:74: undefined reference to `mySocket::setLingerOnOff(bool)''
../codeProject code/myClient.o(.text+0x9c2):C:/MyCsources/../codeProject code/myClient.cpp:75: undefined reference to `mySocket::setLingerSeconds(int)''
../codeProject code/myClient.o(.text+0x9d8):C:/MyCsources/../codeProject code/myClient.cpp:77: undefined reference to `operator<<(std::ostream&, mySocket&)''
../codeProject code/myClient.o(.text+0xa12):C:/MyCsources/../codeProject code/myClient.cpp:79: undefined reference to `operator<<(std::ostream&, mySocket&)''
../codeProject code/myClient.o(.text+0xac2):C:/MyCsources/../codeProject code/myClient.cpp:84: undefined reference to `myTcpSocket::connectToServer(std::string&, hostType)''
../codeProject code/myClient.o(.text+0xc98):C:/MyCsources/../codeProject code/myClient.cpp:102: undefined reference to `myTcpSocket::sendMessage(std::string&)''
../codeProject code/myClient.o(.text+0xd2d):C:/MyCsources/../codeProject code/myClient.cpp:107: undefined reference to `myTcpSocket::recieveMessage(std::string&)''
../codeProject code/myClient.o(.text+0xfa2):C:/MyCsources/../codeProject code/myClient.cpp:124: undefined reference to `myException::myException(int, std::string const&)''
../codeProject code/myClient.o(.text+0x193b): In function `Z41__static_initialization_and_destruction_0ii'':
C:/MyCsources/../codeProject code/myClient.cpp:9: undefined reference to `myLog::myLog()''
../codeProject code/myClient.o(.text+0x19fa):C:/MyCsources/../codeProject code/myClient.cpp:9: undefined reference to `myLog::~myLog()''
../codeProject code/myClient.o(.text$_ZN11myTcpSocketD1Ev[myTcpSocket::~myTcpSocket()]+0xb): In function `ZN8mySocketD0Ev'':
C:/MyCsources/../codeProject code/myClient.cpp: undefined reference to `vtable for myTcpSocket''
../codeProject code/myClient.o(.text$_ZN11myTcpSocketC1Ei[myTcpSocket::myTcpSocket(int)]+0x14):C:/MyCsources/../codeProject code/myClient.cpp: undefined reference to `mySocket::mySocket(int)''
../codeProject code/myClient.o(.text$_ZN11myTcpSocketC1Ei[myTcpSocket::myTcpSocket(int)]+0x1d):C:/MyCsources/../codeProject code/myClient.cpp: undefined reference to `vtable for myTcpSocket''
../codeProject code/myClient.o(.text$_ZN11myExceptionD1Ev[myException::~myException()]+0xb):C:/MyCsources/../codeProject code/myClient.cpp: undefined reference to `vtable for myException''
collect2: ld returned 1 exit status

mingw32-make.exe: *** [sunday222.exe] Error 1

Execution terminated

推荐答案




这篇关于开发人员-cpp链接器错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-23 15:25