project-navigation
Personal tools

Author Topic: Provided steps don't build workspace on Windows. Issue: libmxml (w/ fix)  (Read 3917 times)

Offline FWishbringer

  • Rookie
  • ***
  • Posts: 52
    • View Profile
Ok, figured I'd see if I can get it built, and if so, perhaps trying to contribute. Windows build environment, and I followed Compile for Windows (Easy Way) and Code::Blocks setup to a 'T' (using provided zip file). Performed a workspace cleaning, followed by a workspace build. Below is symptom, and steps I used to fix it, including intermediate steps that didn't work.

src\common\xml.h
line 24: include <mxml.h>

errors out, can't find file...
line 24: #include "../libs/mxml/mxml.h"
allowed it to compile perfectly fine

ld then fails with 'cannot find -lmxml

So... a look around, and there's no library to link against that I can find.

I meandered over to http://www.minixml.org/ and grabbed a copy of 2.6, and went ahead and fired up msys in the MinGW directory, and configured and built it. Copied the new config.h for mxml over to %USER%\ufoai\src\libs\mxml. Took the resulting libmxml.a and threw it in c:\development\codeblocks\MinGW\lib. Rebuilt the workspace, and failed miserable, this time with undefined reference to `_imp__pthread_once' (and a few more pthread related entries).

Went back, and hand edited the config.h file to remove pthread support (since reading over it, it supports building without it). Remade libmxml.a, and copied it over again, as well as the hand edited config.h file to their respective folders. Rebuilt the workspace again, and it completed. The one that finally built after all that trouble was testall.exe.

For completeness sake, went ahead and did a workspace clean, then build again... and just got a ton of warnings, and no errors. All this added troubleshooting info isn't probably that needed, but if I'm going to take a crack at contributing, might as well show I'm not a total newbie on my very first issue with the source.

To make the fix a permanent feature, probably want to add libmxml to the codeblocks premade zip file instead of in the ufoai source... especially since the source version doesn't have the configure script or makefile to build the needed library with.

(Anyone that skips straight to a TLDR wants the least possible, so no punctuation for you...)

------

TLDR: libmxml is missing from mingw so workspace building fails and how i fixed it and if you want to know how read the rest of the post

« Last Edit: May 31, 2011, 10:39:59 am by FWishbringer »

Offline geever

  • Project Coder
  • PHALANX Commander
  • ***
  • Posts: 2561
    • View Profile
TLDR: libmxml is missing from mingw so workspace building fails and how i fixed it and if you want to know how read the rest of the post

just the build scripts need to be fixed to use the minixml in our sources.

-geever

Offline Edi

  • Squad Leader
  • ****
  • Posts: 296
    • View Profile
Easiest way to compile on Windows is using muton's tools.

Get the source the easy way.

Then use the instructions for compiling with MinGW (GUI). Remember to patch the environment according to this post if it isn't working already.

That will get the job done with no fuss and once the initial setup is done, everything happens at the push of a button.

Offline FWishbringer

  • Rookie
  • ***
  • Posts: 52
    • View Profile
Well, I went ahead and followed setup on that. Then proactively patched according to the stated post. Since partial overwriting of libraries is usually a Bad Thing, I removed all SDL entries prior to patching. 

Build fails with src/tools/ufomodel/../../shared/images.h:33:23: fatal error: SDL_image.h: No such file or directory

Looking inside C:\UFOAIwin32BUILDenv\MinGW\include\SDL shows there's no SDL_image.h

On a search, I found that all the tool chain requirements are in the backup, so put them back in place (noting, btw, nothing got overwritten...) Since SDL_mixer and SDL_ttf are also listed as not in the patch, I'm putting those back as well from the old source.

Build seemed to go fine. The scream at the end got me to jump (JUST hung up the phone with a customer, thankfully it happened after).

Giving it a test now ....

Offline FWishbringer

  • Rookie
  • ***
  • Posts: 52
    • View Profile
Alrighty, seems to be in order. Time to grab a paperclip, a rubber band, a chewing gum wrapper, and some duct tape and have at it.