Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Sep 6th, 2004, 2:31 PM   #1
lepricaun
Hobbyist Programmer
 
lepricaun's Avatar
 
Join Date: Aug 2004
Location: The Netherlands
Posts: 111
Rep Power: 5 lepricaun is on a distinguished road
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
lepricaun is offline   Reply With Quote
Old Sep 6th, 2004, 11:01 PM   #2
kurifu
Expert Programmer
 
kurifu's Avatar
 
Join Date: Jul 2004
Location: Halifax, Nova Scotia (Canada)
Posts: 784
Rep Power: 5 kurifu is on a distinguished road
Send a message via ICQ to kurifu Send a message via MSN to kurifu
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
kurifu is offline   Reply With Quote
Old Sep 7th, 2004, 1:24 AM   #3
lepricaun
Hobbyist Programmer
 
lepricaun's Avatar
 
Join Date: Aug 2004
Location: The Netherlands
Posts: 111
Rep Power: 5 lepricaun is on a distinguished road
Quote:
remember you can link it explicitly with #pragma comment (lib, "ws2_32.lib")
i have seen this before, but i didn't know what it meant..... i will try it, but should i use winsock2.h too or just winsock.h ?
__________________
http://www.white-scorpion.nl
lepricaun is offline   Reply With Quote
Old May 30th, 2005, 10:30 AM   #4
Brent
Highly Adaptive Penguin
 
Brent's Avatar
 
Join Date: May 2005
Location: United States
Posts: 252
Rep Power: 4 Brent is on a distinguished road
if
#pragma comment(lib,"ws2_32.lib")
doesnt work try this
#pragma comment(lib,"wsock32.lib")
Brent is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 1:31 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC