Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: How to get it working with Ubuntu and Code::blocks.  (Read 5707 times)

0 Members and 1 Guest are viewing this topic.

JohnJojo

  • Newbie
  • *
  • Posts: 4
    • AOL Instant Messenger - maximo7274
    • View Profile
    • Email
How to get it working with Ubuntu and Code::blocks.
« on: January 07, 2009, 11:32:57 pm »
I have only just started to use Ubuntu, and it is only because my computer got a virus and I needed to format the drive and then install an OS, and the only free one was Ubuntu.  So far I really like it, as to install stuff you only have to go into the terminal and type sudo apt-get install and then the file name.

I realized you can't do this with SFML, and I tried downloading it.  Now it is sitting on my desktop, the .gz file, because I don't know how to install it.

So,
A) I would like some help with installing it, or at least setting it up.
B) Since I am really used to Visual c++, how would I set it up with Code::Blocks so I can use it?  Is it the same as with Visual c++- and if so, what are the files I would need to include the path to?

I would appreciate any help, and remember, I am a total noob with ubuntu, so if you could make it pretty simple to understand (I mean, not SO simple :-D)  That would be helpful.

Thanks! :-D
:-/  NO idea what that means.  \-:

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
How to get it working with Ubuntu and Code::blocks.
« Reply #1 on: January 08, 2009, 07:54:40 am »
Please just read the tutorials. There's one for Linux and one for Code::Blocks.
Laurent Gomila - SFML developer

JohnJojo

  • Newbie
  • *
  • Posts: 4
    • AOL Instant Messenger - maximo7274
    • View Profile
    • Email
How to get it working with Ubuntu and Code::blocks.
« Reply #2 on: January 11, 2009, 02:45:53 pm »
Quote from: "Laurent"
Please just read the tutorials. There's one for Linux and one for Code::Blocks.


Sorry about the late reply, but thanks!  I know it seems stupid that i didn't check the tutorials, and that is because i was looking under wiki, which was confusing me.  I thought tutorials were for the actual programing only.

Thanks again! :D

[edit] I have tried doing the linux install tutorial, and i am stuck at the part where it says-
Quote
Once you have downloaded and extracted the files to your hard drive, you must install the SFML headers and library files to the appropriate location. To do so, you just have to go to the SFML-x.y directory and type "sudo make install".


I can't seem to find the SFML-x.y directory...
Any help would be appreciated!

[EDIT 2]
I tried the code::blocks tutorial next, and i did everything but i get this error-

I am not sure how to fix this error, so i could use some help... thanks
:-/  NO idea what that means.  \-:

zac

  • Jr. Member
  • **
  • Posts: 60
    • View Profile
How to get it working with Ubuntu and Code::blocks.
« Reply #3 on: January 11, 2009, 03:32:09 pm »
Okay...
I suggest:
You download the latest SVN-Code from the repository (Download GNU Tarball option).
You just extract the .tar.gz-File (should work with the ubuntu GUI "Extract here" option).
Then you open a terminal/console, and go to that directory (if you downloaded the thing to your desktop, this might be done with "cd Desktop/sfml".)
Then, you type "make" (it will try to compile SFML).
It is great if that works, but there might be some errors (because you are lacking some of the dependencies), so you have to download the missing packets (libopenal(-dev), libsndfile(-dev), ...) via apt-get or, would be easier for a beginner, via synaptic, until there are no more errors (guessing the right packet might be a bit complicated).
If "make" runs without errors (all dependencies are ok), then you simply type "sudo make install" to install SFML. This should be all.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
How to get it working with Ubuntu and Code::blocks.
« Reply #4 on: January 11, 2009, 04:11:00 pm »
Quote
I can't seem to find the SFML-x.y directory...

In this case it is SFML-1.4, and it is the root directory of the archive.
Laurent Gomila - SFML developer

JohnJojo

  • Newbie
  • *
  • Posts: 4
    • AOL Instant Messenger - maximo7274
    • View Profile
    • Email
