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

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - adamkwal

Pages: [1]
1
General / Problem decompressing SFML 1.6 tar in Ubuntu 10.04
« on: May 20, 2010, 01:14:01 am »
I had the same problem with 1.6, but 2.0 extracted fine for me

2
General / I can't get SFML 2 to build on Fedora 12.
« on: May 11, 2010, 02:45:45 am »
Hey its me again, if you want to authorize a path with your OS you need to add it to your $PATH.  Here is a great tutorial that works with any linux distribution that has a terminal: http://www.codecoffee.com/tipsforlinux/articles/030.html

3
Hey guys, recently I have installed linux mint 9 and I could not get sfml to compile and work on it.  I searched the forums, and asked a few questions and eventually figured it out.  I have decided to write this simple tutorial to save you the massive headache that me and others like me have had trying to do this task. Lets get started :P

First thing is first, make sure you have all of these packages installed

    build-essential
    mesa-common-dev
    libx11-dev
    libxrandr-dev
    libgl1-mesa-dev
    libglu1-mesa-dev
    libfreetype6-dev
    libopenal-dev
    libsndfile1-dev


If your linux distribution has a package manager for them, I would look there. Otherwise just google them and manually install them.

Now download sfml version that you would like to use, for this example I will be using sfml2. http://sfml.svn.sourceforge.net/viewvc/sfml/branches/sfml2.tar.gz?view=tar, but you can use any version you want http://www.sfml-dev.org/download.php

Now open up your terminal and navigate to your sfml-x.y directory, and type these following commands
    make clean
    make

If this works and you receive no errors then just type: sudo make install

However if you are like me, then you will receive tons of errors when trying to "make" the directory.  To fix these errors you will need to install the libraries that the errors are asking for.  For example I was getting errors about png and jpg images, so I went to my package manager and installed the png/jpg libraries.  I kept on doing this until all of the packages I was missing were installed.  Finally when I typed: make clean -> make it compiled!  Then I wrote sudo make install and everything installed.  

Next I was starting to get errors that the system.so.2.0,graphics.so.2.0,etc were not found.  To solve this I had to log in as root, here are the steps
    Open terminal
    Type: sudo su
    Type: passwd
    Close terminal

Now log out of your session, and relog as root(the password is what you set up in the above steps)

Navigate to your usr/local/lib folder and copy all of the files(system.so.2.0,etc) to the directory usr/lib

Now open code::blocks and go to setting->Compiler Settings
Go to Search directories and under compiler and your sfml-x.y/include.  Then in linker add your sfml-x.y/lib.

Finally in Linker Settings->Other linker options  add these and whatever else you need: -lsfml-graphics, -lsfml-window, -lsfml-system, etc->Press OK

You should now be able to compile/run all sfml code.

To test if it works type this, and compile it
Code: [Select]

#include <SFML/Graphics.hpp>

using namespace sf;

int main()
{
// Create the main rendering window
    sf::RenderWindow App(sf::VideoMode(800, 600, 32), "SFML Graphics");
   
    // Start game loop
    while (App.IsOpened())
    {
        // Process events
        sf::Event Event;
        while (App.GetEvent(Event))
        {
            // Close window : exit
            if (Event.Type == sf::Event::Closed)
                App.Close();
        }

        // Clear the screen (fill it with black color)
        App.Clear();

        // Display window contents on screen
        App.Display();
    }

    return EXIT_SUCCESS;
}


Hopefully this helped :lol:.  If you are still getting errors with "make" please post them as a comment and hopefully someone can help you.

4
General / I can't get SFML 2 to build on Fedora 12.
« on: May 10, 2010, 04:29:20 am »
Sweet thank you man :lol: I could not paste them normally, but when I logged in as root I could paste them.  If there is someone that does not log into root this is what I did(Linux Mint/Linux Ubuntu?), open up terminal type sudo su then type passwd.  After setting that up, log out of your session and then press other user, type root for username, and the password you just set as your password.  Now you can copy and paste stuff to and from usr/lib.

5
General / I can't get SFML 2 to build on Fedora 12.
« on: May 10, 2010, 04:00:47 am »
Hey, I recently had this problem when trying to compile my sfml 2 on linux mint. Open terminal and navigate to your sfml-x.y director, type make clean.  The next step is to install of of these files
    build-essential
    mesa-common-dev
    libx11-dev
    libxrandr-dev
    libgl1-mesa-dev
    libglu1-mesa-dev
    libfreetype6-dev
    libopenal-dev
    libsndfile1-dev

