aliens

Author Topic: Compiling on Cygwin  (Read 27877 times)

Offline SupSuper

  • Lazy Developer
  • Administrator
  • Commander
  • *****
  • Posts: 2160
    • View Profile
Compiling on Cygwin
« Reply #15 on: July 06, 2010, 05:14:00 am »
No problem, I was just curious, and I'm not too familiar with cygwin myself so you caught me off-guard. ;)

Aside from double-checking the library files, my last suggestion would be to try and recompile it from scratch (use "make clean" to delete all the object files and then try "make" again) in case your previous failed attempts are messing it up.

battlesquid

  • Guest
Compiling on Cygwin
« Reply #16 on: July 07, 2010, 03:43:06 pm »
I'm not the only one with this problem it seems. I did the same as this guy https://lists.libsdl.org/pipermail/sdl-libsdl.org/2005-May/050095.html and was able to get the linked file. As I expected from the other guys post, running it resulted in an error that did't really tell me anything:
 


So I closed that useless window and had a look at the directory where I found stdout.txt to my surprise telling me something I could understand :) "Loading resources..." So that had to be it couldn't find the DATA dir. I would prefer if the program had told me this, but it didn't take long to find that file. Now the precompiled binary distribution comes with some requirements like DLL files and DATA dir needs to be in the same folder. So I tried to add those to see if I could get some more feedback. Not only feedback here, the game is up and running!
 :o

So, here's my cygwin Makefile in case anyone else wants to compile the project under cygwin: https://pastebin.com/5TxMiY7z
There's only one thing that differ from the original Makefile: the libraries have to be specified after the object files:

$(CXX) $(OBJS) $(LDFLAGS) -o $(PROG)

« Last Edit: July 07, 2010, 05:44:24 pm by battlesquid »

Offline michal

  • Commander
  • *****
  • Posts: 629
    • View Profile
Compiling on Cygwin
« Reply #17 on: July 07, 2010, 05:53:48 pm »
Good to know, you managed to compile everything.

I have and idea for first feature you could implement ;) At game starting check if DATA contains ufo game. If not, show some message explaining that user needs to put ufo contents in DATA directory.

Offline SupSuper

  • Lazy Developer
  • Administrator
  • Commander
  • *****
  • Posts: 2160
    • View Profile
Compiling on Cygwin
« Reply #18 on: July 07, 2010, 09:18:43 pm »
Glad you got it working, I'll remember to fix the makefile. Funny how the weirdest things can cause problems. You probably also needed the SDL DLLs to run the game since you're building for Windows.

As for the DATA thing, I will admit that the error handling at this point is vague to nearly non-existant, it's not really a priority, but you should at least see an error message if the game fails to load (or at least I do):


Yes it's not very descriptive or very flashy, but it does the job, and I would expect people to be able to read a few instructions. The current builds aren't intended for the average user after all. ;) Of course I have no idea what'll happen if your computer decides to not show the console. The message might jump into an abyss. The program might just crash. Who knows.

But I can't use anything platform-specific like MessageBox() either. I'd have to render a message myself onto the SDL screen. Problem is, if the game fails to load the resources, there aren't even any palettes or fonts to draw a message! I'd need some kind of failsafe resources to manage to scribble a desperate cry for help on the screen. :P Again, another thing for the TODO list.

battlesquid

  • Guest
Compiling on Cygwin
« Reply #19 on: July 07, 2010, 10:47:14 pm »
I suppose it would be useful to have some basic error handling routines in place. Using some default non-xcom font shouldn't be a problem, the main point is to let the user know what's wrong.

I was just thinking - maybe someone could add the required steps for Cygwin to the https://openxcom.ninex.info/index.php/compiling/ page? I'm sure there are others that would like to compile under windows without using VS. And it's easy now that we know how  :D

Offline SupSuper

  • Lazy Developer
  • Administrator
  • Commander
  • *****
  • Posts: 2160
    • View Profile
Re: Compiling on Cygwin
« Reply #20 on: July 09, 2010, 11:24:01 pm »
I suppose it would be useful to have some basic error handling routines in place. Using some default non-xcom font shouldn't be a problem, the main point is to let the user know what's wrong.

I was just thinking - maybe someone could add the required steps for Cygwin to the https://openxcom.ninex.info/index.php/compiling/ page? I'm sure there are others that would like to compile under windows without using VS. And it's easy now that we know how  :D
I have split this into a separate thread and might link it up later on the main site like I did for Mac OS. :)