* Building binary from code in C++...
@ 2007-11-20 10:14 Maciej
2007-11-21 7:06 ` Jim Marshall
0 siblings, 1 reply; 2+ messages in thread
From: Maciej @ 2007-11-20 10:14 UTC (permalink / raw)
To: gcc-help
Hello!
I have started work with GCC 4.1.2 under Mandriva 2007.1. I have noticed, the compiler is very good. For compilation I am using g++ command. When I am using programs with my system everything is ok, but under older systems there is a problem. I have found in manual -static option, but when I am using it, program have about 1,2MB (it is small program for console without GUI). I have tested work of generated binaries and now I know, binaries prepared under 2.6 Kernel with -static option will not work under 2.4 Kernel.
What is the best solution for building small programs possible to run in console of old and the future Linux systems? Is compilation under target system the only way to do it?
Best Regards!
Maciej
----------------------------------------------------------------------
Chcesz zobaczyc jak mieszkaja inni? Podpatrzec pomysly,
pochwalic sie wlasnym mieszkaniem?
Wejdz na >>> http://link.interia.pl/f1c74
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: Building binary from code in C++...
2007-11-20 10:14 Building binary from code in C++ Maciej
@ 2007-11-21 7:06 ` Jim Marshall
0 siblings, 0 replies; 2+ messages in thread
From: Jim Marshall @ 2007-11-21 7:06 UTC (permalink / raw)
To: gcc-help
Maciej wrote:
> Hello!
>
> I have started work with GCC 4.1.2 under Mandriva 2007.1. I have noticed, the compiler is very good. For compilation
> I am using g++ command. When I am using programs with my system everything is ok, but under older systems there is a
> problem. I have found in manual -static option, but when I am using it, program have about 1,2MB (it is small program
> for console without GUI). I have tested work of generated binaries and now I know, binaries prepared under 2.6 Kernel
> with -static option will not work under 2.4 Kernel.
>
> What is the best solution for building small programs possible to run in console of old and the future Linux systems?
>Is compilation under target system the only way to do it?
Most systems provide future compatibility (e.g. if it works on OSVer 1.x
it will work on OSVer 2.x), but not the reverse. This is due to changes
in the interfaces - in your case the Kernel has changed, so even
including the libraries as static libs doesn't work because the backend
ABI has changed.
The only real solution would be to build on the "lowest common
denominator", e.g. build it on your old system and move the application
to the new systems.
>
> Best Regards!
>
> Maciej
>
>
> ----------------------------------------------------------------------
> Chcesz zobaczyc jak mieszkaja inni? Podpatrzec pomysly,
> pochwalic sie wlasnym mieszkaniem?
> Wejdz na >>> http://link.interia.pl/f1c74
>
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2007-11-21 4:20 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-11-20 10:14 Building binary from code in C++ Maciej
2007-11-21 7:06 ` Jim Marshall
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).