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

Author Topic: Problem compiling project in CodeLite  (Read 2993 times)

0 Members and 2 Guests are viewing this topic.

Sneaky

  • Newbie
  • *
  • Posts: 3
    • View Profile
    • Email
Problem compiling project in CodeLite
« on: September 19, 2015, 02:36:06 pm »
I'm building a game with SFML on Windows but I also want it to run on Linux, so I followed this guide here:

http://en.sfml-dev.org/forums/index.php?topic=18820.0

The problem is when I compile it I get an error:

./SFML-Test: error while loading shared libraries: libsfml-graphics.so.2.3: cannot open object file: No such file or directory

But I have that file, so I don't understand why it can't find it. I searched Google and none of the answers were of any help. I've checked my linker and compiler settings multiple times so I really have no idea why it doesn't work. Any help would be really appreciated.

FRex

  • Hero Member
  • *****
  • Posts: 1848
  • Back to C++ gamedev with SFML in May 2023
    • View Profile
    • Email
Re: Problem compiling project in CodeLite
« Reply #1 on: September 19, 2015, 04:08:36 pm »
Check if it's listed on 'ldconfig -p'. If it's not try running 'ldconfig' as root.
Back to C++ gamedev with SFML in May 2023

Sneaky

  • Newbie
  • *
  • Posts: 3
    • View Profile
    • Email
Re: Problem compiling project in CodeLite
« Reply #2 on: September 19, 2015, 04:23:27 pm »
Check if it's listed on 'ldconfig -p'. If it's not try running 'ldconfig' as root.

I did that, couldn't find it listed when I ran ldconfig -p so I used the ldconfig command but I still get the same error.

FRex

  • Hero Member
  • *****
  • Posts: 1848
  • Back to C++ gamedev with SFML in May 2023
    • View Profile
    • Email
Re: Problem compiling project in CodeLite
« Reply #3 on: September 19, 2015, 06:15:33 pm »
Are you sure you have ran make install and have the so files in /usr/local/lib or similar?
Back to C++ gamedev with SFML in May 2023

Spirro

  • Jr. Member
  • **
  • Posts: 66
    • View Profile
Re: Problem compiling project in CodeLite
« Reply #4 on: September 19, 2015, 07:16:59 pm »
Following this guide for linux, http://www.sfml-dev.org/tutorials/2.3/start-linux.php, is what you need to do.  Compiling and installing with cmake on linux installs SFML to /usr/local in a couple of directories.  Do this
Quote
export LD_LIBRARY_PATH=<sfml-install-path>/lib && ./sfml-app
as per the above tutorial and you should be fixed.  Change ./sfml-app to your app name.

Jesper Juhl

  • Hero Member
  • *****
  • Posts: 1405
    • View Profile
    • Email
Re: Problem compiling project in CodeLite
« Reply #5 on: September 19, 2015, 08:26:02 pm »
In the long run, adding the install location to ld.so.conf and running ldconfig once and for all is simpler.
Or set the correct rpath in the app when you build it.

Spirro

  • Jr. Member
  • **
  • Posts: 66
    • View Profile
Re: Problem compiling project in CodeLite
« Reply #6 on: September 19, 2015, 08:27:23 pm »
In the long run, adding the install location to ld.so.conf and running ldconfig once and for all is simpler.
Or set the correct rpath in the app when you build it.

I agree, but had I posted that Laurent would have chimed in saying that is bad so I did the temporary method :)

Sneaky

  • Newbie
  • *
  • Posts: 3
    • View Profile
    • Email
Re: Problem compiling project in CodeLite
« Reply #7 on: September 19, 2015, 08:46:25 pm »
Following this guide for linux, http://www.sfml-dev.org/tutorials/2.3/start-linux.php, is what you need to do.  Compiling and installing with cmake on linux installs SFML to /usr/local in a couple of directories.  Do this
Quote
export LD_LIBRARY_PATH=<sfml-install-path>/lib && ./sfml-app
as per the above tutorial and you should be fixed.  Change ./sfml-app to your app name.

Thanks, got it working using this. Also had to switch my VM software from Virtualbox to VMWare, Virtualbox had problems with OpenGL.

 

anything