|
-
October 24th, 2009, 06:18 PM
#1
"Undefined reference to: " errors in Qt Creator
Hello,this is my first post on this forum.
I started using Qt Creator(on Windows) and I have a problem.I found a source code(pure c++) on internet,and tried it to compile with Qt Creator(chose build item from the menu) .It gave these problems:
"
...PracSockWin.cpp:39: undefined reference to `gethostbyname@4'
...PracSockWin.cpp:47: undefined reference to `htons@4'
...PracSockWin.cpp:62: undefined reference to `socket@12'
...PracSockWin.cpp:88: undefined reference to `inet_ntoa@4'
"
It found many of these type errors,what should I do?
-
October 24th, 2009, 07:28 PM
#2
Re: "Undefined reference to: " errors in Qt Creator
This is a program which uses winsock.h.
-
October 25th, 2009, 03:34 AM
#3
Re: "Undefined reference to: " errors in Qt Creator
Wouldn't it be nicer to use the qt network module since qt is cross-platform and you're using qt...
http://doc.trolltech.com/4.0/qt4-network.html
If you're going to use winsock, which in this case I wouldn't recommend, you need to link the lib Ws2_32.
0100 0111 0110 1111 0110 0100 0010 0000 0110 1001 0111 0011 0010 0000 0110 0110 0110 1111 0111 0010
0110 0101 0111 0110 0110 0101 0111 0010 0010 0001 0010 0001 0000 0000 0000 0000 0000 0000 0000 0000
-
October 26th, 2009, 07:28 PM
#4
Re: "Undefined reference to: " errors in Qt Creator
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|