udvlpr / alembic

Automatically exported from code.google.com/p/alembic
Other
0 stars 0 forks source link

Linux Build Issues When Using alembic in own project #267

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
I'm getting a lot of linker error using Qt / qmake. The project works under mac 
fine but under linux I'm getting the following errors (g++ 4.4.3 ubuntu 10.4 
lts )

g++ -Wl,-rpath,/opt/QtSDK/Desktop/Qt/474/gcc/lib -o ABCView obj/main.o 
obj/MainWindow.o obj/GLWindow.o obj/moc_MainWindow.o obj/moc_GLWindow.o    
-L/opt/QtSDK/Desktop/Qt/474/gcc/lib -L/usr/X11R6/lib -L/usr/local/lib 
-L//home/jmacey/NGL/lib -l NGL -L/usr/local/alembic-1.0.3/lib/static/ 
-L/usr/local/hdf5-1.8.5-patch1/lib/ -lAlembicAbc -lAlembicAbcGeom 
-lAlembicAbcCoreAbstract -lAlembicUtil -lAlembicAbcCoreHDF5 -lImath -lHalf 
-lIex -lhdf5 -lhdf5_hl -lz -lboost_thread -lboost_program_options -lGLEW 
-lQtXml -lQtOpenGL -lQtGui -lQtCore -lGLU -lGL -lpthread 
/usr/local/alembic-1.0.3/lib/static//libAlembicAbcCoreHDF5.a(ArImpl.cpp.o): In 
function `Alembic::AbcCoreHDF5::v1::ArImpl::ArImpl(std::basic_string<char, 
std::char_traits<char>, std::allocator<char> > const&, 
boost::shared_ptr<Alembic::AbcCoreAbstract::v1::ReadArraySampleCache>)':
ArImpl.cpp:(.text+0xbf0): undefined reference to 
`Alembic::AbcCoreAbstract::v1::ArchiveReader::~ArchiveReader()'
/usr/local/alembic-1.0.3/lib/static//libAlembicAbcCoreHDF5.a(ArImpl.cpp.o): In 
function `Alembic::AbcCoreHDF5::v1::ArImpl::ArImpl(std::basic_string<char, 
std::char_traits<char>, std::allocator<char> > const&, 
boost::shared_ptr<Alembic::AbcCoreAbstract::v1::ReadArraySampleCache>)':
ArImpl.cpp:(.text+0x1190): undefined reference to 
`Alembic::AbcCoreAbstract::v1::ArchiveReader::~ArchiveReader()'
/usr/local/alembic-1.0.3/lib/static//libAlembicAbcCoreHDF5.a(ArImpl.cpp.o): In 
function `Alembic::AbcCoreHDF5::v1::ArImpl::~ArImpl()':
ArImpl.cpp:(.text+0x1902): undefined reference to 
`Alembic::AbcCoreAbstract::v1::ArchiveReader::~ArchiveReader()'
ArImpl.cpp:(.text+0x198f): undefined reference to 
`Alembic::AbcCoreAbstract::v1::ArchiveReader::~ArchiveReader()'
/usr/local/alembic-1.0.3/lib/static//libAlembicAbcCoreHDF5.a(ArImpl.cpp.o): In 
function `Alembic::AbcCoreHDF5::v1::ArImpl::~ArImpl()': 
ArImpl.cpp:(.text+0x1da2): undefined reference to 
`Alembic::AbcCoreAbstract::v1::ArchiveReader::~ArchiveReader()'
/usr/local/alembic-1.0.3/lib/static//libAlembicAbcCoreHDF5.a(ArImpl.cpp.o):ArImp
l.cpp:(.text+0x1e27): more undefined references to 
`Alembic::AbcCoreAbstract::v1::ArchiveReader::~ArchiveReader()' follow

There are lots of other linker problems most of which seem to be for the dtors 
what am I missing as I presume it's some sort of g++ flag to do with virtual 
methods etc? 

I've attached a full output of the error messages

cheers

Jon

Original issue reported on code.google.com by jpmace...@gmail.com on 20 Dec 2011 at 9:15

Attachments:

GoogleCodeExporter commented 8 years ago
I've actually fixed it now, seems I needed to add both the .a files and 
-llAlembicAbc etc not sure why this is the case under linux and not Mac OSX but 
I presume it's something to do with g++ / qmake. The solution in the qt project 
file is as follows incase anyone else has these issues

ALEMBIC_DIR=/usr/local/alembic-1.0.3/
linux-g++-64:HDF5_DIR=/usr/local/hdf5-1.8.5-patch1/
INCLUDEPATH+=/usr/include/OpenEXR
INCLUDEPATH+=/usr/local/include/OpenEXR

INCLUDEPATH+=$$ALEMBIC_DIR/include

LIBS+= -L$$ALEMBIC_DIR/lib/static/
LIBS+=-L$$HDF5_DIR/lib/
LIBS+= -lAlembicAbc
LIBS+=-lAlembicAbcGeom
LIBS+=-lAlembicAbcCoreAbstract
LIBS+=-lAlembicUtil
LIBS+=-lAlembicAbcCoreHDF5
LIBS+= -lhdf5
LIBS+=-lhdf5_hl
LIBS+=-lImath
LIBS+=-lHalf
LIBS+=-lIex

# not sure why but need this for the linux builds
linux-g++-64:LIBS+=$$ALEMBIC_DIR/lib/static/libAlembicAbcCoreHDF5.a
linux-g++-64:LIBS+=$$ALEMBIC_DIR/lib/static/libAlembicAbcCoreAbstract.a
linux-g++-64:LIBS+=$$ALEMBIC_DIR/lib/static/libAlembicUtil.a
linux-g++-64:LIBS+=$$HDF5_DIR/lib/libhdf5.a
linux-g++-64:LIBS+=$$HDF5_DIR/lib/libhdf5_hl.a

Original comment by jpmace...@gmail.com on 22 Dec 2011 at 12:35

GoogleCodeExporter commented 8 years ago

Original comment by miller.lucas on 25 Jun 2012 at 6:34