[SOLVED] Compiling under Win32 with VS2008/DEV-C++

Ask for help regarding any technical issue or report any bug or OS independent issues.
Post Reply
User avatar
leeor_net
Novice
Novice
Posts: 180
Joined: 03 Feb 2008, 09:17
Location: Ohio, USA
Contact:

[SOLVED] Compiling under Win32 with VS2008/DEV-C++

Post by leeor_net »

Hello,

First, I'd like to say that I'm quite impressed with the work that's been done on Mana World. Actually, I want to use the code base when it matures a bit more for a project that I've had in mind for awhile now.

To that end, I've been trying to compile TMW with no luck. I've tried VC7.1, VS9 and Dev-C++ 5. All have various problems.

Under VC, the compiler complains about std::string, that string is not a member of namespace std. Dev-C++ is way more hassle than it's been worth.

I've installed all of the dependencies. I've even tried building from the SVN using the VC/DEV project files included with no luck.

Any thoughts on what I can do to solve this problem? Ultimately I don't really care what IDE/Compiler I use so long as it's C++... :) It's late and my brain is fried so it's off to bed with me!

And again, very nice work! :)
Last edited by leeor_net on 08 Feb 2008, 00:55, edited 1 time in total.
User avatar
strikerbcb
Novice
Novice
Posts: 155
Joined: 15 Apr 2005, 06:42
Location: Brasil
Contact:

Post by strikerbcb »

Use the latest NightlyBuild of CodeBlocks ( http://www.codeblocks.org ) and mingw compiler. It´s a supported ide for this project, and works fine, and ... it´s free !

Then takes the devpack, rename for the extension .tar.gz and descompact in the directory of the Codeblocks, then open the .cbp file in tmw directory for open codeblocks and go in Build Options and put the way of all dependences for tmw.

It´s a good thing too, delete all files in the project and add again, many times the project file it´s outdated, and need this ...

well, it is this ...
<<Striker>> - Evolving Ever
Project World of Dragons - Brazilian Total Rework Fork of the TMW and a newer 3D Client/Server
Mundo dos Dragões - http://www.mundodosdragoes.org
User avatar
leeor_net
Novice
Novice
Posts: 180
Joined: 03 Feb 2008, 09:17
Location: Ohio, USA
Contact:

Post by leeor_net »

Thanks for your reply! After a little bit of fussing with the IDE, low-and-behold, it works! ... mostly. There's a problem with the key enumeration in key.hpp (expected identifier before numeric constant)... I'll search around on the forums to see if there's a solution to this problem. Otherwise, perhaps you have a suggestion?

Thanks!

EDIT:
I fixed my problem. In key.hpp, I added:

Code: Select all

#ifdef DELETE
#undef DELETE
#endif
That seemed to clear up my problem right away... :) Hopefully there won't be any adverse problems.

EDIT2:
Whoopsy... typo! I changed the above to DELETE from DEFINE... -_-
Last edited by leeor_net on 09 Mar 2008, 19:48, edited 1 time in total.
User avatar
ElvenProgrammer
Founder
Founder
Posts: 2526
Joined: 13 Apr 2004, 19:11
Location: Italy
Contact:

Post by ElvenProgrammer »

The best solution would be to undef DELETE in all tmw includes where the problem happens. That's because both guichan and windows headers define the same constant
Matt
Grand Knight
Grand Knight
Posts: 1759
Joined: 07 Aug 2004, 10:47
Location: Germany->Bavaria

Post by Matt »

I would simply replace the DELETE in inttextbox.cpp with 1013.
User avatar
leeor_net
Novice
Novice
Posts: 180
Joined: 03 Feb 2008, 09:17
Location: Ohio, USA
Contact:

Post by leeor_net »

I was only having the problem in key.hpp so my solution worked.

