Ask a Question related to UNIX Programming, Design and Development.
-
Paul Pluzhnikov #1
Re: (Mandrake 9.1) Library headache - two questions
Nils Emil P. Larsen <ne@it.dk> writes:
It is *exceedingly* difficult, to build "backwards compatible"> My first question is: How do I get gcc to compile my application so it
> can run on my server with glibc 2.2 (upgrading the server is NOT an
> option).
executables. AFAIK, you only have 2 options:
o Downgrade the development machine
o Install a complete glibc-2.2 "cross-compilation" environment
[install glibc-2.2 and all of its header files under
e.g. /usr/glibc-2.2 and point your -I and -L there]
What's the error message?> I'm having another problem too. I use a library called COMEDILIB to
> interface the measurement and control ISA-board in the server.
> With Mdk 8.2, I used this command to compile my application:
>
> gcc -o <program> <object files> -lcomedi -lm
> ^^^^
> it dosen't work anymore (in Mdk 9.1) and I have to
If the library is in /usr/lib, you should not need to do that.> My second question is why I have to type the full path to the library?
Does /usr/lib/libcomedi.so also exist?
Cheers,
--
In order to understand recursion you must first understand recursion.
Paul Pluzhnikov Guest
-
Bit of a headache
Hi all, I have found this bit of javascript to validate a users form input, but the problem is that it does it in steps - ie it will check the... -
Impersonation headache
I have been fighting with impersonation for quite sometime now and now matter what I have tried it just won't work. I am trying to get... -
Regex headache
I am having a regex nightmare and can't see the wood for the trees. I want to extract data from an HTML file. I have been using the file() command... -
Web Service headache
Hi there, I am working on a web service, which was going fine until this morning. Both it and my test client app (a simple web app) are running... -
~/Library/ vs ~/System/Library vs /User/Library/
In article <110720031327074895%justin.c@se.net>, justin <justin.c@se.net> wrote: First off, you're a little bit confused. ~ means your home... -
Paul Pluzhnikov #2
Re: (Mandrake 9.1) Library headache - two questions
Nils Emil P. Larsen <ne@it.dk> writes:
Yes.>> >It is *exceedingly* difficult, to build "backwards compatible"
> >executables. AFAIK, you only have 2 options:
> >
> >o Downgrade the development machine
> You mean switching back to Mdk 8.2 - this is of course an opportunity,
How so? None of the UNIX-like OSes I know support compiling your> but is also a major defeat for Linux...
program on a later release, and running it on an earlier one...
Yes, that is the exceedingly difficult part.>> >o Install a complete glibc-2.2 "cross-compilation" environment
> > [install glibc-2.2 and all of its header files under
> > e.g. /usr/glibc-2.2 and point your -I and -L there]
> This dosn't sound impossible, but I haven't got a good grasp of the
> details. Is this what you call exceedingly difficult (or was that a
> third option)?
Yes, that should be no problem.> BTW can I compile glibc-2.2 with glibc-2.3 on my Mdk 9.1
> distribution??
Configure it with --prefix=/usr/glibc-2.2
That is the difficult part. You will discover that it is more> When glibc-2.2 is installed under /usr/glibc-2.2, what do I then have
> to do to compile my app.? It is just
> gcc -o <program> <objectfiles> -I/usr/glibc-2.2 -L/usr/glibc-2.2
> or will gcc still link to glibc-2.3 ?
difficult than just:
gcc -c -I/usr/glibc-2.2/include <source>.c
gcc -o <program> <objectfiles> -L/usr/glibc-2.2/lib
because there are also startup files (crt0.o, etc.) and dynamic linker
/lib/ld-linux.so.2 to worry about. Start with adding '-v' option to the
command line above, and study the output carefully.
You will probably have to link with -nostdlib -nostartup and
explicitly specify everything.
Also note, that glibc header files include linux *kernel* headers, so
you may have to install a "backward" copy of these as well (assuming
MDK9.1 and MDK8.2 do not ship with the exact same kernel version).
Hmm, that is strange -- if libcomedi.si defines comedi_open().>> >> gcc -o <program> <object files> -lcomedi -lm
> comedi_calibrate(.text+0xcb): )In function 'main':
> undefined reference to 'comedi_open'
> (repeated a lot of times for library functions)
You aren't just supplying full path. You are also selecting *archive*>> >Does /usr/lib/libcomedi.so also exist?
> Yes it does. The strange this it that it works perfectly when I type
> the full path instead of supplying the -lcomedi option!!
version of libcomedi, instead of the shared version that is selected
by -lcomedi. I bet this:
gcc -o ... /usr/lib/libcomedi.so -lm
will also fail with the same error. But I do not know why it fails.
What is the output from
nm -D /usr/lib/libcomedi.so | grep comedi_open
ldd /usr/lib/libcomedi.so
Cheers,
--
In order to understand recursion you must first understand recursion.
Paul Pluzhnikov Guest
-
Oleg Goldshmidt #3
Re: (Mandrake 9.1) Library headache - two questions
Paul Pluzhnikov <ppluzhnikov@earthlink.net> writes:
It is not trivial, but I would not characterize it as "exceedingly> Nils Emil P. Larsen <ne@it.dk> writes:
>>> > My first question is: How do I get gcc to compile my application so it
> > can run on my server with glibc 2.2 (upgrading the server is NOT an
> > option).
> It is *exceedingly* difficult, to build "backwards compatible"
> executables. AFAIK, you only have 2 options:
>
> o Downgrade the development machine
> o Install a complete glibc-2.2 "cross-compilation" environment
> [install glibc-2.2 and all of its header files under
> e.g. /usr/glibc-2.2 and point your -I and -L there]
difficult".
Read the gcc cross-compilation documentation (e.g. info), install the
cross-compiler and binutils (linker, assembly) as described there,
grab the libraries you need to link from the server (all that is
described in the cross-compilation docs), and go ahead.
It is *not trivial*, just to emphasize the point again, but it is
certainly doable.
--
Oleg Goldshmidt | [email]pub@NOSPAM.goldshmidt.org[/email]
Oleg Goldshmidt Guest
-
Nils Emil P. Larsen #4
Re: (Mandrake 9.1) Library headache - two questions
Hello
Just to round off I have found a different approach to my problem.
Since it's to difficult to set up a linux with glibc 3.3 to compile
for a linux with glibc 3.2, I now do this:
On a seperate partition I've installed a 3.2 system to compile on. It
would be very annoying to reboot each time I need to compile, so I
type this in a terminal:
chroot /mnt/linextra /bin/bash
This starts a bash-session with my 3.2 system as root directory.
This way I can compile my 3.2 binaries without rebooting and without
having too much headache !
Thank you for your help !
Nils Emil P. Larsen
Nils Emil P. Larsen Guest



Reply With Quote

