[ENet-discuss] Installing..
Francisco Selles
fsellesa at hotmail.com
Sun Sep 18 14:10:35 PDT 2005
Hello,
I really found very simple of using Enet, but I want to test Enet in my game
done in irrlicht, I am using, windowsXP, code: : blocks as IDE (equal to the
dev-c++ ) and mingW as compiler and I am not very right of how to install.
I add all following files in a project e compiled as static library:
host.c
list.c
memory.c
packet.c
peer.c
protocol.c
win32.c
win32.c
this generated the file libenet.a and 2 warning messages that perhaps are
important:
Project : Enet application
Compiler : GNU GCC Compiler (called directly)
Directory : C:\irrlicht-0.10.0\Selles_app\
--------------------------------------------------------------------------------
Switching to target: default
mingw32-gcc.exe -I..\..\Enet\include -I..\..\Enet -I"C:\Program
Files\CodeBlocks\include" -c ..\..\Enet\list.c -o .objs\Enet\list.o
mingw32-gcc.exe -I..\..\Enet\include -I..\..\Enet -I"C:\Program
Files\CodeBlocks\include" -c ..\..\Enet\memory.c -o .objs\Enet\memory.o
mingw32-gcc.exe -I..\..\Enet\include -I..\..\Enet -I"C:\Program
Files\CodeBlocks\include" -c ..\..\Enet\packet.c -o .objs\Enet\packet.o
mingw32-gcc.exe -I..\..\Enet\include -I..\..\Enet -I"C:\Program
Files\CodeBlocks\include" -c ..\..\Enet\peer.c -o .objs\Enet\peer.o
mingw32-gcc.exe -I..\..\Enet\include -I..\..\Enet -I"C:\Program
Files\CodeBlocks\include" -c ..\..\Enet\protocol.c -o .objs\Enet\protocol.o
mingw32-gcc.exe -I..\..\Enet\include -I..\..\Enet -I"C:\Program
Files\CodeBlocks\include" -c ..\..\Enet\unix.c -o .objs\Enet\unix.o
mingw32-gcc.exe -I..\..\Enet\include -I..\..\Enet -I"C:\Program
Files\CodeBlocks\include" -c ..\..\Enet\win32.c -o .objs\Enet\win32.o
..\..\Enet\win32.c: In function `enet_socket_create':
..\..\Enet\win32.c:96: warning: passing arg 3 of `ioctlsocket' from
incompatible pointer type
..\..\Enet\win32.c: In function `enet_socket_receive':
..\..\Enet\win32.c:228: warning: passing arg 7 of `WSARecvFrom' from
incompatible pointer type
mingw32-gcc.exe -I..\..\Enet\include -I..\..\Enet -I"C:\Program
Files\CodeBlocks\include" -c ..\..\Enet\host.c -o .objs\Enet\host.o
ar.exe -r libenet.a .objs\Enet\list.o .objs\Enet\memory.o
.objs\Enet\packet.o .objs\Enet\peer.o .objs\Enet\protocol.o
.objs\Enet\unix.o .objs\Enet\win32.o .objs\Enet\host.o
ranlib libenet.a
ar.exe: creating libenet.a
Process terminated with status 0 (0 minutes, 10 seconds)
0 errors, 2 warnings
then I create an aplication win32 and linked the libenet.a and included the
directory c:\Enet\include then I place just the following partial Enet code
in main fuction, just for test:
#include <windows.h>
#include "enet/enet.h"
#include "enet/list.h"
#include "enet/memory.h"
#include "enet/protocol.h"
#include "enet/time.h"
#include "enet/types.h"
//#include "enet/unix.h"
//#include "enet/utily.h"
#include "enet/win32.h"
#include "win32.c"
#include <stdio.h>
/* Declare Windows procedure */
LRESULT CALLBACK WindowProcedure (HWND, UINT, WPARAM, LPARAM);
/* Make the class name into a global variable */
char szClassName[ ] = "CodeBlocksWindowsApp";
int WINAPI WinMain (HINSTANCE hThisInstance,
HINSTANCE hPrevInstance,
LPSTR lpszArgument,
int nFunsterStil)
{
if (enet_initialize() != 0)
{
MessageBox(NULL, "Network failed", "Note", MB_OK);
return EXIT_FAILURE;
}
atexit (enet_deinitialize);
....
}
and appear the current problem, when I compile, the following mistake
appears :
Project : Win32 App
Compiler : GNU GCC Compiler (called directly)
Directory : C:\Documents and Settings\FSelles\Desktop\w32\
--------------------------------------------------------------------------------
Switching to target: default
mingw32-g++.exe -I..\..\..\..\Enet -I..\..\..\..\Enet\include
-I"..\..\..\..\Program Files\CodeBlocks\include" -I"C:\Program
Files\CodeBlocks\include" -c main.cpp -o .objs\main.o
In file included from main.cpp:12:
../../../../Enet/win32.c: In function `ENetSocket
enet_socket_create(ENetSocketType, const ENetAddress*)':
../../../../Enet/win32.c:96: error: invalid conversion from `int*' to
`u_long*'
../../../../Enet/win32.c:96: error: initializing argument 3 of `int
ioctlsocket(SOCKET, long int, u_long*)'
../../../../Enet/win32.c: In function `int enet_socket_receive(ENetSocket,
ENetAddress*, ENetBuffer*, size_t)':
../../../../Enet/win32.c:228: error: invalid conversion from `DWORD*' to
`int*'
../../../../Enet/win32.c:228: error: initializing argument 7 of `int
WSARecvFrom(SOCKET, _WSABUF*, DWORD, DWORD*, DWORD*, sockaddr*, int*,
_OVERLAPPED*, void (*)(DWORD, DWORD, _OVERLAPPED*, DWORD))'
Process terminated with status 1 (0 minutes, 1 seconds)
4 errors, 0 warnings
What might I have made wrong?
thank you,
Francisco Selles
_________________________________________________________________
MSN Messenger: instale grátis e converse com seus amigos.
http://messenger.msn.com.br
More information about the ENet-discuss
mailing list