Jump to content

Compiling against winelib, the sequel: it works!


Nephil Thief
 Share

Recommended Posts

I was just able to get the character editor compiled against winelib, and yes, it actually works. The makefile needs the following modifications:

 

CPP = wineg++
CC = wineg++
WINDRES = wrc

 

Additionally the output filename must not contain any spaces, not even with quotes. There seems to be an upstream bug somewhere that messes things up otherwise.

 

Also note that there will be a ".exe.so" file that must be in the same directory as the .exe file, with the same name. Changing the names after they're built will make them not work.

 

But yeah, that's it. I'll see if I can also get the game and scenario editor working too.

Link to comment
Share on other sites

Okay, for the BoE game itself, some code changes are needed.

 

1. boe.combat.cpp, around line 3359: all the casts to (long) are incorrect. They should be removed.

 

2. boe.fileio.cpp, around line 1758: itoa() is deprecated and should not be used, and the newer _itoa() seems not to be available in the version of Wine I'm using. One could probably hack around this with std::stringstream for now, I guess?

 

I'll post more as they come...

Link to comment
Share on other sites

We have Boost as a dependency already, so boost::lexical_cast<std::string>() can be used replace itoa(). (Though, I'm not quite sure if the Windows code depends on Boost yet.)

 

(Incidentally, lexical_cast uses std::stringstream in pretty much the way you're thinking.)

Link to comment
Share on other sites

Oh! Silly me, you can use std::to_string() to replace itoa! Though, that requires c++11, but we're already compiling as such, so that shouldn't be a problem.

 

lexical_cast is still nice (because it can go both ways), but for converting anything to a string, to_string is a little better.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...