Page 10 of 19

Posted: Sat Jul 18, 2009 2:00 pm
by Zefz
Okay, I think I am one step closer to getting it to compile. First of all I had to rename every member of the gcn::Key:: class to lower case (I use guichan 0.8.1).

gcn::Key::SPACE -> gcn::Key::Space
gcn::Key::PAGE_DOWN -> gcn::Key::PageDown
etc.

Secondly I am having some problems with certain directory functions you use in utility.cpp

From all these functions, only seekdir() seems to be defined:

Code: Select all

DIR* __cdecl opendir (const char*);
struct dirent* __cdecl readdir (DIR*);
int __cdecl closedir (DIR*);
void __cdecl rewinddir (DIR*);
long __cdecl telldir (DIR*);
void __cdecl seekdir (DIR*, long);
This causes linking errors when trying to compile utility.cpp and all errors origin from read_files()

Posted: Sat Jul 18, 2009 3:09 pm
by xenom[GER]
ok, could you please try to also add the file [MODBAKER_ROOT]\src\helper\dirent.h to your project?

I got this file from wikipedia (see http://en.wikipedia.org/wiki/Dirent.h for details).

On Ubuntu it fails when using gcn::Key::Space etc. *grml*
Seems like I have to find a way around that for SVN...

Posted: Sat Jul 18, 2009 3:15 pm
by Zefz
Use #ifdefs?

Maybe this works:

Code: Select all

#if defined(_MSC_VER)
#define SPACE   Space
#define DOWN    Down
#define PAGE_UP PageUp
#endif
The wikipedia page you gave had a link to the following site:
http://www.gimp.org/~tml/gimp/win32/dirent.zip

Which contains a windows library for dirent, I'll try it out.

Posted: Sat Jul 18, 2009 3:28 pm
by xenom[GER]
Zefz wrote:Use #ifdefs?

Maybe this works:

Code: Select all

#if defined(_MSC_VER)
#define SPACE   Space
#define DOWN    Down
#define PAGE_UP PageUp
#endif
The wikipedia page you gave had a link to the following site:
http://www.gimp.org/~tml/gimp/win32/dirent.zip

Which contains a windows library for dirent, I'll try it out.
Yeah, the #ifdefs could be an iidea.

Aww, I thought the .zip only contained the header file. I'll change that in the COMPILING file after you succeeded compiling ModBaker :-)

Posted: Sat Jul 18, 2009 3:37 pm
by Zefz
I committed a revision myself :) It contains the #if defined needed to get it to compile on visual studio 2008.

With the dirent.lib the source compiles! I am now checking out how the binary works in practice!

Posted: Sat Jul 18, 2009 3:46 pm
by xenom[GER]
Zefz wrote:I committed a revision myself :) It contains the #if defined needed to get it to compile on visual studio 2008.

With the dirent.lib the source compiles! I am now checking out how the binary works in practice!
\o/
Ok, so I'll edit and check in the COMPILING file now.
You could also check in the project file if you'd like to! :-)

Posted: Sat Jul 18, 2009 3:51 pm
by Zefz
I get a error message when starting the binary:
"The procedure entry point ?keyPressed@TabbedArea@gcn@@UAEXAAVKeyEvent@2@@Z could not be located in the dynamic link library guichan.dll"

Maybe the guichan.lib I have included and compiled myself are somehow incorrect? I use dynamic libraries, not the static ones. Or maybe some sort of Linker compile setting is incorrect.

Posted: Sat Jul 18, 2009 4:05 pm
by Zefz
Okay, I recompiled the .dll myself (I previously used the ones you compiled) and got it to run at least!

Now I just can't get it to open modbaker.cfg, ModBaker quits if that file isn't read.

Posted: Sat Jul 18, 2009 4:06 pm
by xenom[GER]
Hm, I don't know.
Currently I can't compile ModBaker on Windows (my HDD with the WinXP virtual machine is busy).

Currently I'm running an older version of ModBaker on Windows.

But cou could try my Guichan DLL files:
http://misc.tobiasgall.de/egoboo/modbak ... n_dlls.zip

Posted: Sat Jul 18, 2009 4:08 pm
by xenom[GER]
ah, post overlay :D

Make sure that modbaker.cfg is in the same directory as modbaker.exe.
I didn't any other dependence to reading the config.

Posted: Sat Jul 18, 2009 4:13 pm
by Zefz
It works when compiling the Release binary! I guess that when running the Debug binary through visual studio the entry point directory is different.

Now it manages to parse the config file, find a module, load all the resources, but crashes when trying to load the fan data. I have no debug info yet.

Posted: Sun Jul 19, 2009 4:31 pm
by xenom[GER]
SVN update
- Added doxygen comments and the current doxygen documentation to SVN.
- Removed the g_mesh and g_object_manager objects and added a g_module object containing both classes


There are still a lot of functions etc. missing in the documentation, but it's a start :-)


I will remove a lot of logic from the renderer and window manager. This logic will go to c_modbaker instead, so the core classes (for handling spawn.txt, menu.txt, the objects, the tiles, rendering, ...) can be used in other programs, too (so when ModuleManager will be ported to C++, we can use the same core).

Posted: Sun Jul 19, 2009 5:11 pm
by bgbirdsey
"The procedure entry point ?keyPressed@TabbedArea@gcn@@UAEXAAVKeyEvent@2@@Z could not be located in the dynamic link library guichan.dll"
Forgive me is this is not the problem or solution to the current compilation problem. I just thought I would throw out this interesting/frustrating fact...

UGH! You see the "@@UAEXAAV" and "@2@@Z"? Those are c++ decorations to the function name that tell the compiler about the variable types for the function input and output.

These are compiler dependent. This is the reason that you usually see c++ packages distributed as source, and not .lib (or .a) files. In this case, I think you are running into the same problem with the .dll. If the decorated names are being generated by the one compiler, there is no guarantee that they will be recognized by another compiler, and the function will not be found.

The only real solution would be for you to compile the guichan.dll library using the same compiler as you are using for modbaker.

Posted: Sun Jul 19, 2009 5:51 pm
by Zefz
I got the debugger to work somewhat more. It's the following error that causes the crash:

Code: Select all

Std exception: bad allocation
Probably where I got those four warnings in the release binary.

Posted: Mon Jul 20, 2009 4:27 pm
by xenom[GER]
Non-SVN update
I started a ModBaker development blog last week.

[url]http://modbaker_blog.tobiasgall.de/[/url]

Why a blog?
Well, I want to keep my updates separate from discussion for my own reasons. So that blog is an addition to this thread, containing only updates or interesting stuff from my side.
Also I wanted to see something else than ModBaker code last week, so I started a very small and easy-to-use single-user blog system.

What blog system is this?
It's my own system. It's very small and was written with less than 400 lines of code (only four files are needed to create this blog). The data is stored in SQLite (which is a file-based database).

Will you add comments?
No. I want to keep the discussion in this commmunity. I will also post important stuff into this thread.

What features do you want to add?
The only features I currently want to add are:
- Paging system (so the blog will show only a certain number of entries on one page)
- A "latest entries" box, showing the latest X entries
That's all :-)

I want my own blog!
Simply send me a PM and I'll send you a link to all files needed. :-)
You only need a webserver running PHP and SQLite to use the blog. Having several copies of the blog is also possible. Simply copy all files in the archive to several folders :-)