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

T

tekmicha

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.
 
V

Vladimir S. Oka

tekmicha said:
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`).
 
L

lostpencil

tekmicha said:
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.:)
 
T

tekmicha

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
 
V

Vladimir S. Oka

tekmicha said:
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.
 
M

Mark McIntyre

. 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
 
D

David Resnick

tekmicha said:
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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,901
Latest member
Noble71S45

Latest Threads

Top