User forums > Help

[just installed, problems to compile]

(1/2) > >>

ecare:
Bonjour,

I've just downloaded code::block,
it works fine to open a file.c and for writing over the code but it doesn't compile!

here is what I get...

Compiling: serveur.c
serveur.c:5:24: sys/socket.h: No such file or directory
serveur.c:7:24: netinet/in.h: No such file or directory
serveur.c:8:19: netdn.h: No such file or directory
serveur.c:10: error: variable `sockaddr_in sin' has initializer but incomplete type
serveur.c:10: error: `AF_INET' was not declared in this scope
serveur.c:12: error: expected `,' or `;' before "void"
serveur.c:55:3: warning: no newline at end of file
serveur.c:10: error: storage size of `sin' isn't known
Process terminated with status 1 (0 minutes, 0 seconds)
7 errors, 1 warnings
 
I run two O.S. and with ubuntu no problems but my laptop is XP and it does not work!
So you see compiling does not recognize librairies that gcc do
And errors appears

PLEASE HELP!

XayC:
Edit: Ok this is wrong, sorry.
Seems you don't have MinGW on your system, make sure you have it, and also that Code::Blocks is looking in the right place.
"Settings" -> "Compiler and debugger settings" -> "Toolchain Executables" check that is pointing to your MinGW directory.

You may find more info in the CB wiki:
http://wiki.codeblocks.org/index.php?title=Installing_Code::Blocks_nightly_build_on_Windows
http://wiki.codeblocks.org/index.php?title=MinGW_installation

Regards, XayC

MortenMacFly:

--- Quote from: ecare on September 12, 2007, 07:06:27 pm ---serveur.c:5:24: sys/socket.h: No such file or directory
serveur.c:7:24: netinet/in.h: No such file or directory
serveur.c:8:19: netdn.h: No such file or directory

--- End quote ---
Those files are *not* part of the MinGW package. They implement unix/berekley sockets which has not been ported. You now have the following options:
1.) Use Cygwin API - unix sockets are available in this environment but then you will depend on the Cygwin layer (DLL).
2.) Use Windows sockets (WinAPI) but you have to modify the code heavily.
3.) Use another socket implementation that is capable of providing unix sockets (emulation) on Windows. Google for such.

With regards, Morten.

ecare:
bonjour,
thanks for your help Morten and XayC!!!

I'll try and get back to you...

bye

Jenna:
Perhaps you want to give the wxWidgets socket implementation a try? It should work on Win and on linux.
I would be interested in experience with this class, because I have to write a server/client to communicate between a web-application and several Beckhoff Bus Terminal Controllers over Tcp/Ip .

Navigation

[0] Message Index

[#] Next page

Go to full version