|
|
On 4/16/24 05:52 TwoTrees Innerworld wrote:
OK, partial joy.
I installed all the updates and fltk-1.4.x
The test program runs and displays fonts correctly and with
different point sizes.
Good, you made progress.
The new problem is that now my Netbeans project won't
successfully build anymore.
The modules seem to compile fine, but I get a ton of what I
believe are linker errors.
It starts like this...
g++ -I/usr/local/include -L/usr/local/lib -lwiringPi -o
dist/Debug/GNU-Linux/fltk build/Debug/GNU-Linux/a_to_d.o
build/Debug/GNU-Linux/distance.o
build/Debug/GNU-Linux/getdisljump.o
build/Debug/GNU-Linux/getdisnew.o build/Debug/GNU-Linux/kbhit.o
build/Debug/GNU-Linux/main.o build/Debug/GNU-Linux/menu.o
build/Debug/GNU-Linux/parallel.o build/Debug/GNU-Linux/serial.o
-L/usr/local/lib -Wl,-rpath,'/usr/local/lib' -lfltk -lfltk_forms
-lfltk_images -lpthread -ldl -lm -lX11 -lwiringPi -lXext
-lstdc++
Note: above is your buld /linker commandline. You are obviously
linking in three FLTK libs: '-lfltk -lfltk_forms -lfltk_images'. See
below...
[...]
Fl_Xlib_Graphics_Driver_font_xft.cxx:(.text._ZN23Fl_Xlib_Graphics_Driver9set_fontsEPKc+0x1c):
undefined reference to `FcInit'
/usr/bin/ld:
Fl_Xlib_Graphics_Driver_font_xft.cxx:(.text._ZN23Fl_Xlib_Graphics_Driver9set_fontsEPKc+0x2c):
undefined reference to `FcPatternCreate'
/usr/bin/ld:
Fl_Xlib_Graphics_Driver_font_xft.cxx:(.text._ZN23Fl_Xlib_Graphics_Driver9set_fontsEPKc+0x40):
undefined reference to `FcObjectSetBuild'
/usr/bin/ld:
Fl_Xlib_Graphics_Driver_font_xft.cxx:(.text._ZN23Fl_Xlib_Graphics_Driver9set_fontsEPKc+0x54):
undefined reference to `FcFontList'
[...]
The lines above show undefined references, i.e. a missing library.
As Mohammed wrote: you need to add the fontconfig library to your
linker commandline or any linker options in netbeans. Either the
full string "-lfontconfig" or only the library name 'fontconfig' -
wherever you added the FLTK libs and maybe other libs in Netbeans. I
don't know where this may be, something like linker options or
additional link libraries etc.
Do you know what happened? Did something move?
Not sure, we need some more info.
Most important: did you run `sudo make install` after your FLTK
build completed? The default would be to *install* the built
libraries and header files in '/usr/local' where your Netbeans
project expects them: '-I/usr/local/include -L/usr/local/lib' etc..
If you did not, then please do it now - otherwise your Netbeans
project would have to be changed to refer to the FLTK build
directory which is possible but more complicated for now. If you did
run `sudo make install` then you can skip this.
Next step: adding the fontconfig library to your build command may
or may not resolve all issues, there may well be more libs required.
If it works you're done, if not, continue:
That's what `fltk-config` is good for: a "simple" approach is to
build a working FLTK test program with fltk-config, like this:
$ flltk-config --use-images --use-forms
--compile /path/to/fltk/test/hello.cxx
Replace /path/to/fltk with the path
to your FLTK source files. Note that I added '--use-images
--use-forms' so you link with the same FLTK libs as your
Netbeans project.
This command outputs the full compile and linker command to build
the hello demo. Look for any libs that are missing from your
Netbeans linker command, and add them as well, maybe step by step,
until your build works.
Another - shorter - command would have been:
$ flltk-config --use-images --use-forms
--ldstaticflags
which outputs only the required linker flags. On my Raspi I get, for
instance (but please use your output!):
-lfltk_images -lpng -lz -lfltk_jpeg
-lfltk_forms -lfltk -lXrender -lXft -lfontconfig -pthread
-lpthread -ldl -lm -lX11
Once you added all required libs to your Netbeans project this
should work as well.
Thanks again for all the help!
You're welcome.
--
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 fltkgeneral+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/fltkgeneral/b89eb1c2-1b65-4df6-b95e-d63b0e1cfe25%40aljus.de.
[ Direct Link to Message ] | |
|
| |