[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: Problems in compiling a static binary
On 03-Feb-2000 Andrea Pintori wrote:
> Hi,
>
> I have to compile a static binary.
> If the program is something like:
>
> ---------------------------------
>#include <stdio.h>
> void main()
> {
> printf("bye\n");
> }
> ---------------------------------
>
> with "g++ dummy.cpp -static" I have no problems.. but the program I
> have to compile uses libraries such as "vga.h", "vgagl.h" and
> when I try to compile it with something like
> "g++ dummy.cpp -lvga -lvgagl -static"
>
-l is for dynamic linking. try
g++ dummy.cpp -o dummy /usr/lib/libvga.a /usr/lib/libvgagl.a -static
> I receive a lot of error messages:
>
> /usr/lib/libvga.a(vga.o): In function `__svgalib_open_devconsole':
> vga.o(.text+0x5d7): undefined reference to `_IO_stdin_'
> vga.o(.text+0x5e1): undefined reference to `_IO_stdout_'
> vga.o(.text+0x5eb): undefined reference to `_IO_stderr_'
> vga.o(.text+0x631): undefined reference to `_IO_stderr_'
> vga.o(.text+0x644): undefined reference to `_IO_stderr_'
> /usr/lib/libvga.a(vga.o): In function `__svgalib_getchipset':
> vga.o(.text+0xe06): undefined reference to `_IO_stderr_'
> /usr/lib/libvga.a(vga.o): In function `__svgalib_read_options':
> vga.o(.text+0x331b): undefined reference to `_IO_stderr_'
> /usr/lib/libvga.a(vga.o)(.text+0x33e7): more undefined references to
> `_IO_stderr_' follow
> /usr/lib/libvga.a(vgamisc.o): In function `vga_getkey':
> vgamisc.o(.text+0x50a): undefined reference to `_IO_stdin_'
> vgamisc.o(.text+0x57e): undefined reference to `_IO_stdin_'
>
> and much more!
> does anybody can help me?
>
> thanks,
> Andrea
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: linuxgames-unsubscribe@sunsite.auc.dk
> For additional commands, e-mail: linuxgames-help@sunsite.auc.dk
-Erik <erik@smluc.org> [http://math.smsu.edu/~br0ke]
The opinions expressed by me are not necessarily opinions. In all
probability, they are random rambling, and to be ignored. Failure to ignore
may result in severe boredom or confusion. Shake well before opening. Keep
Refrigerated.