[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Problems in compiling a static binary



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"

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