MCServer Development Discussion
#1
(10-20-2011, 05:03 PM)FakeTruth Wrote: Yes there are: http://code.google.com/p/mc-server/sourc...k%2Fsource

A c++ minecraft server has intrigued me for quite a while now. I look forward to playing around with this project. I'm new to c++ but have been working with PHP for a long time.

I've been able to download and compile your project into windows using Vc2010 express without too much trouble, but I have yet to compile it for linux. I'm not familiar enough with c++ yet to know what the problem is. I run the make command and have come out with several errors. I've done research and have been able to solve a few of the errors, but I've made so many minor changes I'm afraid of what the outcome will be once I finish. I figure I should ask you what you did to compile for linux before I proceed.
Reply
Thanks given by:
#2
ajiekcahdp@ajiekcahdp-notebook:~/mc-server-read-only$ make
/usr/bin/g++ -O2 -s source/packets/cPacket_WindowClick.cpp -c -I. -Isource -Isource/md5 -IWebServer -Isource/packets -Itolua++-1.0.93/src/lib -Ilua-5.1.4/src -Izlib-1.2.5 -IiniFile -Itolua++-1.0.93/include -Ijsoncpp-src-0.5.0/include -Ijsoncpp-src-0.5.0/src/lib_json -o build/cPacket_WindowClick.o
In file included from source/packets/cPacket_WindowClick.h:3:0,
from source/packets/cPacket_WindowClick.cpp:1:
source/packets/cPacket.h:55:23: error: ‘SOCKET’ has not been declared
source/packets/cPacket.h:56:22: error: ‘SOCKET’ has not been declared
make: *** [build/cPacket_WindowClick.o] Error 1

please help me
my skype: war3_fanat
e-mail: war3_fanat@mail.ru
ICQ : 279127
Reply
Thanks given by:
#3
(10-21-2011, 08:04 PM)AJIeKCaHDp Wrote: ajiekcahdp@ajiekcahdp-notebook:~/mc-server-read-only$ make
/usr/bin/g++ -O2 -s source/packets/cPacket_WindowClick.cpp -c -I. -Isource -Isource/md5 -IWebServer -Isource/packets -Itolua++-1.0.93/src/lib -Ilua-5.1.4/src -Izlib-1.2.5 -IiniFile -Itolua++-1.0.93/include -Ijsoncpp-src-0.5.0/include -Ijsoncpp-src-0.5.0/src/lib_json -o build/cPacket_WindowClick.o
In file included from source/packets/cPacket_WindowClick.h:3:0,
from source/packets/cPacket_WindowClick.cpp:1:
source/packets/cPacket.h:55:23: error: ‘SOCKET’ has not been declared
source/packets/cPacket.h:56:22: error: ‘SOCKET’ has not been declared
make: *** [build/cPacket_WindowClick.o] Error 1

please help me
my skype: war3_fanat
e-mail: war3_fanat@mail.ru
ICQ : 279127



I saw this in:
source/MCSocket.h

Code:
#ifdef _WIN32
    typedef SOCKET xSocket;
#else
    typedef int xSocket;
#endif



so I changed
Code:
    static int SendData( SOCKET a_Socket, const char* a_Message, unsigned int a_Size, int a_Options );
    static int RecvAll( SOCKET a_Socket, char* a_Data, unsigned int a_Size, int a_Options );

to

Code:
    static int SendData( int a_Socket, const char* a_Message, unsigned int a_Size, int a_Options );
    static int RecvAll( int a_Socket, char* a_Data, unsigned int a_Size, int a_Options );

in
source/packets/cPacket.h



and that took care of that error. If you run make after making those changes you'll keep getting errors though. I kept making small changes 'till I got to this point. I haven't been able to figure it out yet:

