> praveen wrote:
> > I got many undefined reference errors starting from undefined reference to
> > `Fl::visual(int)'. May i know how to solve this errors?
>
>       Sounds like you're not linking in libfltk.a.
>
>       Try looking at the basic flags FLTK wants you to link with by running:
>
>               fltk-config --ldflags
>
>       ..and if your program is making use of opengl, then look at:
>
>               fltk-config --ldflags --use-gl
>
>       For more info on compile/link flags see 'fltk-config -help',
>       and the link Duncan mentioned:
>       http://www.fltk.org/doc-1.1/basics.html#basics
>       ..in particular the 'Compiling Programs with Standard Compilers' 
> section.

I am not compiling single program as to compile with fltk-config --use-gl 
--compile test.cpp . I'm compiling three programs together, creating object 
files and linking three object files together to get an executable. may i know 
how to compile multiple files using fltk-config?

I'm using a makefile to compile which is below :
CC       = icc
CXX      = icc
LINK = icc
DEBUG = -c -g
# DEBUG =
#
# # CFLAGS   = -Wall -g
# # CXXFLAGS = -Wall -g
# INCPATH  = -I/usr/local/include -I/usr/X11R6/include
# # LIBS     = -L/usr/X11R6/lib -L/usr/local/lib -L/usr/local/lib/libfltk.a 
-lXext -lX11 -lm -lsupc++

 CFLAGS = -I/usr/X11R6/include
 CXXFLAGS=  -I/usr/X11R6/include
 LDFLAGS= -L/usr/X11R6/lib
 LDLIBS= -lm  -lXext -lX11 -lsupc++
 GLLIBS= -lGLU -lGL
 IMAGELIBS= -ljpeg -lpng -lz
 LIBNAME=/usr/local/fltk/include/lib/libfltk.a 
/usr/local/fltk/include/lib/libfltk_gl.a
 LDSTATIC = $(LDFLAGS) $(LIBNAME) $(GLLIBS) $(IMAGELIBS) $(LDLIBS)

# RM = rm -f
 FLSRC = /usr/local/fltk/include/FL
 TARGET   = cube
 OBJECTS = \
            CubeMain.o  \
            CubeView.o  \
            CubeViewUI.o

#
#
 SOURCES = CubeMain.cxx  \
            CubeView.cxx  \
            CubeViewUI.cxx

%.o: %.cxx
#       $(CXX) $(CXXFLAGS) $(INCPATH) $@ $<
#       $(CXX) $(CXXFLAGS) $(DEBUG) $(TARGET) -o $(TARGET) $<
        $(CXX) $(CXXFLAGS) $(DEBUG) $<
all: $(TARGET)


$(TARGET):  $(OBJECTS)
        $(LINK) -o $(TARGET) $(OBJECTS) $(LDSTATIC)

CubeMain.o: $(FLSRC)/Fl.H CubeMain.cxx CubeViewUI.h
CubeView.o: CubeView.cxx CubeView.h CubeViewUI.h
CubeViewUI.o: $(FLSRC)/Fl.H $(FLSRC)/Fl_Window.H CubeViewUI.cxx CubeView.h



_______________________________________________
fltk mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk

Reply via email to