[vtkusers] C++ VTK app on OSX
Sandor Heman
saanti at xs4all.nl
Sun Sep 29 18:52:17 EDT 2002
Hi,
I'm new to both VTK and Mac OS X and recently compiled VTK (withous other
language bindings) successfully.
But now when I try to build the simple sphere example from the VTK website
(under "examples") I get the following error after I type "make":
>>>
c++ -O2 -Wall -I/usr/local/vtk -I/usr/src/VTK/Contrib -I/usr/src/VTK/Common
-I/usr/src/VTK/Graphics -I/usr/src/VTK/Imaging -I/usr/src/VTK/Rendering
-I/usr/src/VTK/Filtering -I/usr/src/VTK/Patented -c sphere.cxx -o sphere.o
c++ sphere.o -L/usr/local/vtk/bin -lVTKImaging -lVTKGraphics -lVTKRendering
-lVTKFiltering -lVTKCommon -lpthread -o sphere
ld: /usr/lib/crt1.o illegal reference to symbol: __objcInit defined in
indirectly referenced dynamic library /usr/lib/libobjc.A.dylib
make: *** [sphere] Error 1
>>>
I am using gcc 3.1 with the following Makefile (sources are in /usr/src/VTK
and build dir is /usr/local/vtk) :
>>>
.SUFFIXES: .cxx
# Specify the name of the program you want created on this line:
TARGET = sphere
# Specify the objects that make up your program in this line:
OBJECTS = sphere.o
${TARGET}: ${OBJECTS}
# Compiler and linker definitions for the different libraries we need:
# The Visualization Toolkit (Vtk):
#
VTK_HOME = /usr/src/VTK
VTK_INC = -I/usr/local/vtk \
-I${VTK_HOME}/Contrib \
-I${VTK_HOME}/Common \
-I${VTK_HOME}/Graphics \
-I${VTK_HOME}/Imaging \
-I${VTK_HOME}/Rendering \
-I${VTK_HOME}/Filtering \
-I${VTK_HOME}/Patented
VTK_LIB = -L/usr/local/vtk/bin
VTK_LIBS = ${VTK_LIB} -lVTKImaging -lVTKGraphics -lVTKRendering
-lVTKFiltering -lVTKCommon -lpt
hread
# Compiler and linker flags:
CXX = c++
DEFINES =
INCLUDES = ${VTK_INC}
LDFLAGS = ${VTK_LIBS}
CXX_FLAGS = -O2 -Wall ${DEFINES} ${INCLUDES}
# Automatic generator rules:
.cxx.o:
${CXX} ${CXX_FLAGS} -c $< -o $@
.o:
$(CXX) $^ ${LDFLAGS} -o $*
# Other targets:
clean:
$(RM) ${OBJECTS} $(TARGET)
>>>
If anybody knows how to solve this problem and what I am doing wrong that
help would be really appreciated.
Thanks in advance
Sandor
More information about the vtkusers
mailing list