Jump to content

  • Log In with Google      Sign In   
  • Create Account

Wonder Boy

Member Since 18 Jun 2012
Offline Last Active Mar 18 2013 11:42 AM

Posts I've Made

In Topic: How to delete an account

18 March 2013 - 11:12 AM

OK, understood. Thank you.


In Topic: How to delete an account

17 March 2013 - 03:35 PM

@Cornstalks: thanks


In Topic: How to delete an account

17 March 2013 - 03:30 PM

Contacted support. Why this have to be so painful?


In Topic: [SOLVED] My game doesn't detect libpng in its directory (game packaging)

21 June 2012 - 07:29 PM

Solution:
I have to include '-rpath' flag with a specified directory in the command above so the directory will be searched at the runtime.

For example:
search the same dir as executable dir: -Wl,-rpath,.
search "libs" directory inside directory where is located executable: -Wl,-rpath,libs/

So now my command looks like this:
g++ *.cpp -I/my_include_dir/ -L/my_lib_dir/ -lSDL_image -lSDL_ttf -lSDL_mixer -lSDL -lpthread -ldl -lfreetype -lz -Wl,-rpath,. -o build/tictactoe32 -m32


Useful commands:
Check which libraries will be loaded by the executable at runtime:
ldd <binary>
Check which directories will be searched for libraries:
readelf -d <binary> | grep RPATH

Sources:
http://tldp.org/HOWTO/Program-Library-HOWTO/shared-libraries.html
http://www.eyrie.org/~eagle/notes/rpath.html
http://www.techytalk.info/c-cplusplus-library-programming-on-linux-part-one-static-libraries/ (3 parts)
in terminal: man ld

In Topic: [SOLVED] My game doesn't detect libpng in its directory (game packaging)

21 June 2012 - 07:34 AM

Hi, thanks for the answer.
I don't use libpng directly in my code, it is loaded by SDL_image at runtime, when needed to load different kinds of images (png in this case). I use only SDL_image.

PARTNERS