aliens

Author Topic: [SOLVED] Problems launching openxcom after compiling on Ubuntu  (Read 8111 times)

Offline bramcor

  • Captain
  • ***
  • Posts: 76
    • View Profile
Hey guys - been following progress on the sideline for a while and finally decided to have a shot at running openxcom on my ubuntu box :)

I'm having problems launching openxcom after installing dependencies, grabbing from svn and running make.

I get the following in my terminal:

Code: [Select]
~/openxcom/trunk$ ./openxcom
Loading resources...
terminate called after throwing an instance of 'char const*'
Aborted

I am by no means experienced with using svn or compiling stuff on my own, so I hope you can help me figure out if this is a trivial problem or something system related and more difficult to troubleshoot...
« Last Edit: August 09, 2010, 05:09:10 pm by bramcor »

Offline SupSuper

  • Lazy Developer
  • Administrator
  • Commander
  • *****
  • Posts: 2161
    • View Profile
Re: Problems launching openxcom after compiling on Ubuntu
« Reply #1 on: August 07, 2010, 03:46:42 am »
Check your OpenXcom folder for any error messages in stdout.txt or stderr.txt.

Make sure you put a copy of X-Com in a DATA subfolder to run it.

Offline bramcor

  • Captain
  • ***
  • Posts: 76
    • View Profile
Re: Problems launching openxcom after compiling on Ubuntu
« Reply #2 on: August 07, 2010, 02:34:31 pm »
Thanks for the input SupSuper :)

There does not seem to be and .txt files in my openxcom folder other than the README.txt i got from svn.

I have made sure several times over that I created the correct directory for the original game files. I've made a list - please point out if I have misunderstood directory placement.

