Linker Error Undefined Reference To Wsastartup 8
Contents |
here for a undefined reference to wsastartup@8' code blocks quick overview of the site Help Center Detailed
Undefined Reference To `wnetaddconnection2a@16'
answers to any questions you might have Meta Discuss the workings and policies
Undefined Reference To Getaddrinfo
of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting
Mingw Winsock
ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 6.2 million programmers, just like you, helping each other. Join them; it only takes a lws2_32 minute: Sign up MinGW linker error: winsock up vote 28 down vote favorite 11 I am using MinGW compiler on Windows to compile my C++ application with sockets. My command for linking looks like: g++.exe -Wall -Wno-long-long -pedantic -lwsock32 -o dist/Windows/piskvorky { there are a lot of object files } and I have also tried g++.exe -Wall -Wno-long-long -pedantic -lws2_32 -o dist/Windows/piskvorky { there are a lot of object files } but in both case I get this error: build/Windows/MinGW-Windows/src/utils/tcpunit.o:tcpunit.cpp:(.text+0x33): undefined reference to `closesocket@4' build/Windows/MinGW-Windows/src/utils/tcpunit.o:tcpunit.cpp:(.text+0xd0): undefined reference to `send@16' build/Windows/MinGW-Windows/src/utils/tcpunit.o:tcpunit.cpp:(.text+0x1ee): undefined reference to `recv@16' build/Windows/MinGW-Windows/src/utils/tcpdevice.o:tcpdevice.cpp:(.text+0x184): undefined reference to `WSAStartup@8' build/Windows/MinGW-Windows/src/utils/tcpdevice.o:tcpdevice.cpp:(.text+0x1a5): undefined reference to `closesocket@4' build/Windows/MinGW-Windows/src/utils/tcpdevice.o:tcpdevice.cpp:(.text+0x1cb): undefined reference to `closesocket@4' build/Windows/MinGW-Windows/src/utils/tcpdevice.o:tcpdevice.cpp:(.text+0x1d3): undefined reference to `WSACleanup@0' build/Windows/MinGW-Windows/src/utils/tcpdevice.o:tcpdevice.cpp:(.text+0x6fe): undefined reference to `bind@12' build/Windows/MinGW-Windows/src/utils/tcpdevice.o:tcpdevice.cpp:(.text+0x724): undefined referen
Programming Boards C Programming undefined reference to `WSAStartup@8' Getting started with C or C++ | C Tutorial | C++ Tutorial | C and C++ FAQ | Get a compiler | Fixes for common problems Thread: undefined undefined reference to `_uuidfromstringa@8' reference to `WSAStartup@8' Thread Tools Show Printable Version Email this Page… Subscribe to this Thread… undefined reference to `doformatmessage' Display Linear Mode Switch to Hybrid Mode Switch to Threaded Mode 01-05-2005 #1 wicked View Profile View Forum Posts Registered User Join Date undefined reference to socket@12' code blocks Jan 2005 Posts 11 undefined reference to `WSAStartup@8' As the topic suggests I'm having trouble linking libs under Dev C++ 4(windows 2000). Also when creating a C project all my code I write providing it's more than a http://stackoverflow.com/questions/2033608/mingw-linker-error-winsock simple "hello world" kind of application doesn't seem to compile unless I change it's source file to .cpp rather than .c and no I'm not using c++ functions in the program. To get around these problems I've been having I've had to use MSVC++ changing the .c file to .cpp and use #pragma comment(lib, "wsock32.lib") rather than linking libs normally. wicked 01-05-2005 #2 Fordy View Profile View Forum Posts Visit Homepage &TH of undefined behavior Join Date http://cboard.cprogramming.com/c-programming/60326-undefined-reference-%60wsastartup@8.html Aug 2001 Posts 5,792 If memory serves correct, the libraries in DevC++ have a different naming convention to other compilers. In most compilers you would use "wsock32.lib", but I think in DevC++ it's called "libwsock32.a" or something similar. Try find this lib and link to it. Board Rules Blog 01-05-2005 #3 wicked View Profile View Forum Posts Registered User Join Date Jan 2005 Posts 11 Thats the thing, I've got no idea how to link to it via Dev C++ 4. wicked 01-05-2005 #4 anonytmouse View Profile View Forum Posts Yes, my avatar is stolen Join Date Dec 2002 Posts 2,544 Add "-lwsock32" (without the quotes) to the linker box under Project->Project Options->Parameters. If you have not set up a project, you will have to do that first. Go to File->New->Project->Empty Project. Then add your files by using Project->Add to Project. If you want to link with other windows libraries you can use the same syntax. For example, "-lgdi32 -ladvapi32" will link to gdi32.lib and advapi32.lib. 01-05-2005 #5 wicked View Profile View Forum Posts Registered User Join Date Jan 2005 Posts 11 Project->Project Options->Parameters. I fail to see a parameters option. Yes I've done everything else correctly. wicked 01-05-2005 #6 Ken Fitlike View Profile View Forum Posts Visit Homepage erstwhile Join Date Jan 2002 Posts 2,227 >>Dev C++ 4<< Possibly because you're using the 'Methuselah' version. Try upgrading t
Database CPUs Solaris Novell OpenVMS DOS Unix Mac Lounge Login» Register» Connect» Hardware & Devices http://www.computing.net/answers/programming/dev-c-compier-just-not-working-/24305.html ▼ General Hardware CPUs/Overclocking Networking See More... Software ▼ Security and Virus http://www.cplusplus.com/forum/beginner/83256/ Office Software PC Gaming See More... Operating Systems ▼ Windows 10 Windows 8 Windows 7 Windows XP See More... Off-Topic Tags How-tos Drivers Ask a Question Computing.NetForumsProgrammingC/C++ Solved DEV C++ Compier just NOT working :/ Tags:Programmingerror message Xploit February 12, 2011 at 09:06:33 Specs: Windows 7 I undefined reference have no idea why it's not working. I thought i may be writing programs with poor syntax or something but even when i run the example programs. It shows errors D: Here's some example code:#include
help me,here is my program 1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
#include