Code:
/usr/bin/g++ -O2 -s source/cClientHandle.cpp -c -I. -Isource -Isource/md5 -IWebServer -Isource/packets -Itolua++-1.0.93/src/lib -Ilua-5.1.4/src -Izlib-1.2.5 -IiniFile -Itolua++-1.0.93/include -Ijsoncpp-src-0.5.0/include -Ijsoncpp-src-0.5.0/src/lib_json -o build/cClientHandle.o
In file included from source/cClientHandle.cpp:12:
source/cPluginManager.h:36: error: expected â;â before â(â token
source/cPluginManager.h:50: error: âstd::stringâ has not been declared
In file included from source/cClientHandle.cpp:13:
source/cPlayer.h:53: error: âstringâ in namespace âstdâ does not name a type
source/cClientHandle.cpp: In member function âvoid cClientHandle::HandlePacket(cPacket*)â:
source/cClientHandle.cpp:705: error: âclass cPlayerâ has no member named âGetColorâ
source/cClientHandle.cpp: In static member function âstatic void cClientHandle::ReceiveThread(void*)â:
source/cClientHandle.cpp:1025: error: ârecvâ was not declared in this scope
make: *** [build/cClientHandle.o] Error 1


I don't even know if the changes I've been making are correct. I've just been looking up the errors on google and looking up solutions. Though, that usually does work well. It worked well enough to get the windows version working. lol
Reply
Thanks given by:
#4
make: *** No rule to make target 'source/PacketHeader.cpp' , required for `build/PacketHeader.o'. Stop

File not exist source/PacketHeader.cpp
Reply
Thanks given by:
#5
(10-21-2011, 09:00 PM)AJIeKCaHDp Wrote: make: *** No rule to make target 'source/PacketHeader.cpp' , required for `build/PacketHeader.o'. Stop

File not exist source/PacketHeader.cpp


You've gotten farther than I have, what distro of linux are you using? Have you not gotten any other errors? If so what did you do to resolve them?


The make file is looking for a file that doesn't exists. I don't know if the source file is needed or if it can be removed from the makefile. It's not used in the windows compile so I'd try removing it from the makefile.


I'd imagine FakeTruth can shed some light on it for us. Big Grin
Reply
Thanks given by:
#6
Errors were heap, fixed a, reached here and got here, may have forgotten to put the author of this file?
Reply
Thanks given by:
#7
Hi, good to see there's some interest in this :p

@rs2k the socket error you fixed is not the right way to fix it, I'll look into it

I think the makefile is outdated, I'll try to build it with cygwin, should give the same errors as on linux
Reply
Thanks given by:
#8
(10-21-2011, 08:04 PM)AJIeKCaHDp Wrote: ajiekcahdp@ajiekcahdp-notebook:~/mc-server-read-only$ make
/usr/bin/g++ -O2 -s source/packets/cPacket_WindowClick.cpp -c -I. -Isource -Isource/md5 -IWebServer -Isource/packets -Itolua++-1.0.93/src/lib -Ilua-5.1.4/src -Izlib-1.2.5 -IiniFile -Itolua++-1.0.93/include -Ijsoncpp-src-0.5.0/include -Ijsoncpp-src-0.5.0/src/lib_json -o build/cPacket_WindowClick.o
In file included from source/packets/cPacket_WindowClick.h:3:0,
from source/packets/cPacket_WindowClick.cpp:1:
source/packets/cPacket.h:55:23: error: ‘SOCKET’ has not been declared
source/packets/cPacket.h:56:22: error: ‘SOCKET’ has not been declared
make: *** [build/cPacket_WindowClick.o] Error 1

please help me
my skype: war3_fanat
e-mail: war3_fanat@mail.ru
ICQ : 279127
You just need to add include "MCSocket.h"
Reply
Thanks given by:
#9
There's a lot more not compatible with Linux, just sit tight while I fix it
Reply
Thanks given by:
#10
(10-22-2011, 12:18 AM)FakeTruth Wrote: There's a lot more not compatible with Linux, just sit tight while I fix it

if you want I can provide linux to test
If the contacts above
[Sorry for my bad English]
Reply
Thanks given by:




Users browsing this thread: 5 Guest(s)