I found all of these in my package manager, after that go to the directory again in terminal and type make.  It should work, if not look through the errors for missing libraries, I had to install the jpg and png library.  Finally after installing all of the missing components typing make clean -> make -> sudo make install installed sfml2 on my linux.  Then just link your folders to Code::Blocks or whatever other compilers you used.  This should work for the first few examples.  

Also does anyone know why I am receiving this error?
Code: [Select]

error while loading shared libraries: libsfml-graphics.so.2.0: cannot open shared object file: No such file in directory

6
General / Please help me
« on: May 10, 2010, 02:30:53 am »
Hi guys, I cannot get sfml2 to work with linux mint.  I have downloaded the source and in the terminal typed make clean in the directory here is what I get
Code: [Select]

cd ./build/make && make clean
make[1]: Entering directory `/home/adam/src/sfml2/build/make'
make clean -f Makefile.system
make[2]: Entering directory `/home/adam/src/sfml2/build/make'
rm -rf ../../src/SFML/System/Clock.o ../../src/SFML/System/Err.o ../../src/SFML/System/Lock.o ../../src/SFML/System/Mutex.o ../../src/SFML/System/Randomizer.o ../../src/SFML/System/Sleep.o ../../src/SFML/System/String.o ../../src/SFML/System/Thread.o ../../src/SFML/System/ThreadLocal.o ../../src/SFML/System/Utf.o ../../src/SFML/System/Unix/Initializer.o ../../src/SFML/System/Unix/MutexImpl.o ../../src/SFML/System/Unix/Platform.o ../../src/SFML/System/Unix/ThreadImpl.o ../../src/SFML/System/Unix/ThreadLocalImpl.o
make[2]: Leaving directory `/home/adam/src/sfml2/build/make'
make clean -f Makefile.window
make[2]: Entering directory `/home/adam/src/sfml2/build/make'
rm -rf ../../src/SFML/Window/Context.o ../../src/SFML/Window/GlContext.o ../../src/SFML/Window/Input.o ../../src/SFML/Window/VideoMode.o ../../src/SFML/Window/Window.o ../../src/SFML/Window/WindowImpl.o ../../src/SFML/Window/Linux/GlxContext.o ../../src/SFML/Window/Linux/Joystick.o ../../src/SFML/Window/Linux/VideoModeImpl.o ../../src/SFML/Window/Linux/WindowImplX11.o
make[2]: Leaving directory `/home/adam/src/sfml2/build/make'
make clean -f Makefile.graphics
make[2]: Entering directory `/home/adam/src/sfml2/build/make'
rm -rf ../../src/SFML/Graphics/Color.o ../../src/SFML/Graphics/Drawable.o ../../src/SFML/Graphics/Font.o ../../src/SFML/Graphics/GLCheck.o ../../src/SFML/Graphics/Image.o ../../src/SFML/Graphics/ImageLoader.o ../../src/SFML/Graphics/Matrix3.o ../../src/SFML/Graphics/Renderer.o ../../src/SFML/Graphics/RenderImage.o ../../src/SFML/Graphics/RenderImageImpl.o ../../src/SFML/Graphics/RenderImageImplFBO.o ../../src/SFML/Graphics/RenderTarget.o ../../src/SFML/Graphics/RenderWindow.o ../../src/SFML/Graphics/Shader.o ../../src/SFML/Graphics/Shape.o ../../src/SFML/Graphics/Sprite.o ../../src/SFML/Graphics/Text.o ../../src/SFML/Graphics/View.o ../../src/SFML/Graphics/Linux/RenderImageImplPBuffer.o
make[2]: Leaving directory `/home/adam/src/sfml2/build/make'
make clean -f Makefile.audio
make[2]: Entering directory `/home/adam/src/sfml2/build/make'
rm -rf ../../src/SFML/Audio/ALCheck.o ../../src/SFML/Audio/AudioDevice.o ../../src/SFML/Audio/Listener.o ../../src/SFML/Audio/Music.o ../../src/SFML/Audio/SoundBuffer.o ../../src/SFML/Audio/SoundBufferRecorder.o ../../src/SFML/Audio/Sound.o ../../src/SFML/Audio/SoundFile.o ../../src/SFML/Audio/SoundRecorder.o ../../src/SFML/Audio/SoundSource.o ../../src/SFML/Audio/SoundStream.o
make[2]: Leaving directory `/home/adam/src/sfml2/build/make'
make clean -f Makefile.network
make[2]: Entering directory `/home/adam/src/sfml2/build/make'
rm -rf ../../src/SFML/Network/Ftp.o ../../src/SFML/Network/Http.o ../../src/SFML/Network/IpAddress.o ../../src/SFML/Network/Packet.o ../../src/SFML/Network/Socket.o ../../src/SFML/Network/SocketSelector.o ../../src/SFML/Network/TcpListener.o ../../src/SFML/Network/TcpSocket.o ../../src/SFML/Network/UdpSocket.o ../../src/SFML/Network/Unix/SocketImpl.o
make[2]: Leaving directory `/home/adam/src/sfml2/build/make'
cd ../../samples/build/make && make clean
make[2]: Entering directory `/home/adam/src/sfml2/samples/build/make'
for sample in ftp opengl pong shader sockets sound sound_capture voip window X11; do make clean -f Makefile.${sample}; done
make[3]: Entering directory `/home/adam/src/sfml2/samples/build/make'
make[3]: Leaving directory `/home/adam/src/sfml2/samples/build/make'
make[3]: Entering directory `/home/adam/src/sfml2/samples/build/make'
make[3]: Leaving directory `/home/adam/src/sfml2/samples/build/make'
make[3]: Entering directory `/home/adam/src/sfml2/samples/build/make'
make[3]: Leaving directory `/home/adam/src/sfml2/samples/build/make'
make[3]: Entering directory `/home/adam/src/sfml2/samples/build/make'
make[3]: Leaving directory `/home/adam/src/sfml2/samples/build/make'
make[3]: Entering directory `/home/adam/src/sfml2/samples/build/make'
make[3]: Leaving directory `/home/adam/src/sfml2/samples/build/make'
make[3]: Entering directory `/home/adam/src/sfml2/samples/build/make'
make[3]: Leaving directory `/home/adam/src/sfml2/samples/build/make'
make[3]: Entering directory `/home/adam/src/sfml2/samples/build/make'
make[3]: Leaving directory `/home/adam/src/sfml2/samples/build/make'
make[3]: Entering directory `/home/adam/src/sfml2/samples/build/make'
make[3]: Leaving directory `/home/adam/src/sfml2/samples/build/make'
make[3]: Entering directory `/home/adam/src/sfml2/samples/build/make'
make[3]: Leaving directory `/home/adam/src/sfml2/samples/build/make'
make[3]: Entering directory `/home/adam/src/sfml2/samples/build/make'
make[3]: Leaving directory `/home/adam/src/sfml2/samples/build/make'
make[2]: Leaving directory `/home/adam/src/sfml2/samples/build/make'
make[1]: Leaving directory `/home/adam/src/sfml2/build/make'


