Thread: C app with all dependencies

  1. #1
    Registered User
    Join Date
    Apr 2007
    Location
    Florida
    Posts
    45

    C app with all dependencies

    Hello everyone,
    I have wrote a small gtk+ C app and would like to be able to compile it with all the libs and dependencies built in. In python you can do this with Freeze. Is there a way to include all the libs like with LDFLAGS or someother gcc option?Sorry if this should be in Linux Programming forum.
    Thanks in advance.
    Brad

  2. #2
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,659
    I think all you should need to do is change all the .so libs you link with into .a files.
    Well that's the theory anyway.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

  3. #3
    Registered User
    Join Date
    Jun 2005
    Posts
    6,815
    IIRC, the appropriate linker option is -Bstatic

  4. #4
    Registered User
    Join Date
    Apr 2007
    Location
    Florida
    Posts
    45
    so link them with LDFLAGS or gcc -Wall -o app -llibssl.a ????
    Where can I find info on -Bstatic?
    Thanks for the responses.

  5. #5
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,659
    The linker manual pages.
    http://www.gnu.org/software/binutils...-2.9.1/ld.html

    I'm guessing your LD... variables are in a makefile right?
    There's probably a similar variable for the libraries as well as the flags.


    There's no problem with you experimenting on the command line with lots of different link commands (via gcc) to find out what works.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. non-MFC DLL with MFC app question.
    By Kempelen in forum Windows Programming
    Replies: 10
    Last Post: 08-20-2008, 07:11 AM
  2. best program to start
    By gooddevil in forum Networking/Device Communication
    Replies: 4
    Last Post: 05-28-2004, 05:56 PM
  3. Need help migrating console app to windows app
    By DelphiGuy in forum C++ Programming
    Replies: 1
    Last Post: 03-14-2004, 07:05 PM
  4. pasword app
    By GanglyLamb in forum C Programming
    Replies: 2
    Last Post: 06-07-2003, 10:28 AM
  5. How do I make my Linux app standalone?
    By Joda in forum C++ Programming
    Replies: 2
    Last Post: 11-27-2002, 04:53 AM