Matt, your solution would also work but that, imho, would defeat the purpose of an enum. Regardless, I'm not too terribly concerned with the WinAPI crap because frankly, it's not really needed. So far I havn't suffered any ill effects.

Thanks again for all replies! Your help really makes a difference! :)

EDIT:
I forgot to note: I'm running WinVista Home Premium. I was unable to get TMW to compile with either DevCPP or Visual Studio. CodeBlocks is the only IDE/Compiler that seemed to work without much trouble.

So anybody out there who's reading this that may be in the same pickle I was in, just use CodeBlocks. C++ is C++, is it not?
User avatar
haggard
Novice
Novice
Posts: 190
Joined: 20 Jan 2006, 03:27
Location: Ohio

Post by haggard »

this is what i get when i try to compile just the client...haha i dont know what im doin but i will learn this eventually

Project : The Mana World
Compiler : GNU GCC Compiler (called directly)
Directory : C:\TMWC\
--------------------------------------------------------------------------------
Switching to target: default
Compiling: src\animatedsprite.cpp
In file included from src\/animatedsprite.h:27,
from src\animatedsprite.cpp:24:
src\/resources/spritedef.h:32:25: libxml/tree.h: No such file or directory
In file included from src\/animatedsprite.h:27,
from src\animatedsprite.cpp:24:
src\/resources/spritedef.h:98: error: `xmlNodePtr' has not been declared
src\/resources/spritedef.h:98: error: ISO C++ forbids declaration of `node' with no type
src\/resources/spritedef.h:104: error: `xmlNodePtr' has not been declared
src\/resources/spritedef.h:104: error: ISO C++ forbids declaration of `node' with no type
src\/resources/spritedef.h:110: error: `xmlNodePtr' has not been declared
src\/resources/spritedef.h:112: error: ISO C++ forbids declaration of `animationNode' with no type
src\/resources/spritedef.h:118: error: `xmlNodePtr' has not been declared
src\/resources/spritedef.h:118: error: ISO C++ forbids declaration of `includeNode' with no type
In file included from src\animatedsprite.cpp:26:
src\/graphics.h:27:39: guichan/sdl/sdlgraphics.hpp: No such file or directory
In file included from src\animatedsprite.cpp:26:
src\/graphics.h:58: error: `gcn' has not been declared
src\/graphics.h:58: error: expected class-name before '{' token
src\/graphics.h:91: error: `gcn' has not been declared
In file included from ../Program Files/CodeBlocks/mingw32/tmw-svn/include/SDL/SDL_main.h:26,
from ../Program Files/CodeBlocks/mingw32/tmw-svn/include/SDL/SDL.h:28,
from src\/resources/image.h:29,
from src\animatedsprite.cpp:31:
../Program Files/CodeBlocks/mingw32/tmw-svn/include/SDL/SDL_stdinc.h:72:20: iconv.h: No such file or directory
In file included from src\animatedsprite.cpp:34:
src\/utils/xml.h:40: error: `xmlNodePtr' was not declared in this scope
src\/utils/xml.h:40: error: expected primary-expression before "const"
src\/utils/xml.h:40: error: expected primary-expression before "int"
src\/utils/xml.h:40: error: initializer expression list treated as compound expression
src\/utils/xml.h:46: error: `xmlNodePtr' was not declared in this scope
src\/utils/xml.h:46: error: expected primary-expression before "const"
src\/utils/xml.h:46: error: expected primary-expression before "double"
src\/utils/xml.h:46: error: initializer expression list treated as compound expression
src\/utils/xml.h:52: error: conflicting declaration 'std::string XML::getProperty'
src\/utils/xml.h:40: error: 'XML::getProperty' has a previous declaration as `int XML::getProperty'
src\/utils/xml.h:52: error: type mismatch with previous external decl of `std::string XML::getProperty'
src\/utils/xml.h:40: error: previous external decl of `int XML::getProperty'
src\/utils/xml.h:52: error: declaration of `std::string XML::getProperty'
src\/utils/xml.h:40: error: conflicts with previous declaration `int XML::getProperty'
src\/utils/xml.h:52: error: `xmlNodePtr' was not declared in this scope
src\/utils/xml.h:52: error: expected primary-expression before "const"
src\/utils/xml.h:52: error: expected primary-expression before "const"
src\/utils/xml.h:57: error: `xmlNodePtr' does not name a type
Process terminated with status 1 (0 minutes, 1 seconds)
User avatar
ElvenProgrammer
Founder
Founder
Posts: 2526
Joined: 13 Apr 2004, 19:11
Location: Italy
Contact:

Post by ElvenProgrammer »

You don't seem to have libxml2 and libiconv installed, but I guess you installed the devpak.
Did you add Program Files/CodeBlocks/mingw32/tmw-svn/include to your include path?
User avatar
haggard
Novice
Novice
Posts: 190
Joined: 20 Jan 2006, 03:27
Location: Ohio

Post by haggard »

ElvenProgrammer wrote:You don't seem to have libxml2 and libiconv installed, but I guess you installed the devpak.
Did you add Program Files/CodeBlocks/mingw32/tmw-svn/include to your include path?
I did what you said to do and it did something new (yay) but then this came up

Project : The Mana World
Compiler : GNU GCC Compiler (called directly)
Directory : C:\TMWC\
--------------------------------------------------------------------------------
Switching to target: default
Compiling: src\localplayer.cpp
In file included from ../Program Files/CodeBlocks/mingw32/tmw-svn/include/guichan/keyevent.hpp:61,
from ../Program Files/CodeBlocks/mingw32/tmw-svn/include/guichan/gui.hpp:62,
from src\/gui/gui.h:27,
from src\localplayer.cpp:38:
../Program Files/CodeBlocks/mingw32/tmw-svn/include/guichan/key.hpp:128: error: expected identifier before numeric constant
../Program Files/CodeBlocks/mingw32/tmw-svn/include/guichan/key.hpp:128: error: expected `}' before numeric constant
../Program Files/CodeBlocks/mingw32/tmw-svn/include/guichan/key.hpp:128: error: expected unqualified-id before numeric constant
../Program Files/CodeBlocks/mingw32/tmw-svn/include/guichan/key.hpp:160: error: expected unqualified-id before "protected"
../Program Files/CodeBlocks/mingw32/tmw-svn/include/guichan/key.hpp:160: error: expected `,' or `;' before "protected"
../Program Files/CodeBlocks/mingw32/tmw-svn/include/guichan/key.hpp:163: error: expected declaration before '}' token
In file included from ../Program Files/CodeBlocks/mingw32/tmw-svn/include/guichan/keyevent.hpp:61,
from ../Program Files/CodeBlocks/mingw32/tmw-svn/include/guichan/gui.hpp:62,
from src\/gui/gui.h:27,
from src\localplayer.cpp:38:
../Program Files/CodeBlocks/mingw32/tmw-svn/include/guichan/key.hpp:57:1: unterminated #ifndef
In file included from ../Program Files/CodeBlocks/mingw32/tmw-svn/include/guichan/gui.hpp:62,
from src\/gui/gui.h:27,
from src\localplayer.cpp:38:
../Program Files/CodeBlocks/mingw32/tmw-svn/include/guichan/keyevent.hpp:57:1: unterminated #ifndef
In file included from src\/gui/gui.h:27,
from src\localplayer.cpp:38:
../Program Files/CodeBlocks/mingw32/tmw-svn/include/guichan/gui.hpp:57:1: unterminated #ifndef
In file included from src\localplayer.cpp:38:
src\/gui/gui.h:24:1: unterminated #ifndef
Process terminated with status 1 (0 minutes, 5 seconds)
10 errors, 0 warnings