Then I try type make and this is what I get
Code: [Select]

cd ./build/make && make sfml
make[1]: Entering directory `/home/adam/src/sfml2/build/make'
mkdir -p ../../lib
make -f Makefile.system
make[2]: Entering directory `/home/adam/src/sfml2/build/make'
g++ -o ../../src/SFML/System/Clock.o -c ../../src/SFML/System/Clock.cpp -W -Wall -pedantic -g -O2 -DNDEBUG -I../../include -I../../src -fPIC
g++ -o ../../src/SFML/System/Err.o -c ../../src/SFML/System/Err.cpp -W -Wall -pedantic -g -O2 -DNDEBUG -I../../include -I../../src -fPIC
g++ -o ../../src/SFML/System/Lock.o -c ../../src/SFML/System/Lock.cpp -W -Wall -pedantic -g -O2 -DNDEBUG -I../../include -I../../src -fPIC
g++ -o ../../src/SFML/System/Mutex.o -c ../../src/SFML/System/Mutex.cpp -W -Wall -pedantic -g -O2 -DNDEBUG -I../../include -I../../src -fPIC
g++ -o ../../src/SFML/System/Randomizer.o -c ../../src/SFML/System/Randomizer.cpp -W -Wall -pedantic -g -O2 -DNDEBUG -I../../include -I../../src -fPIC
g++ -o ../../src/SFML/System/Sleep.o -c ../../src/SFML/System/Sleep.cpp -W -Wall -pedantic -g -O2 -DNDEBUG -I../../include -I../../src -fPIC
g++ -o ../../src/SFML/System/String.o -c ../../src/SFML/System/String.cpp -W -Wall -pedantic -g -O2 -DNDEBUG -I../../include -I../../src -fPIC
g++ -o ../../src/SFML/System/Thread.o -c ../../src/SFML/System/Thread.cpp -W -Wall -pedantic -g -O2 -DNDEBUG -I../../include -I../../src -fPIC
g++ -o ../../src/SFML/System/ThreadLocal.o -c ../../src/SFML/System/ThreadLocal.cpp -W -Wall -pedantic -g -O2 -DNDEBUG -I../../include -I../../src -fPIC
g++ -o ../../src/SFML/System/Utf.o -c ../../src/SFML/System/Utf.cpp -W -Wall -pedantic -g -O2 -DNDEBUG -I../../include -I../../src -fPIC
g++ -o ../../src/SFML/System/Unix/Initializer.o -c ../../src/SFML/System/Unix/Initializer.cpp -W -Wall -pedantic -g -O2 -DNDEBUG -I../../include -I../../src -fPIC
g++ -o ../../src/SFML/System/Unix/MutexImpl.o -c ../../src/SFML/System/Unix/MutexImpl.cpp -W -Wall -pedantic -g -O2 -DNDEBUG -I../../include -I../../src -fPIC
g++ -o ../../src/SFML/System/Unix/Platform.o -c ../../src/SFML/System/Unix/Platform.cpp -W -Wall -pedantic -g -O2 -DNDEBUG -I../../include -I../../src -fPIC
g++ -o ../../src/SFML/System/Unix/ThreadImpl.o -c ../../src/SFML/System/Unix/ThreadImpl.cpp -W -Wall -pedantic -g -O2 -DNDEBUG -I../../include -I../../src -fPIC
g++ -o ../../src/SFML/System/Unix/ThreadLocalImpl.o -c ../../src/SFML/System/Unix/ThreadLocalImpl.cpp -W -Wall -pedantic -g -O2 -DNDEBUG -I../../include -I../../src -fPIC
g++ -shared -Wl,-soname,libsfml-system.so.2.0 -o ../../lib/libsfml-system.so.2.0 ../../src/SFML/System/Clock.o ../../src/SFML/System/Err.o ../../src/SFML/System/Lock.o ../../src/SFML/System/Mutex.o ../../src/SFML/System/Randomizer.o ../../src/SFML/System/Sleep.o ../../src/SFML/System/String.o ../../src/SFML/System/Thread.o ../../src/SFML/System/ThreadLocal.o ../../src/SFML/System/Utf.o ../../src/SFML/System/Unix/Initializer.o ../../src/SFML/System/Unix/MutexImpl.o ../../src/SFML/System/Unix/Platform.o ../../src/SFML/System/Unix/ThreadImpl.o ../../src/SFML/System/Unix/ThreadLocalImpl.o -lpthread
make[2]: Leaving directory `/home/adam/src/sfml2/build/make'
mkdir -p ../../lib
make -f Makefile.window
make[2]: Entering directory `/home/adam/src/sfml2/build/make'
g++ -o ../../src/SFML/Window/Context.o -c ../../src/SFML/Window/Context.cpp -W -Wall -pedantic -g -O2 -DNDEBUG -I../../include -I../../src -fPIC
g++ -o ../../src/SFML/Window/GlContext.o -c ../../src/SFML/Window/GlContext.cpp -W -Wall -pedantic -g -O2 -DNDEBUG -I../../include -I../../src -fPIC
g++ -o ../../src/SFML/Window/Input.o -c ../../src/SFML/Window/Input.cpp -W -Wall -pedantic -g -O2 -DNDEBUG -I../../include -I../../src -fPIC
g++ -o ../../src/SFML/Window/VideoMode.o -c ../../src/SFML/Window/VideoMode.cpp -W -Wall -pedantic -g -O2 -DNDEBUG -I../../include -I../../src -fPIC
g++ -o ../../src/SFML/Window/Window.o -c ../../src/SFML/Window/Window.cpp -W -Wall -pedantic -g -O2 -DNDEBUG -I../../include -I../../src -fPIC
g++ -o ../../src/SFML/Window/WindowImpl.o -c ../../src/SFML/Window/WindowImpl.cpp -W -Wall -pedantic -g -O2 -DNDEBUG -I../../include -I../../src -fPIC
g++ -o ../../src/SFML/Window/Linux/GlxContext.o -c ../../src/SFML/Window/Linux/GlxContext.cpp -W -Wall -pedantic -g -O2 -DNDEBUG -I../../include -I../../src -fPIC
g++ -o ../../src/SFML/Window/Linux/Joystick.o -c ../../src/SFML/Window/Linux/Joystick.cpp -W -Wall -pedantic -g -O2 -DNDEBUG -I../../include -I../../src -fPIC
g++ -o ../../src/SFML/Window/Linux/VideoModeImpl.o -c ../../src/SFML/Window/Linux/VideoModeImpl.cpp -W -Wall -pedantic -g -O2 -DNDEBUG -I../../include -I../../src -fPIC
../../src/SFML/Window/Linux/VideoModeImpl.cpp:31:35: error: X11/extensions/Xrandr.h: No such file or directory
../../src/SFML/Window/Linux/VideoModeImpl.cpp: In static member function ‘static std::vector<sf::VideoMode, std::allocator<sf::VideoMode> > sf::priv::VideoModeImpl::GetFullscreenModes()’:
../../src/SFML/Window/Linux/VideoModeImpl.cpp:56: error: ‘XRRScreenConfiguration’ was not declared in this scope
../../src/SFML/Window/Linux/VideoModeImpl.cpp:56: error: ‘config’ was not declared in this scope
../../src/SFML/Window/Linux/VideoModeImpl.cpp:56: error: ‘XRRGetScreenInfo’ was not declared in this scope
../../src/SFML/Window/Linux/VideoModeImpl.cpp:61: error: ‘XRRScreenSize’ was not declared in this scope
../../src/SFML/Window/Linux/VideoModeImpl.cpp:61: error: ‘sizes’ was not declared in this scope
../../src/SFML/Window/Linux/VideoModeImpl.cpp:61: error: ‘XRRConfigSizes’ was not declared in this scope
../../src/SFML/Window/Linux/VideoModeImpl.cpp:86: error: ‘XRRFreeScreenConfigInfo’ was not declared in this scope
../../src/SFML/Window/Linux/VideoModeImpl.cpp: In static member function ‘static sf::VideoMode sf::priv::VideoModeImpl::GetDesktopMode()’:
../../src/SFML/Window/Linux/VideoModeImpl.cpp:130: error: ‘XRRScreenConfiguration’ was not declared in this scope
../../src/SFML/Window/Linux/VideoModeImpl.cpp:130: error: ‘config’ was not declared in this scope
../../src/SFML/Window/Linux/VideoModeImpl.cpp:130: error: ‘XRRGetScreenInfo’ was not declared in this scope
../../src/SFML/Window/Linux/VideoModeImpl.cpp:134: error: ‘Rotation’ was not declared in this scope
../../src/SFML/Window/Linux/VideoModeImpl.cpp:134: error: expected ‘;’ before ‘currentRotation’
../../src/SFML/Window/Linux/VideoModeImpl.cpp:135: error: ‘currentRotation’ was not declared in this scope
../../src/SFML/Window/Linux/VideoModeImpl.cpp:135: error: ‘XRRConfigCurrentConfiguration’ was not declared in this scope
../../src/SFML/Window/Linux/VideoModeImpl.cpp:139: error: ‘XRRScreenSize’ was not declared in this scope
../../src/SFML/Window/Linux/VideoModeImpl.cpp:139: error: ‘sizes’ was not declared in this scope
../../src/SFML/Window/Linux/VideoModeImpl.cpp:139: error: ‘XRRConfigSizes’ was not declared in this scope
../../src/SFML/Window/Linux/VideoModeImpl.cpp:144: error: ‘XRRFreeScreenConfigInfo’ was not declared in this scope
make[2]: *** [../../src/SFML/Window/Linux/VideoModeImpl.o] Error 1
make[2]: Leaving directory `/home/adam/src/sfml2/build/make'
make[1]: *** [window] Error 2
make[1]: Leaving directory `/home/adam/src/sfml2/build/make'
make: *** [sfml] Error 2


