![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Hobbyist Programmer
Join Date: Aug 2004
Location: The Netherlands
Posts: 111
Rep Power: 5
![]() |
hi all, i've been learning C for a couple of months now, and i walked into a (to me) huge problem.
every tutorial i'm following about socket programming in C gives complete source codes to show how it works. usually this is nice, but my problem is that it won't compile: http://www.frostbytes.com/~jimf/pape...s/winsock.html this is one of the tutorials, and i know it is not the code problem. it is winsock.h and all its functions. i'm using DEV-CPP, MVC++, Pelles C as compilers, but none of them will work as it should.... while googling i've found that i should link the wsock32.lib, but i can't get this to work ![]() any hints? (preferably for dev-cpp, since i prefer this compiler)...
__________________
http://www.white-scorpion.nl |
|
|
|
|
|
#2 |
|
Expert Programmer
|
Isn't that for Winsocks 1.x? I always recalled linking "ws2_32.lib" into my files, and that should hold true for Winsocks2 application which is likely the library you have installed on your computer.
Try linging that, remember you can link it explicitly with #pragma comment (lib, "ws2_32.lib") in MSVC++. If that does not work, please post your errors. There isn't much anyone is going ot be able to help you with if we do not know what is wrong.
__________________
Clifford Matthew Roche <geek@cliffordroche.com> Web Hosting: http://www.crd-hosting.com Consulting: http://www.crdev-consulting.com |
|
|
|
|
|
#3 | |
|
Hobbyist Programmer
Join Date: Aug 2004
Location: The Netherlands
Posts: 111
Rep Power: 5
![]() |
Quote:
__________________
http://www.white-scorpion.nl |
|
|
|
|
|
|
#4 |
|
Highly Adaptive Penguin
Join Date: May 2005
Location: United States
Posts: 252
Rep Power: 4
![]() |
if
#pragma comment(lib,"ws2_32.lib") #pragma comment(lib,"wsock32.lib") |
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|