Hello everyone,
I'd like to create a Xcode project to develop some code in C++ depending on Fenics, but I'm finding some difficulties in the linker phase. What I've done right now is this:
- use the hyperelasticity demo to take a look at the command line
- create a Xcode project
- create a script to generate a dummy dylib with all prerequisites
- link the hyperelasticity demo with the dummy
However, it won't link. It seems as the dummy library won't "pull" the other shared objects. The details of the steps above are below.
Can you help me with this?
Thanks!
hyperelasticity demo
/usr/bin/g++ -DBOOST_UBLAS_NDEBUG [...] -std=c++11 -Wno-deprecated -O2 -g -DNDEBUG -isystem /Applications/FEniCS.app/Contents/Resources/include [...] -o CMakeFiles/demo_hyperelasticity.dir/main.cpp.o -c /Users/sensei/Public/hyperelasticity/cpp/main.cpp
/usr/bin/g++ -std=c++11 -Wno-deprecated -O2 -g -DNDEBUG -Wl,-search_paths_first -Wl,-headerpad_max_install_names CMakeFiles/demo_hyperelasticity.dir/main.cpp.o -o demo_hyperelasticity /Applications/FEniCS.app/Contents/Resources/lib/libdolfin.1.5.0.dylib /usr/lib/libxml2.dylib [...] /Applications/FEniCS.app/Contents/Resources/lib/vtk-5.10/libvtksys.5.10.1.dylib -lobjc -lm
dummy library creation
clang++ -dynamiclib -o libfenics_dummy.dylib /Applications/FEniCS.app/Contents/Resources/lib/libdolfin.1.5.0.dylib /usr/lib/libxml2.dylib /Applications/FEniCS.app/Contents/Resources/lib/libboost_filesystem.dylib /Applications/FEniCS.app/Contents/Resources/lib/libboost_program_options.dylib [...] /Applications/FEniCS.app/Contents/Resources/lib/vtk-5.10/libvtksys.5.10.1.dylib -lobjc -lm
linker error
Undefined symbols for architecture x86_64:
"dolfin::Expression::Expression(unsigned long)", referenced from:
Rotation::Rotation() in main.o
Clamp::Clamp() in main.o
"dolfin::Expression::~Expression()", referenced from:
Clamp::~Clamp() in main.o
Rotation::~Rotation() in main.o
"dolfin::Parameters::Parameters(dolfin::Parameters const&)", referenced from:
_main in main.o
"dolfin::Parameters::~Parameters()", referenced from:
[...]
"typeinfo for dolfin::SubDomain", referenced from:
typeinfo for Right in main.o
typeinfo for Left in main.o
"VTT for dolfin::GenericMatrix", referenced from:
dolfin::GenericMatrix::~GenericMatrix() in main.o
"_ompi_mpi_comm_self", referenced from:
dolfin::uBLASMatrix<boost::numeric::ublas::compressed_matrix<double, boost::numeric::ublas::basic_row_major<unsigned long, long>, 0ul, boost::numeric::ublas::unbounded_array<unsigned long, std::__1::allocator<unsigned long> >, boost::numeric::ublas::unbounded_array<double, std::__1::allocator<double> > > >::mpi_comm() const in main.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)