I get a few errors but I type sudo make install anyway and this is what I get
Code: [Select]

cd ./build/make && make install
make[1]: Entering directory `/home/adam/src/sfml2/build/make'
mkdir -p /usr/local/lib
mkdir -p /usr/local/include
mkdir -p /usr/local/lib/debug//usr/local/lib
cp -r ../../include/SFML/ /usr/local/include/
find /usr/local/include/SFML -name .svn -type d -print0 | xargs -0 /bin/rm -rf
make install -f Makefile.system
make[2]: Entering directory `/home/adam/src/sfml2/build/make'
objcopy --only-keep-debug ../../lib/libsfml-system.so.2.0 /usr/local/lib/debug//usr/local/lib/libsfml-system.so.2.0
objcopy --strip-unneeded  ../../lib/libsfml-system.so.2.0 /usr/local/lib/libsfml-system.so.2.0
ln -s -f libsfml-system.so.2.0 /usr/local/lib/libsfml-system.so
make[2]: Leaving directory `/home/adam/src/sfml2/build/make'
make install -f Makefile.window
make[2]: Entering directory `/home/adam/src/sfml2/build/make'
objcopy --only-keep-debug ../../lib/libsfml-window.so.2.0 /usr/local/lib/debug//usr/local/lib/libsfml-window.so.2.0
objcopy: '../../lib/libsfml-window.so.2.0': No such file
make[2]: *** [install] Error 1
make[2]: Leaving directory `/home/adam/src/sfml2/build/make'
make[1]: *** [install] Error 2
make[1]: Leaving directory `/home/adam/src/sfml2/build/make'
make: *** [install] Error 2


