symbols not found for architecture x86_64 (Mac)

Hi,

Im trying to build a simple occ example on a mac, I have built and installed occ
I have linked the libraries to the inc files
Im getting this error:

Building target: lib10may
Invoking: MacOS X C++ Linker
g++ -m64 -D_OCC64 -L/usr/local/Qt-5.0.2/lib -L/Users/stephenneander/Desktop/occt6/ros/adm/cmake/build/out/lib -dynamiclib -o "lib10may" ./src/10may.o
Undefined symbols for architecture x86_64:
"TopLoc_Location::TopLoc_Location()", referenced from:
TopoDS_Shape::TopoDS_Shape()in 10may.o
"Handle_Standard_Transient::EndScope()", referenced from:
Handle_Standard_Transient::~Handle_Standard_Transient()in 10may.o
"TopLoc_SListOfItemLocation::Clear()", referenced from:
TopLoc_SListOfItemLocation::~TopLoc_SListOfItemLocation()in 10may.o
ld: symbol(s) not found for architecture x86_64
collect2: ld returned 1 exit status

The dylibs are
Mach-O 64-bit dynamically linked shared library x86_64
The computer is :
i5 64 bit Mac

This is what im using in my configuring, and there are no errors in make and install:

3RDPARTY_FREETYPE_DLL */usr/local/lib/libfreetype.dylib
3RDPARTY_FREETYPE_INCLUDE_DIR */opt/local/include
3RDPARTY_FREETYPE_LIBRARY */usr/local/lib/libfreetype.dylib
3RDPARTY_TCL_DLL */System/Library/Tcl/8.5
3RDPARTY_TCL_INCLUDE_DIR */opt/local/include
3RDPARTY_TCL_LIBRARY */System/Library/Tcl/8.5
3RDPARTY_DIR /usr/local/lib
3RDPARTY_USE_FREEIMAGE OFF
3RDPARTY_USE_GL2PS OFF
3RDPARTY_USE_GLX OFF
3RDPARTY_USE_TBB OFF
BUILD_ApplicationFramework ON
BUILD_BITNESS 64
BUILD_DataExchange ON
BUILD_Draw ON
BUILD_FoundationClasses ON
BUILD_ModelingAlgorithms ON
BUILD_ModelingData ON
BUILD_TOOLKITS
BUILD_TYPE Release
BUILD_Visualization ON
CMAKE_OSX_ARCHITECTURES x86_64
CMAKE_OSX_DEPLOYMENT_TARGET
CMAKE_OSX_SYSROOT
INSTALL_DIR /Users/stephenneander/occt2
INSTALL_FREETYPE OFF
INSTALL_TCL OFF

I would love any help

Thanks

Daniel Park's picture

its very strange,
i can compile and run qt on its own and i can also compile and run occ, just when i run examples/qt/common it produces this error

Daniel Park's picture

its very strange,
i can compile and run qt on its own and i can also compile and run occ, just when i run examples/qt/common it produces this error

Daniel Park's picture

I have fixed this issue

Deniz Eren's picture

Hi Daniel,

This is most likely because there are some libraries missing, so you're getting these linker problems.

I use Ubuntu and Mac OS X, here is a simple one line/one file compilation command as an example of each:

Ubuntu:
g++ test.cxx -I../install/inc -DHAVE_IOMANIP -DHAVE_LIMITS_H -DHAVE_IOSTREAM -lTKGeomBase -lTKernel -lTKMath -lTKTopAlgo -lTKBRep -lTKPrim -lTKFillet -o test

Mac OS X:
g++ test.cxx -I../build/inc -L../build/lib -DHAVE_IOMANIP -DHAVE_LIMITS_H -DHAVE_IOSTREAM -lTKGeomBase -lTKernel -lTKMath -lTKTopAlgo -lTKBRep -lTKPrim -lTKFillet -o test

Best regards,
Deniz