How to install libgraph-1.0.2/graphics.h on FW33?

Hello,
I have followed the instructions here:
https://www.quora.com/How-can-I-install-the-graphics-h-header-file-on-Fedora-22

but in step 7. after “make” command I have recieved following errors:

Makefile:934: warning: overriding recipe for target 'libgraph.pc'
Makefile:409: warning: ignoring old recipe for target 'libgraph.pc'
make  all-recursive
make[1]: Entering directory '/home/zdenek/libgraph-1.0.2'
Makefile:934: warning: overriding recipe for target 'libgraph.pc'
Makefile:409: warning: ignoring old recipe for target 'libgraph.pc'
Making all in doc
make[2]: Entering directory '/home/zdenek/libgraph-1.0.2/doc'
Making all in man
make[3]: Entering directory '/home/zdenek/libgraph-1.0.2/doc/man'
make[3]: Nothing to be done for 'all'.
make[3]: Leaving directory '/home/zdenek/libgraph-1.0.2/doc/man'
make[3]: Entering directory '/home/zdenek/libgraph-1.0.2/doc'
make[3]: Nothing to be done for 'all-am'.
make[3]: Leaving directory '/home/zdenek/libgraph-1.0.2/doc'
make[2]: Leaving directory '/home/zdenek/libgraph-1.0.2/doc'
make[2]: Entering directory '/home/zdenek/libgraph-1.0.2'
Makefile:934: warning: overriding recipe for target 'libgraph.pc'
Makefile:409: warning: ignoring old recipe for target 'libgraph.pc'
/bin/sh ./libtool --mode=link gcc -g -O2 -I/usr/include/SDL -D_GNU_SOURCE=1 -D_REENTRANT -DFONTDIR=\""/usr/local/share/libgraph/Font/"\" -g -O2 -I/usr/include/SDL -D_GNU_SOURCE=1 -D_REENTRANT   -o libgraph.la -rpath /usr/local/lib -version-info 1:2:0 -export-dynamic libgraph.lo text.lo shapes.lo polygon.lo  -lm -lSDL_image -lSDL -lpthread 
gcc -shared  .libs/libgraph.o .libs/text.o .libs/shapes.o .libs/polygon.o  -lm -lSDL_image -lSDL -lpthread  -Wl,-soname -Wl,libgraph.so.1 -o .libs/libgraph.so.1.0.2
/usr/bin/ld: .libs/text.o:/home/zdenek/libgraph-1.0.2/grtext.h:77: multiple definition of `InternalFont'; .libs/libgraph.o:/home/zdenek/libgraph-1.0.2/grtext.h:77: first defined here
/usr/bin/ld: .libs/text.o:/home/zdenek/libgraph-1.0.2/grtext.h:87: multiple definition of `TP'; .libs/libgraph.o:/home/zdenek/libgraph-1.0.2/grtext.h:87: first defined here
/usr/bin/ld: .libs/shapes.o:/home/zdenek/libgraph-1.0.2/shapes.h:121: multiple definition of `_internal_linestyle'; .libs/libgraph.o:/home/zdenek/libgraph-1.0.2/shapes.h:121: first defined here
/usr/bin/ld: .libs/shapes.o:/home/zdenek/libgraph-1.0.2/shapes.h:115: multiple definition of `_last_arc'; .libs/libgraph.o:/home/zdenek/libgraph-1.0.2/shapes.h:115: first defined here
/usr/bin/ld: .libs/polygon.o:/home/zdenek/libgraph-1.0.2/polygon.h:42: multiple definition of `_scanlist'; .libs/libgraph.o:/home/zdenek/libgraph-1.0.2/polygon.h:42: first defined here
collect2: error: ld returned 1 exit status
make[2]: *** [Makefile:377: libgraph.la] Error 1
make[2]: Leaving directory '/home/zdenek/libgraph-1.0.2'
make[1]: *** [Makefile:552: all-recursive] Error 1
make[1]: Leaving directory '/home/zdenek/libgraph-1.0.2'
make: *** [Makefile:268: all] Error 2

Please can anyone help?
Thanks for support!
Neo75

1 Like

The error doesn’t have anything to do with graphics.h; why do you think you need that and what is it you’re really trying to do?

Thank you for reply.
libgraph is an implementation of the TurboC graphics API (graphics. h) using SDL. I have some old programs to run with it.

On my different computer with latest Linux Mint 20.1 I did the same procedure and received no errors and the library works perfect.
But under Fedora I got those errors mentioned above.

Thank you for any help!

The bug is in libgraph; it defines a symbol multiple times. Maybe the linker is stricter in Fedora, or maybe libgraph configures incorrectly, but it’s not directly a Fedora bug. You should try reporting this to the libgraph authors.

@qulogic thank you. I can try it. Anyway, it is a little bit outdated library, I am not sure, if it is still maintained.

@qulogic so finely I found a different solution, which works under Fedora 33. I have downloaded here http://libxbgi.sourceforge.net/ the RPM file of library “SDL_bgi”.

Compiled it with this option:
gcc filename.c -o filename -lSDL_bgi

This solution works. Only one issue I found was the speed. When I have tested it on the same hardware, the “SDL_bgi” is much slower than “libgraph”, but anyway it does not belong to this forum.

1 Like

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.