C app with all dependencies

This is a discussion on C app with all dependencies within the C Programming forums, part of the General Programming Boards category; Hello everyone, I have wrote a small gtk+ C app and would like to be able to compile it with ...

  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 wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,485
    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.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

  3. #3
    Registered User
    Join Date
    Jun 2005
    Posts
    6,247
    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 wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,485
    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.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

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, 06: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, 03:53 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21