How to get it working with Ubuntu and Code::blocks.
« Reply #5 on: January 11, 2009, 05:42:31 pm »
As of right now i feel like a complete moron... :(   I guess it makes sense that SFML-x.y is just the file name with the x and y replacing the numbers...

I tried what you said doing, with the terminal thing and everything, but everytime i enter make or sudo make install, it always says there is nothing to do with the directory.  

Code: [Select]
byron@byron-laptop:~$ /home/byron/Desktop/SFML-1.4
bash: /home/byron/Desktop/SFML-1.4: is a directory
byron@byron-laptop:~$ make
make: *** No targets specified and no makefile found.  Stop.
byron@byron-laptop:~$ make /home/byron/Desktop/SFML-1.4
make: Nothing to be done for `/home/byron/Desktop/SFML-1.4'.
byron@byron-laptop:~$ cd Desktop/sfml-1.4
bash: cd: Desktop/sfml-1.4: No such file or directory
byron@byron-laptop:~$ /home/byron/Desktop/SFML-1.4
bash: /home/byron/Desktop/SFML-1.4: is a directory
byron@byron-laptop:~$ make
make: *** No targets specified and no makefile found.  Stop.
byron@byron-laptop:~$ sudo make install
[sudo] password for byron:
make: *** No rule to make target `install'.  Stop.
byron@byron-laptop:~$ /home/byron/Desktop/SFML-1.4
bash: /home/byron/Desktop/SFML-1.4: is a directory
byron@byron-laptop:~$ sudo make install
make: *** No rule to make target `install'.  Stop.
byron@byron-laptop:~$ sudo makefile install
sudo: makefile: command not found
byron@byron-laptop:~$


Those are the errors i am getting when i try to do what i think is what you are telling me to do.  Hopefully it is just a noob error and it easy to fix.

Thanks for the help, but i think i will be needing a LOT more  :lol:   And if you are getting mad at me because i am so bad at this, all i can say is that i apologize. :D
:-/  NO idea what that means.  \-:

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
How to get it working with Ubuntu and Code::blocks.
« Reply #6 on: January 11, 2009, 05:50:21 pm »
Apparently you first need to read some Linux tutorials :D

The correct command for changing the current directory is "cd". You almost succeeded with "cd Desktop/sfml-1.4", but why did you use lowercase?
Code: [Select]
cd /Desktop/SFML-1.4
Then you can enter "make" and "sudo make install".
Laurent Gomila - SFML developer

irri

  • Newbie
  • *
  • Posts: 18
    • View Profile
    • http://www.irri.se
How to get it working with Ubuntu and Code::blocks.
« Reply #7 on: January 11, 2009, 07:47:13 pm »
Quote from: "Laurent"
Apparently you first need to read some Linux tutorials :D

The correct command for changing the current directory is "cd". You almost succeeded with "cd Desktop/sfml-1.4", but why did you use lowercase?
Code: [Select]
cd /Desktop/SFML-1.4
Then you can enter "make" and "sudo make install".


I think you got one slash too much :lol:
Code: [Select]
cd Desktop/SFML-1.4
2D RPG Game (School project): http://PA.irri.se/

zac

  • Jr. Member
  • **
  • Posts: 60
    • View Profile
How to get it working with Ubuntu and Code::blocks.
« Reply #8 on: January 12, 2009, 11:54:14 pm »
Hu... yeah... I did, in fact, tell you how to change the current working directory... =)
"cd Desktop/sfml" should work... (with the latest SVN-Sources, where the Directory is simply called sfml)...
Another way would most probably be:
make -C Desktop/sfml-1.4 (or how the directory is named)


Something important about Linux paths:
A path starting with '/' is considered a GLOBAL path (because / is the root directory).
So /Desktop/ and Desktop/ differ - there is no directory called Desktop in / (at least this would not be very usual), but the second path, not starting with a slash, thereby a local path (relative to the current working directory), is equal to ./Desktop, what is exactly what you want here.

JohnJojo

  • Newbie
  • *
  • Posts: 4
    • AOL Instant Messenger - maximo7274
    • View Profile
    • Email
How to get it working with Ubuntu and Code::blocks.
« Reply #9 on: January 17, 2009, 03:50:57 pm »
Ok, so now i got it to make the file, finally.  Now I am not exactly sure what happened, because nothing changed...

Thanks
:-/  NO idea what that means.  \-:

 

anything