EQEmulator Forums

EQEmulator Forums (https://www.eqemulator.org/forums/index.php)
-   Archive::Development (https://www.eqemulator.org/forums/forumdisplay.php?f=621)
-   -   EQEmu DEV-C++ Howto (updated for 5.5DR1) (https://www.eqemulator.org/forums/showthread.php?t=11316)

Tertiary 01-11-2004 05:43 AM

EQEmu DEV-C++ Howto (updated for 5.5DR1)
 
Here is a HOWTO to get EQEmu 5.3DR2 (01/01/2004 version) to compile
with Bloodshed Dev-C++ / mingw.

http://www.rama.demon.co.uk/EQEmu-Dev-C++.zip

Most of the changes were trivial. The two biggest headaches were:

1) Dev-C++ won't by default link against the mysql libraries

I have included instructions on how to create a libmysql.a

2) vsnprintf would SIGSEGV every time.

In the end I found a portable version of vsnprintf written in C
which I have included in the zip, and included in the HOWTO details
of where to put #ifdefs to use this version when compiling under Dev-C++.

I have also included .dev files for Emusharemem/world and zone (similar to VS .NET's .SLN fies).

I have only tested briefly under minilogin and it seems stable enough.

EDIT: The following added for 5.5DR1

The source tree for 5.5DR1 with Dev-C++ changes already made is available here:

www.rama.demon.co.uk/5.5DR1DevCPPSource.zip

I found out why vsnprintf wasn't working, so the 5.5DR1 zip no longer uses the 'portable vsnprintf', rather there are changes to allow the standard vsnprintf to work. As a result, any bugs (such as non-functioning #npcspawn add) relating to the use of the portable vsnprintf should be gone.

mattmeck 01-11-2004 06:31 AM

Great contribution!!! 8)

Shadow-Wolf 01-11-2004 09:05 AM

this has just made my day maaaaan thank you!

Tertiary 01-11-2004 09:08 AM

Quote:

Originally Posted by Shadow-Wolf
this has just made my day maaaaan thank you!

Let me know if you get it to work :D

Shadow-Wolf 01-11-2004 11:03 AM

well sadly it didn't compile right =(
here are the errors i get:
86 C:\eqemu\5.3dr2dev\common\debug.h
In file included from ../common/debug.h
1 C:\eqemu\5.3dr2dev\EMuShareMem\Doors.cpp
from Doors.cpp
C:\eqemu\5.3dr2dev\common\Portable_vsnprintf.h
[Warning] In function `int portable_vsnprintf(char*,:
3 C:\eqemu\5.3dr2dev\common\Portable_vsnprintf.h
previous declaration of `int
225 C:\Dev-Cpp\include\stdio.h
conflicts with new declaration with C linkage
C:\eqemu\5.3dr2dev\EMuShareMem\Makefile.win
[Build Error] [Doors.o] Error 1

Tertiary 01-11-2004 11:16 AM

Thanks Shadow-Wolf. Give me a day or two and I will see if I can figure out what is wrong. BTW can you give me a link to the EQEmu source that you are using ?

Shadow-Wolf 01-11-2004 01:53 PM

well im using the source from shawns cvs
http://shawn319.eqemulator.net/cvs/ no changes made to it except for the ones you said to add

Tertiary 01-11-2004 08:04 PM

Don't add the

Code:

#ifdef __MINGW32__
#include "../common/Portable_vsnprintf.h"
#define vsnprintf portable_vsnprintf
#endif

to common/types.h (or remove it if you did). That was an error that slipped in while I was reworking the changes and compiling the howto.

Lurker_005 01-11-2004 11:33 PM

Very nice job! Should make quite a few people happy.
Dang! that makes an F#$%ing HUGE zone.exe!

First a note, I updated to mingw 3.3.1


In world\console.cpp
Code:

if defined(WIN32) && !defined(__MINGW32__)
is missing the # on the if

I had to add -D_GLIBCPP_USE_C99 -D_GLIBCPP_USE_C99_DYNAMIC to the dev files.

I got
Code:

Warning c:\SourceCode\EQEmu-0.5.3-DR1\world\Warning
.drectve `%.*s' unrecognized

when compiling world


For perl support:
c:\dev-cpp\bin\reimp -d c:\perl\lib\core\perl58.lib
c:\dev-cpp\bin\dlltool --input-def perl58.def --dllname perl58.dll --output-lib c:\dev-cpp\lib\perl58.a -k

and the beginning of zone_perl.dev
Code:

[Project]
FileName=Zone_perl.dev
Name=Zone_perl
Ver=1
IsCpp=1
Type=1
Compiler=-D__GNUWIN32__ -w -finline-functions -DCATCH_CRASH -D_WIN32_WINNT=0x0400 -DNDEBUG -DZONESERVER -DZONE -DINVERSEXY -DWIN32 -D_CONSOLE -D_MBCS -DFIELD_ITEMS -DEQDEBUG=0_@@_ -D_GLIBCPP_USE_C99 -D_GLIBCPP_USE_C99_DYNAMIC -DEMBPERL_PLUGIN -DEMBPERL_@@_
CppCompiler=-D__GNUWIN32__ -w -finline-functions -DCATCH_CRASH -D_WIN32_WINNT=0x0400 -DNDEBUG -DZONESERVER -DZONE -DINVERSEXY -DWIN32 -D_CONSOLE -D_MBCS -DFIELD_ITEMS -DEQDEBUG=0 -DSHAREMEM_@@_ -D_GLIBCPP_USE_C99 -D_GLIBCPP_USE_C99_DYNAMIC -DEMBPERL_PLUGIN -DEMBPERL_@@_
Includes=c:\mysql\include;c:\eqemu\zlib;c:\perl\lib\core
Linker=-lkernel32 -luser32 -lgdi32 -lwinspool -lcomdlg32 -ladvapi32 -lshell32 -lole32 -loleaut32 -luuid -lodbc32 -lodbccp32 -lkernel32 -luser32 -lgdi32 -lwinspool -lcomdlg32 -ladvapi32 -lshell32 -lole32 -loleaut32 -luuid -lodbc32 -lodbccp32 -lwsock32 -lzlib -lmysql_@@_ ../../../Dev-Cpp/lib/perl58.a_@@_
Libs=
UnitCount=121
Folders="Common Header Files","Common Source Files","Header Files","Source Files","Text Files"
ObjFiles=
PrivateResource=
ResourceIncludes=
MakeIncludes=
Icon=
ExeOutput=
ObjectOutput=
OverrideOutput=0
OverrideOutputName=Zone_perl.exe

I didn't do any testing besides compiling it.


FYI The changes didn't have an effect on compiling in MSVC++6 :)
Not that they should have.

Trumpcard 01-12-2004 01:22 AM

Any developers using bloodshed want to join the dev team ?

Muuss 01-12-2004 02:26 AM

Well, nice job Tertiary, amazing !

I compiled without real trouble using your fixes, with dev-cpp 4.9.8.0. things i did :
--added Portable_vsnprintf.h/cpp to the project files
--changed -lzlib to -lzlib1 (i used the pre-compiled zlib1.dll from www.zlib.org)
--adapted the directories to my configuration

Thank you for porting eqemu to BloodShed, that's great of you, nice to have it compiling on a free w32 compiler ! :)

ps : zone.exe weights 10

Muuss 01-12-2004 02:56 AM

Quote:

zone.exe weights 10 718 428 bytes.
for zone.dev,
project -> project options -> compiler [tab] -> linker -> generate debugging information = yes

reduced zone.exe to 2

Shadow-Wolf 01-12-2004 02:26 PM

ok, i got eqmemshare.dll compiled nothing bad so far but when i try to compile world.exe i get these errors:

console.cpp C:\eqemu\5.3dr2dev\world\console.cpp
In member function `void Console::ProcessCommand(const char*)':
682 C:\eqemu\5.3dr2dev\world\console.cpp
parse error before `(' token
686 C:\eqemu\5.3dr2dev\world\console.cpp
`Ver_name' undeclared (first use this function)

(Each undeclared identifier is reported only once for each
687 C:\eqemu\5.3dr2dev\world\console.cpp
`Ver_build' undeclared (first use this function)
687 C:\eqemu\5.3dr2dev\world\console.cpp
`ultoa' undeclared (first use this function)
688 C:\eqemu\5.3dr2dev\world\console.cpp
`Ver_min' undeclared (first use this function)
689 C:\eqemu\5.3dr2dev\world\console.cpp
`Ver_maj' undeclared (first use this function)
690 C:\eqemu\5.3dr2dev\world\console.cpp
`Ver_pid' undeclared (first use this function)
34 C:\eqemu\5.3dr2dev\world\console.cpp:691
#elif without #if
694 C:\eqemu\5.3dr2dev\world\console.cpp
`GetOS' undeclared (first use this function)
34 C:\eqemu\5.3dr2dev\world\console.cpp:695
#else without #if
34 C:\eqemu\5.3dr2dev\world\console.cpp:697
#endif without #if
749 C:\eqemu\5.3dr2dev\world\console.cpp
jump to case label
385 C:\eqemu\5.3dr2dev\world\console.cpp
crosses initialization of `Seperator sep'
C:\eqemu\5.3dr2dev\world\Makefile.win
[Build Error] [console.o] Error 1

zone.exe compiled fine except this error
\Dev-Cpp\Bin\..\lib\gcc-lib\mingw32\3.2\..\..\..\..\mingw32\bin\ld.exe C:\eqemu\5.3dr2dev\zone\C
cannot find -lzlib

dingo01 01-12-2004 04:16 PM

For the first part of your problem, correct the typo that Lurker pointed out. In world\console.cpp, add a # to the front of
Code:

if defined(WIN32) && !defined(__MINGW32__)
For your second problem, the makefile is looking for zlib.dll in the C:\dev-cpp\lib folder, so make sure you have a copy of it over there and you should be alright.

I do have a problem of my own, though, that maybe someone could help with. Apparently I'm not installing or using reimp right. When I try to run World.exe or Boot5Zones, I get this error:

Quote:

The procedure entry point mysql_real_escape_string could not be located in the dynamic link library libmysql.dll.
Is there a certain directory I should be in when I run the reimp and dlltools commands? Do I have to add any files anywhere else? I ran both of those commands as listed just from whatever directory I happened to be in. I installed MinGW 3.1.0-1 in the dev-cpp\bin folder (and also have an install sitting in dev-cpp\bin\MinGW and also have all the contents of MinGW\bin sitting in the bin directory). When I run those two commands it pops up a new command prompt without an error, like the command went through. Any help would be greatly appreciated.

Oh, and great package, Tertiary!

Shadow-Wolf 01-12-2004 05:29 PM

yay got it working now you rock tertiary!(and dingo01
for his bit of help)


All times are GMT -4. The time now is 04:32 AM.

Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.