Find the answer to your Linux question:
Results 1 to 3 of 3
Hi I have an simple question, about C++ sources compilation. How can I make a binary and use compiled binary on all i386 machines and Linux distributions - without compilation? ...
  1. #1
    Just Joined!
    Join Date
    Jun 2006
    Posts
    3

    Art of compiling :-)

    Hi

    I have an simple question, about C++ sources compilation. How can I make a binary and use compiled binary on all i386 machines and Linux distributions - without compilation?

    I want to make my program, copy to CD-ROM, and use on all my linux machines

    What compiler flags and additional parameters I should set to do this?

    Thanks

  2. #2
    Linux User
    Join Date
    Aug 2005
    Location
    Italy
    Posts
    401
    It depends on the binary library dependencies...

    You could start to user the "-static" flag, wich try to link your executable with the static version of each library (.a), if available. In this way the library functions/symbols are included directly in the binary file.

    Of course it's possible to have only shared libraries (.so). In this case you can store all necessary .so file in a subdirectory of CD-Rom, and run your executable with a script, which set the variable LDLIBRARY_PATH to that directory before executing any binary. The system loader, when try to link shared libraries to your executable, will search .so files in the directories listed in the variable LSLIBRARY_PATH.
    When using Windows, have you ever told "Ehi... do your business?"
    Linux user #396597 (http://counter.li.org)

  3. #3
    Just Joined!
    Join Date
    Jun 2006
    Posts
    3
    Thanks a lot

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...