How can I compile C programs written for Visual Studio? I get the following compilation problems..
Compilatore: Default compiler Building Makefile: "C:\mydata\sources\c\dev-c++\Makefile.win" Esecuzione di make... make.exe -f "C:\mydata\sources\c\dev-c++\Makefile.win" all gcc.exe -c jpegofthedeath.c -o jpegofthedeath.o -I"C:/Program Files/Dev-Cpp/include"
gcc.exe jpegofthedeath.o -o "jpegofthedeath.exe" -L"C:/Program Files/Dev-Cpp/lib"
jpegofthedeath.o(.text+0xa49):jpegofthedeath.c: undefined reference to WSAStartup@8' jpegofthedeath.o(.text+0xa74):jpegofthedeath.c: undefined reference tohtonl@4' jpegofthedeath.o(.text+0x10de):jpegofthedeath.c: undefined reference to fcloseall' jpegofthedeath.o(.text+0x10e3):jpegofthedeath.c: undefined reference toWSACleanup@0' make.exe: *** [jpegofthedeath.exe] Error 1
WSAStartup@8' jpegofthedeath.o(.text+0xa74):jpegofthedeath.c: undefined reference to
fcloseall' jpegofthedeath.o(.text+0x10e3):jpegofthedeath.c: undefined reference to
All the functions except fcloseall are in the Microsoft Ws2_32.lib. If there is a libWs2_32.a in Dev-Cpp, you must include it in the linker parameters. If there is not you can try linking to the Microsoft Ws2_32.lib.
If that doesn't work the Ws2_32.lib must be converted to a libWs2_32.a library. See http://lair.gamedeveloper.net/all/entityview.php?eid=641
The function fcloseall is Unix command. The only thing I can see is mabye you need a
in the program.
Log in to post a comment.
How can I compile C programs written for Visual Studio? I get the following compilation problems..
Compilatore: Default compiler
Building Makefile: "C:\mydata\sources\c\dev-c++\Makefile.win"
Esecuzione di make...
make.exe -f "C:\mydata\sources\c\dev-c++\Makefile.win" all
gcc.exe -c jpegofthedeath.c -o jpegofthedeath.o -I"C:/Program Files/Dev-Cpp/include"
gcc.exe jpegofthedeath.o -o "jpegofthedeath.exe" -L"C:/Program Files/Dev-Cpp/lib"
jpegofthedeath.o(.text+0xa49):jpegofthedeath.c: undefined reference to
WSAStartup@8' jpegofthedeath.o(.text+0xa74):jpegofthedeath.c: undefined reference to
htonl@4'jpegofthedeath.o(.text+0x10de):jpegofthedeath.c: undefined reference to
fcloseall' jpegofthedeath.o(.text+0x10e3):jpegofthedeath.c: undefined reference to
WSACleanup@0'make.exe: *** [jpegofthedeath.exe] Error 1
All the functions except fcloseall are in the Microsoft Ws2_32.lib. If there is a libWs2_32.a in Dev-Cpp, you must include it in the linker parameters. If there is not you can try linking to the Microsoft Ws2_32.lib.
If that doesn't work the Ws2_32.lib must be converted to a libWs2_32.a library. See
http://lair.gamedeveloper.net/all/entityview.php?eid=641
The function fcloseall is Unix command. The only thing I can see is mabye you need a
define _GNU_SOURCE
include <stdio.h>
in the program.