run a C program independently without requiring to install an external library

Discussion in 'C Programming' started by tekmicha, Mar 24, 2006.

  1. tekmicha

    tekmicha Guest

    Hallo,
    I am a newbie in C and I have a question regarding C libraries.
    I got an application in C and I am trying to add some new features on
    it for my work. The problem is this application requires the
    installation of an external Library A (not a C standard library). After
    some time I managed to install the external libraries using the
    makefiles and running the application (a makefile was also included)
    My question is , is there anyway to run my application independently
    without the need to install the external library, by just copying the
    source and the header files (they are just four files), I mean do I
    need the .so files as well??
    If yes what is the best way to do and what changes do I have propably
    to do to keep minimal changes on the application?
    Sorry for my naive question.
     
    tekmicha, Mar 24, 2006
    #1
    1. Advertising

  2. tekmicha wrote:
    > Hallo,
    > I am a newbie in C and I have a question regarding C libraries.
    > I got an application in C and I am trying to add some new features on
    > it for my work. The problem is this application requires the
    > installation of an external Library A (not a C standard library). After
    > some time I managed to install the external libraries using the
    > makefiles and running the application (a makefile was also included)
    > My question is , is there anyway to run my application independently
    > without the need to install the external library, by just copying the
    > source and the header files (they are just four files), I mean do I
    > need the .so files as well??
    > If yes what is the best way to do and what changes do I have propably
    > to do to keep minimal changes on the application?
    > Sorry for my naive question.


    Not really a C question, but from what you say I can't see that you can
    avoid installing this "external" library. It most likely contains some
    functions/data used by your program. The only other option, IMHO, would
    be to write your own replacement.

    In any case, you may also want to ask this in some Linux group (you
    mention `.so`).

    --
    BR, Vladimir
     
    Vladimir S. Oka, Mar 24, 2006
    #2
    1. Advertising

  3. tekmicha

    lostpencil Guest

    tekmicha wrote:
    > Hallo,
    > I am a newbie in C and I have a question regarding C libraries.
    > I got an application in C and I am trying to add some new features on
    > it for my work. The problem is this application requires the
    > installation of an external Library A (not a C standard library). After
    > some time I managed to install the external libraries using the
    > makefiles and running the application (a makefile was also included)
    > My question is , is there anyway to run my application independently
    > without the need to install the external library, by just copying the
    > source and the header files (they are just four files), I mean do I
    > need the .so files as well??
    > If yes what is the best way to do and what changes do I have propably
    > to do to keep minimal changes on the application?
    > Sorry for my naive question.


    Maybe you could asked the writer of the libraries send the only code
    you needed to you.:)
     
    lostpencil, Mar 24, 2006
    #3
  4. tekmicha

    tekmicha Guest

    Well sorry , I didnt want to post a specific OS question , I admit I
    was a newbie in posting in this group as well:). I mailed him . I have
    all the source codes and the header files of the library , so my naive
    thought was may be to just include these header files on the include
    directory and correct the problems but propably I have still to rebuild
    again the libraries so I will not get out of it. I am just trying to
    copy al the files including the libraries to the application and
    changing may be the path into a local application directory , so that
    I will not have to install this messy library on each machine of the
    network.
    Thanks anyway
     
    tekmicha, Mar 24, 2006
    #4
  5. tekmicha wrote:
    > Well sorry , I didnt want to post a specific OS question , I admit I
    > was a newbie in posting in this group as well:). I mailed him . I have
    > all the source codes and the header files of the library , so my naive
    > thought was may be to just include these header files on the include
    > directory and correct the problems but propably I have still to rebuild
    > again the libraries so I will not get out of it. I am just trying to
    > copy al the files including the libraries to the application and
    > changing may be the path into a local application directory , so that
    > I will not have to install this messy library on each machine of the
    > network.
    > Thanks anyway


    If you don't quote any context nobody knows what you're on about. Read:

    <http://cfaj.freeshell.org/google/>

    before posting again.

    Assuming "him" was me (even if you did quote context, refering to
    someone in third person is bad manners, at least where I come from),
    mailing is not what you'd normally do (even disregarding the fact that
    most people do not leave real e-mail addresses). I'll have a look at
    your e-mail some time, and post whatever's relevant, if anything.

    --
    BR, Vladimir
     
    Vladimir S. Oka, Mar 24, 2006
    #5
  6. On 24 Mar 2006 06:29:44 -0800, in comp.lang.c , "tekmicha"
    <> wrote:

    >. I have
    >all the source codes and the header files of the library , so my naive
    >thought was may be to just include these header files on the include
    >directory and correct the problems


    If you have the LIBRARY sources too, then you can avoid using the
    library - just include the sources in your compile/link process.
    Mark McIntyre
    --
    "Debugging is twice as hard as writing the code in the first place.
    Therefore, if you write the code as cleverly as possible, you are,
    by definition, not smart enough to debug it."
    --Brian Kernighan
     
    Mark McIntyre, Mar 24, 2006
    #6
  7. tekmicha wrote:
    > Well sorry , I didnt want to post a specific OS question , I admit I
    > was a newbie in posting in this group as well:). I mailed him . I have
    > all the source codes and the header files of the library , so my naive
    > thought was may be to just include these header files on the include
    > directory and correct the problems but propably I have still to rebuild
    > again the libraries so I will not get out of it. I am just trying to
    > copy al the files including the libraries to the application and
    > changing may be the path into a local application directory , so that
    > I will not have to install this messy library on each machine of the
    > network.
    > Thanks anyway


    <OT>You may be able to trivially build the library as an archive (.a)
    rather than a shared object (.so) and statically rather than
    dynamically link it to your app. That may be the answer to
    your problems as you won't have to then install the library
    separately from your app. Not always the right choice,
    but... If you have questions about it, asking in
    comp.unix.programmer is the right place, not here.
    Followups set there.
    </OT>

    -David
     
    David Resnick, Mar 24, 2006
    #7
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    0
    Views:
    395
  2. Joerg Schuster
    Replies:
    5
    Views:
    319
    Kay Schluehr
    May 25, 2005
  3. Replies:
    0
    Views:
    352
  4. unomystEz
    Replies:
    0
    Views:
    578
    unomystEz
    Nov 19, 2006
  5. Replies:
    6
    Views:
    423
    red floyd
    Apr 12, 2006
Loading...

Share This Page