On 21.03.2018 14:24 Lars Ruoff wrote:
> Thanks a lot!
Welcome.
Please don't top-post, we prefer inline citations and trimming of unused
parts for better readability and context.
> Any ideas for the linker settings?
> Basically, i think i have everything installed now but i don't know what
> library filenames to specify for the linker settings.
> Im using CMake btw.
CMake works but is not fully supported in FLTK 1.3.x. This means that
for instance the generated fltk-config script is not fully functional.
This has recently been improved in FLTK 1.4 development. For FLTK 1.3
you can generate a working one in the source directory with configure.
That said, the linker dependencies vary from system to system and
depending on your configure/CMake choices. Your best option is to use
fltk-config as Ian said (but use the one generated with configure). Run
fltk-config w/o arguments to see options, for instance:
fltk-config --cxxflags --ldflags
This shows the used compiler and linker flags, depending on your build.
Use --use-gl and/or --use-images before --cxxflags/--ldflags if you need
these functionalities.
fltk-config --use-gl --use-images --compile test/hello.cxx
This compiles a simple .cxx file and outputs all compiler and linker
options.
With CMake you can use something like this:
touch <fltk-source-dir>/hello.cxx
make VERBOSE=ON hello
or
ninja -v hello
This will also show all compiler and linker options.
Output with ninja on my system:
$ touch ../../test/hello.cxx
$ ninja -v hello
ninja: warning: multiple rules generate help. builds involving this
target will not be correct; continuing anyway
Ignore this warning, this is fixed in FLTK 1.4
[1/2] /usr/bin/clang++ -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE
-D_LARGEFILE_SOURCE -I. -I../../ -I/usr/include/freetype2
-I/usr/local/hs/contrib/include -I../../test -Itest -Wall -W -pipe
-fmessage-length=0 -fno-rtti -Wcast-align -Wformat=2 -Wpointer-arith
-Wundef -Wno-cast-align -g -Wall -W -Wno-missing-field-initializers
-Wno-deprecated-declarations -Wno-unused-parameter
-Wno-format-nonliteral -Wreorder -D_THREAD_SAFE -D_REENTRANT -MMD -MT
test/CMakeFiles/hello.dir/hello.cxx.o -MF
test/CMakeFiles/hello.dir/hello.cxx.o.d -o
test/CMakeFiles/hello.dir/hello.cxx.o -c ../../test/hello.cxx
[2/2] : && /usr/bin/clang++ -Wall -W -pipe -fmessage-length=0
-fno-rtti -Wcast-align -Wformat=2 -Wpointer-arith -Wundef
-Wno-cast-align -g -pthread test/CMakeFiles/hello.dir/hello.cxx.o -o
bin/examples/hello -rdynamic lib/libfltk.a -ldl -lpthread -lSM -lICE
-lX11 -lXext -lXinerama -lXfixes -lXcursor -lXrender -lXft -lfontconfig && :
I hope this helps.
From your previous post:
> configure says:
> Configuration Summary
> -------------------------------------------------------------------------
[...]
> Graphics: X11
> Image Libraries: JPEG=Builtin
> PNG=Builtin
> ZLIB=Builtin
You may also want to install the "-dev" packages for image libraries and
zlib to speed up building.
libjpeg-dev
libpng12-dev (or libpng16-dev ?)
zlib1g-dev