Jump to content

  • Log In with Google      Sign In   
  • Create Account

SDL 2.0 setup un Ubuntu


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
5 replies to this topic

#1 kaktusas2598   Members   -  Reputation: 846

Like
0Likes
Like

Posted 04 December 2013 - 08:22 AM

Hey guys, recently I started using Ubuntu 13.10 as transition from Windows 7 and I'm quite fresh at these linux tricks. Maybe anyone knows how I can setup and install SDL2 on Ubuntu to use with g++ and gdb. Thank you.


Behind every great fortune lies a great crime.
Honore de Balzac

Sponsor:

#2 Álvaro   Crossbones+   -  Reputation: 13310

Like
0Likes
Like

Posted 04 December 2013 - 08:47 AM

This is how you do it: You go to google.com and enter `install sdl 2 ubuntu'.



#3 kaktusas2598   Members   -  Reputation: 846

Like
0Likes
Like

Posted 04 December 2013 - 08:53 AM

I already tried articles from google, but  ./configure command don't work to me.


Behind every great fortune lies a great crime.
Honore de Balzac

#4 Álvaro   Crossbones+   -  Reputation: 13310

Like
1Likes
Like

Posted 04 December 2013 - 09:06 AM

With your initial description, we can't possibly do better than a generic article on the web. You need to give us a lot of detail about what you have tried, what error messages you got, etc.

 

And then again, this might not be the best forum to post your question: Both Ubuntu and SDL have forums where you can probably find people who know much more about this. Anyway, if you go through the trouble of giving us a chance at knowing what the problem is, I'll help you. But I can't get you very far with a description like "./configure command don't work to me".


Edited by Álvaro, 04 December 2013 - 09:08 AM.


#5 kaktusas2598   Members   -  Reputation: 846

Like
0Likes
Like

Posted 04 December 2013 - 09:11 AM

I'm sorry about disturbing your time, I already have  solution. I used Synaptic pachage manager to install SDL2 packages and compiled g++ with parameters -lSDL2 -L /path/to/libs -I /path/includes ;)


Edited by kaktusas2598, 04 December 2013 - 09:11 AM.

Behind every great fortune lies a great crime.
Honore de Balzac

#6 dilyan_rusev   Members   -  Reputation: 948

Like
1Likes
Like

Posted 05 December 2013 - 02:07 AM

Umm, no need for those things. AFAIK, most libraries in UNIX world either use pkg-config or custom libraryName-config programs to provide processor/linker flags. In the case of SDL2, I think the custom program is sdl2-config - i.e. running something like:

g++ file.cpp `sdl2-config --cflags --libs`

should be the preferred method on unix/linux machines, as it is portable. A more generic approach would be to use pkg-config:

g++ file.cpp `pkg-config --cflags --libs sdl2`

 

However, I would strongly recommend against compiling on the command line. It is a waste of time and productivity. Both Eclipse and QtCreator are great IDEs for C++, and you should use one if you want to focus on getting stuff done and not on compiling. If you are *really* intent on learning how to compile on linux, at least look up make files and normal build systems like cmake and scons.

 

A few tips on linux distributions: although library imports are generally named libNAME.a, you include them via their name only (-l NAME) - unlike Visual Studio. All libraries installed via the package manager (in your case, apt) go to /usr/include (in case you want to browse them manually). Usually you can execute shell commands and include the output of those commands in another command. That is why I've put accents (`) and not quotes (') around sdl2-config and pkg-config. Those programs print to stdout, but with the accents syntax you capture the output and put in in your command string. You can view documentation on C functions via the man command, e.g. man 3 printf would show you the documentation for printf. Some packages install man pages as well, but most don't. I haven't found the manual pages particularly useful for c++, though.

 

[Note: I don't have an ubuntu box atm and I haven't spell-checked the commands]






Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS