Hello, we apologize but forum registrations are non-functional at this time. This issue should be fixed around mid-December. Until then, please stop by our Discord channel if you'd like to get in touch with the team. Thanks!

Compiling under mingw-w64

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

Moderator: Staff

Post Reply
nan
Newbie
Posts: 18
Joined: Sat May 28, 2011 6:57 am

Compiling under mingw-w64

Post by nan » Sat May 28, 2011 7:08 am

mingw-w64: http://mingw-w64.sourceforge.net/
I am using sezero's builds: http://sourceforge.net/projects/mingw-w ... %20Builds/.
Thew patches are attached.
Attachments
redefines.txt
PATH_MAX, strcasecmp redefine warning
(933 Bytes) Downloaded 176 times
context_all.txt
CONTEXT_ALL defined in winnt.h
(9.45 KiB) Downloaded 170 times
Last edited by nan on Sat May 28, 2011 9:31 am, edited 1 time in total.
User avatar
Roots
Dictator
Posts: 8669
Joined: Wed Jun 16, 2004 12:07 pm
Location: Austin TX
Contact:

Re: Compiling under mingw-w64

Post by Roots » Sat May 28, 2011 7:41 am

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

Re: Compiling under mingw-w64

Post by nan » Sat May 28, 2011 9:32 am

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

Re: Compiling under mingw-w64

Post by nan » Sat May 28, 2011 9:37 am

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: Sat Feb 24, 2007 10:40 pm
Location: Maryland, USA

Re: Compiling under mingw-w64

Post by rujasu » Sat May 28, 2011 3: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 6:57 am

Re: Compiling under mingw-w64

Post by nan » Sat May 28, 2011 5: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 158 times
User avatar
Roots
Dictator
Posts: 8669
Joined: Wed Jun 16, 2004 12:07 pm
Location: Austin TX
Contact:

Re: Compiling under mingw-w64

Post by Roots » Sat May 28, 2011 8:59 pm

Your patch was added today in commit #1934. Thanks for the assist! :approve:
Image
rujasu
Developer
Posts: 758
Joined: Sat Feb 24, 2007 10:40 pm
Location: Maryland, USA

Re: Compiling under mingw-w64

Post by rujasu » Sat May 28, 2011 9:24 pm

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.
Post Reply