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

Author Topic: Problems compiling an release SFML2 application on linux  (Read 2143 times)

0 Members and 1 Guest are viewing this topic.

aNewHobby

  • Jr. Member
  • **
  • Posts: 85
    • View Profile
    • Live 4 Ever Or Die Trying
Problems compiling an release SFML2 application on linux
« on: July 04, 2012, 01:35:24 am »
Hi I am trying to compile on linux, (ubuntu) but I am having a problem with static linking. I would like to static link as there isn't a sfml2 pack out people can easily install. Everything compiles fine normally, but if I add the -s to the linker then it all goes haywire.

log - http://ctrlv.it/id/MzAwMzky



Maybe static isn't the way to go? But if I remove the -s and the #define it will now compile fine and even play, like in code::blocks when i press the build/run button... the application runs... but then if i go to the file itself.. as in the one I would post and send to people to use, it will not run?


Twitter: @Jyinkies
My Own Little Spot on the Net: - Live4everOrDieTrying.info (Blog)

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: Problems compiling an release SFML2 application on linux
« Reply #1 on: July 04, 2012, 07:58:46 am »
If you link SFML statically, you must link all its dependencies too.

But you can simply provide the SFML libraries with your application.
Laurent Gomila - SFML developer

aNewHobby

  • Jr. Member
  • **
  • Posts: 85
    • View Profile
    • Live 4 Ever Or Die Trying
Re: Problems compiling an release SFML2 application on linux
« Reply #2 on: July 04, 2012, 04:00:20 pm »
But you can simply provide the SFML libraries with your application.

ok.. how would I "include" the binaries.. I have tried copying the files into the same dir as the executable. but no luck... can you explain what you mean?
Twitter: @Jyinkies
My Own Little Spot on the Net: - Live4everOrDieTrying.info (Blog)

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: Problems compiling an release SFML2 application on linux
« Reply #3 on: July 04, 2012, 04:07:28 pm »
By default, "." (the current directory) is not known by the library loader, so it can't find the SFML libraries if you just copy them there -- unlike what happens on Windows.

You have to add "." to the library loader's paths before launching your executable.

export LD_LIBRARY_PATH=.
./my_program

You should search more information about this, I'm not an expert :)
Laurent Gomila - SFML developer

aNewHobby

  • Jr. Member
  • **
  • Posts: 85
    • View Profile
    • Live 4 Ever Or Die Trying
Re: Problems compiling an release SFML2 application on linux
« Reply #4 on: July 05, 2012, 03:47:25 am »
still a bit shaky on this but I "think" it runs....

ArkBreker-Linux

You may need to run the .sh file... if you can not then sudo chmod +x ArkBreaker.sh first
Twitter: @Jyinkies
My Own Little Spot on the Net: - Live4everOrDieTrying.info (Blog)