On 04/28/14 23:58, Kevin Ingwersen wrote:
> Hey. I am improving the build schemes for my build system. When I compile FLTK now, I get some weird errors. Is this intended or alike?
>
> Ingwie@Ingwies-Air ~/Work/deskshell $ build --view=make --enable-debug
> -- Debug enabled.
>
> g++ -g -DDEBUG [..] -o FLTK/src/Fl_File_Icon2.cxx.o
> FLTK/src/Fl_File_Icon2.cxx:573:33: error: use of undeclared identifier 'xpm'
> printf("Icon File \"%s\":\n", xpm);
-DDEBUG is not something out build system sets when building a debug
version of FLTK is built (e.g. "./configure --enable-debug'),
so your build system for building FLTK probably shouldn't either.
For instance if I build the FLTK source with --enable-debug:
./configure --enable-debug ; sed -ie 's/^.SILENT/#.SILENT/' makeinclude ; make
..which on my system shows the build line for Fl_File_Icont2.cxx as being:
[..snip..]
g++ -I.. -I../png -I../jpeg -g -Wno-deprecated-declarations -Wall -Wunused -Wno-format-y2k -fno-exceptions -fno-strict-aliasing -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_THREAD_SAFE -D_REENTRANT -DFL_LIBRARY -c Fl_File_Icon2.cxx -o Fl_File_Icon2.o
[..snip..]
..note no -DDEBUG is present.
If you're going to build FLTK with custom makefiles, then you should
probably routinely compare the compile lines of your builds to the
regular FLTK './configure; make' output (with .SILENT commented out
in makeinclude, which is what the 'sed' command does in the above)
to make sure your build system and FLTK's are in sync.
I forgot why you're using your own build system to build the FLTK lib
instead of letting FLTK's configure + make build it.
Adding foreign compiler flags like -Dxxx and -std=c++11 can be done
via environment variables like CXXFLAGS:
( export CXXFLAGS="-Wno-c++11-narrowing -Ilibuv/include -Iuvpp [..etc..]"; ./configure --enable-debug; make )
Also, I see you're setting some -I and -D flags that are foreign to FLTK's
code..
Flags like "-Isqlite3", "-ITrololo", etc. seems like it's just asking for
trouble with macro and include file conflicts with fltk's internal macros/includes
if not now, further down the road..
For instance, non-public includes internal to FLTK like those in config.h
could conflict with those other include files that likely have similar
variables (e.g. HAVE_XXX)
Why are flags like -Isqlite3 needed for building FLTK?
Unless you've hacked FLTK source to use e.g. sqllite3, in which case
I'd suggest supplying those flags only to the hacked FLTK files,
not all files to avoid conflicts.