Jump to content
  • Advertisement
Sign in to follow this  
Hernan13

Problems porting to linux - anjuta settings

This topic is 3552 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I'm attempting to port a game i've made from windows to linux. (http://www.moddb.com/games/paddock-master if your interested). When i try to build it in anjuta, i get a lot of a lot of errors along the lines of "undefined reference to 'SDL_FreeSurface'" (not all of the errors are relating to SDL, most of them are to my own functions located in other .cc files) it all works fine in windows, i'm just unsure how to properly set up anjuta (i have anjuta 2.24.1)

Share this post


Link to post
Share on other sites
Advertisement
If this game is pretty much finished and you just want to build it on Linux, I'd recommend just compiling it from the command line rather than learning how to use an IDE. Try doing the following:

> g++ -c *.cc

This will compile all of your C++ sources into object code. Then link them together and with the libraries you need. For example:

> g++ -o NameOfExecutable -lSDL -lSDL_mixer -lSDL_ttf -lSDL_image *.o

Then if all went well, you should have an executable program.

Obviously, if you are developing a project from scratch on Linux, this is not the right method to use to build you programs, but it is definitely a good thing to know how to do at any rate.

Share this post


Link to post
Share on other sites
thanks, that should be all i need - it isn't finished, but i'm releasing development versions as i get more stuff happening, i'm making it in windows in visual c++ express, so this is really sufficient.

Share this post


Link to post
Share on other sites
alright a fresh, semi-related problem.
This program opens a lot of files at run-time, this is because i want it to be highly moddable, files which are named explicitly in the code open fine (e.g. background = load_image( "scripts//graphics//splash.png" );), however, a lot of files are named in text files, and these do not open with the linux version (e.g. background = load_image( mod + "//graphics//" + MenuImage); where MenuImage is a string which loads from one of those text files, is there some other way i should be doing this in linux? without an IDE properly working i can't really run the program up to a point to check the content of those strings like i normally would in vs.

Edit - after some rudimentary debugging (just having it output the strings to a text document) i'm even more confused, the strings are setting properly from the text documents (i.e mod + "//graphics//" + MenuImage DOES output as scripts//graphics//menu.png) i can see no reason this doesn't load it (if i replace mod + "//graphics//" + MenuImage with scripts//graphics//menu.png in the code, it works properly)

[Edited by - Hernan13 on January 26, 2009 10:36:38 AM]

Share this post


Link to post
Share on other sites
That is odd. I haven't seen anyone use '//' as directory delimiters, but it does seem to work. Make sure that there are no extra characters in your filenames - including any spaces. Another thing to keep in mind is that, unlike Windows, Linux file names are case sensitive so be sure you are capitalizing correctly. Also be sure not to have a '/' character at the beginning of your filename since that denotes the root directory on unix.

Share this post


Link to post
Share on other sites
Hmm, it's odd, but when i leave getline's delimiter as the default, it seems to include the new line, which is whats causing the problem, i may be able to work around this, but it just seems strange.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!