Compiling under mingw-w64

For those having trouble installing/running the game or to report a bug

Moderator: Staff

nan
Newbie
Posts: 18
Joined: Sat May 28, 2011 12:57 pm

Compiling under mingw-w64

Postby nan » Sat May 28, 2011 1:08 pm

Attachments
redefines.txt
PATH_MAX, strcasecmp redefine warning
(933 Bytes) Downloaded 135 times
context_all.txt
CONTEXT_ALL defined in winnt.h
(9.45 KiB) Downloaded 147 times
Last edited by nan on Sat May 28, 2011 3:31 pm, edited 1 time in total.
User avatar
Roots
Dictator
Posts: 8665
Joined: Wed Jun 16, 2004 6:07 pm
Location: Austin TX
Contact:

Re: Compiling under mingw-w64

Postby Roots » Sat May 28, 2011 1:41 pm

Did the forum not allow your attachment because it was your first post?
Image
nan
Newbie
Posts: 18
Joined: Sat May 28, 2011 12:57 pm

Re: Compiling under mingw-w64

Postby nan » Sat May 28, 2011 3:32 pm

Oops, .diff and .patch are not allowed as attachments. I've updated the original post.
nan
Newbie
Posts: 18
Joined: Sat May 28, 2011 12:57 pm

Re: Compiling under mingw-w64

Postby nan » Sat May 28, 2011 3:37 pm

By the way, with some minimal changes I've been able to compile it with mingw/clang. The game will start but abort on some lua_bind issue. Haven't looked into it yet.
rujasu
Developer
Posts: 758
Joined: Sun Feb 25, 2007 5:40 am
Location: Maryland, USA

Re: Compiling under mingw-w64

Postby rujasu » Sat May 28, 2011 9:41 pm

Great! One question, what is the reason for renaming CONTEXT_* to MAP_CONTEXT_*? Is there a w64-related reason for this? The other patch looks fine, and this doesn't seem to break anything on the Linux side (haven't tried on Win32 yet).

Also, can you provide us with the patches for mingw/clang? Even if it's not quite ready yet, I'd like to see what sort of modifications would be required for clang compatibility.
nan
Newbie
Posts: 18
Joined: Sat May 28, 2011 12:57 pm

Re: Compiling under mingw-w64

Postby nan » Sat May 28, 2011 11:54 pm

CONTEXT_ALL is already defined in winnt.h which will be included by windows.h I guess, didn't bother to look further. It also defines CONTEXT_FULL and maybe a couple of other contexts. Used clang to find the bug, gcc wasn't a great help here.

By the way, both compilers generate a boatload of 'const' type qualifier on return type has no effect warnings. Nothing critical but somewhat annoying.

Clang patch is attached.
Attachments
clang.txt
Remove forward declaration to make it compilable with clang.
(1.13 KiB) Downloaded 139 times
User avatar
Roots
Dictator
Posts: 8665
Joined: Wed Jun 16, 2004 6:07 pm
Location: Austin TX
Contact:

Re: Compiling under mingw-w64

Postby Roots » Sun May 29, 2011 2:59 am

Your patch was added today in commit #1934. Thanks for the assist! :approve:
Image
rujasu
Developer
Posts: 758
Joined: Sun Feb 25, 2007 5:40 am
Location: Maryland, USA

Re: Compiling under mingw-w64

Postby rujasu » Sun May 29, 2011 3:24 am

For the clang patch, I'm using nan's solution for the global.h file. For the Luabind header, I grabbed a fix from the official LuaBind repository, so we're a bit more in line with the official version there.

Thanks again for these patches, nan. This works for compiling on the Linux version of clang as well. Committing the clang fix to SVN right now, in fact.

Return to “Technical Issues”

Who is online

Users browsing this forum: No registered users and 1 guest