Please help this is really frustrating.

7
General / [Solved]Help with sfml on linux mint
« on: May 09, 2010, 04:50:24 am »
While I could not get sfml vs 1.6, 1.7, or 2.0 to work, when I installed sfml 1.5 through the linux mint package manager it works just fine.  Thank you for you help anyway.

8
General / [Solved]Help with sfml on linux mint
« on: May 09, 2010, 12:48:37 am »
I cant paste them there, because I dont have permision. Why is that I am the administrator?

9
General / [Solved]Help with sfml on linux mint
« on: May 08, 2010, 10:06:28 pm »
These are the steps I took to make my project

1)open code::blocks

2)Settings->Compiler and Debugger->
2a)Search Directories->Compiler->Add my sfml include folder
2b)Search Directories->Linker->Add my sfml lib folder

3)Create a new console project

4)Settings->Compiler and Debugger->Linker Settings->Other Linker options->there I wrote -lsfml-system

5)Then I wrote the first tutorial code

Code: [Select]

#include <SFML/System.hpp>
#include <iostream>

int main()
{
    sf::Clock Clock;
    while (Clock.GetElapsedTime() < 5.f)
    {
        std::cout << Clock.GetElapsedTime() << std::endl;
        sf::Sleep(0.5f);
    }

    return 0;
}


6) Press f9 and it gives me an error

Error while loading shared libraries: libsfml-system.so.1.6: cannot open shared object file: no such file in directory

Is there any way to resolve this?

10
General / [Solved]Help with sfml on linux mint
« on: May 08, 2010, 09:51:33 pm »
Um, on the installation guide for code::blocks on the main site it said to drag the system.dll and all other dlls to the project/bin folder.  If that is not what I am supposed to do can you please tell me how to set up my project so that sfml works with code::blocks?

11
General / [Solved]Help with sfml on linux mint
« on: May 08, 2010, 09:20:55 pm »
Hey guys, I recently installed linux mint and code blocks. I followed the steps to set up sfml with code blocks, and everything went well untill I tried to build/run the code.  It said that it could not find system.dll, however I do not know where I can get that file.  Inside of the sfml package for linux, the lib folder contained files that ended in .so, and when I tried to copy and paste them into my project folder, as other posts suggested, but it still did not work.  Can someone help me out, am I doing something wronge? Thank you in advance.

Pages: [1]