On 10/3/21 2:08 PM Charalampos Rempas
I got FLTK from the final commit on master (git clone https://...)
and I tried to build it on Manjaro linux. I use the following
configuration settings: `./configure --disable-gl
--disable-xinerama --enable-shared`. Then I built the library with
`make -j8` and there was no shared libraries to be found.
For historical reasons the shared libraries are built in the 'src'
folder if you're using configure/make. IMHO a bad choice, but that's
how it is.
I can also confirm that by the fact that when a program and then
try to run it, I'm getting the following error message: "error
while loading shared libraries: libfltk.so.1.4: cannot open shared
object file: No such file or directory".
Sure, the shared libs are not in a known directory of your system.
You have (at least) these choices:
(1) use `[sudo] make install` to install in the default system
directory '/usr/local' (not recommended for several reasons)
(2) configure with `--prefix=/path/to/location` and the use `make
install` to install to that location
(3) use CMake to build which will build all libraries (static and
shared) in the '/path/to/build/lib' folder
No matter what you choose, you will likely need to set up your
environment to find the libraries when linking and running your
Please note also that we recommend building static FLTK libraries
(only) and link your program(s) with the static libs. This is easier
and more portable (you don't need to deploy/install the shared libs
with your program).
thing I'm discovered is that I'm not able to compile with "cc"
("gcc" in my case) but only with "c++". In the official docs in the basics section, It shows
that I should have been able to compile with "gcc" but when I'm
trying to do that, I'm getting the following error: "/usr/bin/ld:
/tmp/ccelgt6s.o: undefined reference to symbol
/usr/bin/ld: /usr/lib/libstdc++.so.6: error adding symbols: DSO
missing from command line
collect2: error: ld returned 1 exit status" which from what I
understand means that the C++ standard library should also be
linked. Any ideas?
The examples using 'CC' or 'gcc' are only that: examples. I admit
that using 'c++', 'g++', 'clang++' in these examples would have been
a better choice, but this part of the docs is very old and not
updated frequently. That said, yes, you need a C++ compiler to build
Note that the following paragraphs describe how to use `fltk-config`
to find out which command line and arguments your system needs. This
tool has been configured by the `configure` command and "knows" what
you need to build FLTK programs on your particular system. This will
also help you to find out how you link with libstdc++.
You received this message because you are subscribed to the Google Groups "fltk.general" group.
To unsubscribe from this group and stop receiving emails from it, send an email to firstname.lastname@example.org.
To view this discussion on the web visit https://groups.google.com/d/msgid/fltkgeneral/1a164ebc-216b-860a-49c9-839511431d83%40online.de.
[ Direct Link to Message ]