Code: [Select]
~/openxcom/trunk$ ls *
AbandonGameState.cpp     Globe.o    ResourcePack.o
AbandonGameState.h     GraphsState.cpp    RNG.cpp
AbandonGameState.o     GraphsState.h    RNG.h
Bar.cpp     GraphsState.o    RNG.o
Bar.h     ImageButton.cpp    RuleBaseFacility.cpp
Bar.o     ImageButton.h    RuleBaseFacility.h
Base.cpp     ImageButton.o    RuleBaseFacility.o
BaseFacility.cpp     InteractiveSurface.cpp    RuleCraft.cpp
BaseFacility.h     InteractiveSurface.h    RuleCraft.h
BaseFacility.o     InteractiveSurface.o    RuleCraft.o
Base.h     InterceptState.cpp    RuleCraftWeapon.cpp
BaseInfoState.cpp     InterceptState.h    RuleCraftWeapon.h
BaseInfoState.h     InterceptState.o    RuleCraftWeapon.o
BaseInfoState.o     Item.cpp    RuleItem.cpp
BaseNameState.cpp     Item.h    RuleItem.h
BaseNameState.h     Item.o    RuleItem.o
BaseNameState.o     LangString.h    Ruleset.cpp
Base.o     Language.cpp    Ruleset.h
BasescapeErrorState.cpp     Language.h    Ruleset.o
BasescapeErrorState.h     Language.o    SavedGame.cpp
BasescapeErrorState.o     LanguageState.cpp    SavedGame.h
BasescapeState.cpp     LanguageState.h    SavedGame.o
BasescapeState.h     LanguageState.o    Screen.cpp
BasescapeState.o     main.cpp    Screen.h
BaseView.cpp     MainMenuState.cpp    Screen.o
BaseView.h     MainMenuState.h    SellState.cpp
BaseView.o     MainMenuState.o    SellState.h
BuildFacilitiesState.cpp     main.o    SellState.o
BuildFacilitiesState.h     Makefile    Soldier.cpp
BuildFacilitiesState.o     Makefile.dingoo    Soldier.h
BuildNewBaseState.cpp     ManufactureState.cpp    SoldierInfoState.cpp
BuildNewBaseState.h     ManufactureState.h    SoldierInfoState.h
BuildNewBaseState.o     ManufactureState.o    SoldierInfoState.o
ConfirmNewBaseState.cpp     MiniBaseView.cpp    SoldierNamePool.cpp
ConfirmNewBaseState.h     MiniBaseView.h    SoldierNamePool.h
ConfirmNewBaseState.o     MiniBaseView.o    SoldierNamePool.o
COPYING     MonthlyCostsState.cpp    Soldier.o
Country.cpp     MonthlyCostsState.h    SoldiersState.cpp
Country.h     MonthlyCostsState.o    SoldiersState.h
Country.o     MonthlyReportState.cpp    SoldiersState.o
Craft.cpp     MonthlyReportState.h    Sound.cpp
Craft.h     MonthlyReportState.o    Sound.h
CraftInfoState.cpp     Music.cpp    Sound.o
CraftInfoState.h     Music.h    SoundSet.cpp
CraftInfoState.o     Music.o    SoundSet.h
Craft.o     NewGameState.cpp    SoundSet.o
CraftSoldiersState.cpp     NewGameState.h    StartState.cpp
CraftSoldiersState.h     NewGameState.o    StartState.h
CraftSoldiersState.o     openxcom    StartState.o
CraftsState.cpp     OpenXcom.2008.sln    State.cpp
CraftsState.h     OpenXcom.2008.vcproj    State.h
CraftsState.o     OpenXcom.2010.sln    State.o
CraftWeapon.cpp     OpenXcom.2010.vcxproj    Surface.cpp
CraftWeapon.h     OpenXcom.2010.vcxproj.filters    Surface.h
CraftWeapon.o     OpenXcom.cbp    Surface.o
Cursor.cpp     OptionsState.cpp    SurfaceSet.cpp
Cursor.h     OptionsState.h    SurfaceSet.h
Cursor.o     OptionsState.o    SurfaceSet.o
DismantleFacilityState.cpp     Palette.cpp    TestState.cpp
DismantleFacilityState.h     Palette.h    TestState.h
DismantleFacilityState.o     Palette.o    TestState.o
Doxyfile     PlaceFacilityState.cpp    TextButton.cpp
Font.cpp     PlaceFacilityState.h    TextButton.h
Font.h     PlaceFacilityState.o    TextButton.o
Font.o     PlaceLiftState.cpp    Text.cpp
FundingState.cpp     PlaceLiftState.h    TextEdit.cpp
FundingState.h     PlaceLiftState.o    TextEdit.h
FundingState.o     Polygon.cpp    TextEdit.o
Game.cpp     Polygon.h    Text.h
Game.h     Polygon.o    TextList.cpp
Game.o     Polyline.cpp    TextList.h
GameTime.cpp     Polyline.h    TextList.o
GameTime.h     Polyline.o    Text.o
GameTime.o     PurchaseState.cpp    Timer.cpp
GeoscapeErrorState.cpp     PurchaseState.h    Timer.h
GeoscapeErrorState.h     PurchaseState.o    Timer.o
GeoscapeErrorState.o     README.txt    Window.cpp
GeoscapeMessageState.cpp     Region.cpp    Window.h
GeoscapeMessageState.h     Region.h    Window.o
GeoscapeMessageState.o     Region.o    XcomResourcePack.cpp
GeoscapeState.cpp     ResearchState.cpp    XcomResourcePack.h
GeoscapeState.h     ResearchState.h    XcomResourcePack.o
GeoscapeState.o     ResearchState.o    XcomRuleset.cpp
Globe.cpp     ResourcePack.cpp    XcomRuleset.h
Globe.h     ResourcePack.h    XcomRuleset.o