when i try to build the gameserver and the account server i get this message

src\utils\timer.cpp:98: error: `gettimeofday' undeclared (first use this function)
src\utils\timer.cpp:98: error: (Each undeclared identifier is reported only once for each function it appears in.)
Process terminated with status 1 (0 minutes, 55 seconds)
User avatar
ElvenProgrammer
Founder
Founder
Posts: 2526
Joined: 13 Apr 2004, 19:11
Location: Italy
Contact:

Post by ElvenProgrammer »

haggard wrote:
ElvenProgrammer wrote:You don't seem to have libxml2 and libiconv installed, but I guess you installed the devpak.
Did you add Program Files/CodeBlocks/mingw32/tmw-svn/include to your include path?
I did what you said to do and it did something new (yay) but then this came up

Project : The Mana World
Compiler : GNU GCC Compiler (called directly)
Directory : C:\TMWC\
--------------------------------------------------------------------------------
Switching to target: default
Compiling: src\localplayer.cpp
In file included from ../Program Files/CodeBlocks/mingw32/tmw-svn/include/guichan/keyevent.hpp:61,
from ../Program Files/CodeBlocks/mingw32/tmw-svn/include/guichan/gui.hpp:62,
from src\/gui/gui.h:27,
from src\localplayer.cpp:38:
../Program Files/CodeBlocks/mingw32/tmw-svn/include/guichan/key.hpp:128: error: expected identifier before numeric constant
../Program Files/CodeBlocks/mingw32/tmw-svn/include/guichan/key.hpp:128: error: expected `}' before numeric constant
../Program Files/CodeBlocks/mingw32/tmw-svn/include/guichan/key.hpp:128: error: expected unqualified-id before numeric constant
../Program Files/CodeBlocks/mingw32/tmw-svn/include/guichan/key.hpp:160: error: expected unqualified-id before "protected"
../Program Files/CodeBlocks/mingw32/tmw-svn/include/guichan/key.hpp:160: error: expected `,' or `;' before "protected"
../Program Files/CodeBlocks/mingw32/tmw-svn/include/guichan/key.hpp:163: error: expected declaration before '}' token
In file included from ../Program Files/CodeBlocks/mingw32/tmw-svn/include/guichan/keyevent.hpp:61,
from ../Program Files/CodeBlocks/mingw32/tmw-svn/include/guichan/gui.hpp:62,
from src\/gui/gui.h:27,
from src\localplayer.cpp:38:
../Program Files/CodeBlocks/mingw32/tmw-svn/include/guichan/key.hpp:57:1: unterminated #ifndef
In file included from ../Program Files/CodeBlocks/mingw32/tmw-svn/include/guichan/gui.hpp:62,
from src\/gui/gui.h:27,
from src\localplayer.cpp:38:
../Program Files/CodeBlocks/mingw32/tmw-svn/include/guichan/keyevent.hpp:57:1: unterminated #ifndef
In file included from src\/gui/gui.h:27,
from src\localplayer.cpp:38:
../Program Files/CodeBlocks/mingw32/tmw-svn/include/guichan/gui.hpp:57:1: unterminated #ifndef
In file included from src\localplayer.cpp:38:
src\/gui/gui.h:24:1: unterminated #ifndef
Process terminated with status 1 (0 minutes, 5 seconds)
10 errors, 0 warnings
Search for this problem in the forum until we find a definitive fix for it
haggard wrote: when i try to build the gameserver and the account server i get this message

src\utils\timer.cpp:98: error: `gettimeofday' undeclared (first use this function)
src\utils\timer.cpp:98: error: (Each undeclared identifier is reported only once for each function it appears in.)
Process terminated with status 1 (0 minutes, 55 seconds)
Update your mingw runtime
User avatar
leeor_net
Novice
Novice
Posts: 180
Joined: 03 Feb 2008, 09:17
Location: Ohio, USA
Contact:

Post by leeor_net »

Also, perhaps you'd like to bring your questions back to your original thread.
Post Reply