DATA:
dos4gw.exe game_6 install.exe readme.txt terrain update.bat
full.bat game_7 intro.exe routes ufo xcom.bat
game_1 game_8 maps runexe ufo2exe x-com.faq
game_10 game_9 missdat saved.com ufo.bat
game_2 geodata mpscopy.exe setup.exe ufoexe
game_3 geograph newxcom.bat small.bat ufograph
game_4 go.bat pkunzip.exe sound ufointro
game_5 go.com readme.bat sound.cfg units

I think my copy has use UFO v1.4 patch installed - will openxcom use any version of the game? I assume that few if any of the changes in the UFO patches were content related, so the version should not make too much of a difference?

Offline SupSuper

  • Lazy Developer
  • Administrator
  • Commander
  • *****
  • Posts: 2161
    • View Profile
Re: Problems launching openxcom after compiling on Ubuntu
« Reply #3 on: August 07, 2010, 06:36:34 pm »
Thanks for that. The UFO version isn't the problem, curiously, but that your filenames are lowercase (OpenXcom checks for uppercase filenames and Unix is case-sensitive). Congratulations, you are the first UFO player to have lowercase filenames... or something. :P

The weird thing is how it didn't even show an error either, it just died. I'll have to look into it. Until then, you can just uppercase all the files in the DATA folder with this shell script:
Code: [Select]
for i in *
do
mv $i `echo $i|awk '{print toupper($0)}'`
done

Offline bramcor

  • Captain
  • ***
  • Posts: 76
    • View Profile
Re: Problems launching openxcom after compiling on Ubuntu
« Reply #4 on: August 08, 2010, 12:31:47 am »
Shell script worked like a charm, but the change didn't seem to make much of a difference...

I get the exact same message as before when attempting to launch the game :(

I was wondering whether it makes a difference that i run Ubuntu x86_64?

Is it possible to activate a debug-mode that prints more usable info to the terminal?
« Last Edit: August 08, 2010, 01:38:48 pm by bramcor »

Offline SupSuper

  • Lazy Developer
  • Administrator
  • Commander
  • *****
  • Posts: 2161
    • View Profile
Re: Problems launching openxcom after compiling on Ubuntu
« Reply #5 on: August 08, 2010, 09:05:59 pm »
Shell script worked like a charm, but the change didn't seem to make much of a difference...

I get the exact same message as before when attempting to launch the game :(

I was wondering whether it makes a difference that i run Ubuntu x86_64?

Is it possible to activate a debug-mode that prints more usable info to the terminal?
Did you also uppercase all the files inside the UFO subfolders?

What you run shouldn't make a difference, I'd hope. I don't have the resources to intensively test this everywhere.

By default the game is in "debug-mode" (since these are SVN builds, not release builds) and automatically outputs any errors to the screen or console, whichever possible. I'm not sure why it's not working, it works fine on Windows. Ugh why can't every platform behave equally? :P

Edit: Ok I found out the problem is in the catch lines. Until I commit it to SVN, here's what you need to do to fix it. Go in the main.cpp and StartState.cpp files and replace:
Code: [Select]
catch (char* c)With:
Code: [Select]
catch (const char* c)
Apparently the former works fine in Windows but not in Linux. That should let you see the error messages when you run it next time. If you get something like "ERROR: Failed to load palette" then your UFO copy is missing files, or they don't have the filenames as expected.
« Last Edit: August 08, 2010, 09:12:50 pm by SupSuper »

Offline bramcor

  • Captain
  • ***
  • Posts: 76
    • View Profile
Re: Problems launching openxcom after compiling on Ubuntu
« Reply #6 on: August 09, 2010, 12:33:34 am »
When you are right, you are right :)

Great work figuring out my problem with the debugging info!

Once the "const" was in place the game output the "failed to load palette" error - funny thing how Linux is often quite picky with what it will work with :P

I had mistakenly assumed that the shell script you made for me would automagically go through sub-directories - lesson learnt I guess... anyways, I cleaned up the lower-case mess and openxcom immediately launched.

It works like a charm :D

Great work - and thanks for the help figuring out my problem!