Hi folks,

I am trying to add another include/source directory and subsequent obj to 
dealii for potential future contributions to dealii.  Though I am having 
linking errors because my new obj needs to link agains the lac_obj (need 
Trilinos and other interfaces).  I thought the ADD_DEPENDICIES in the 
source/CMakeLists.txt file is where this is taking care of but apparently not.  
I am following the exact same CMakeLists.txt files as in the other source/dirs 
but I am still getting the undefined symbols error due to object targets not 
apparently linking together.

[ 80%] Linking CXX shared library ../lib/libdealii.dylib
Undefined symbols for architecture x86_64:
  "dealii::PETScWrappers::SparseMatrix::SparseMatrix<int>(int const&, bool)", 
referenced from:
      test::Operator::Operator(int const&) in Operator.cc.o
      test::Operator::Operator(int const&, std::__1::basic_string<char, 
std::__1::char_traits<char>, std::__1::allocator<char> > const&) in 
Operator.cc.o
ld: symbol(s) not found for architecture x86_64

So looks like the obj_lac needs to link with the obj_test and it doesn’t appear 
to be…

Here is my source/Test/CMakeLists.txt file which builds fine:

INCLUDE_DIRECTORIES(BEFORE ${CMAKE_CURRENT_BINARY_DIR})

SET(_src
  Operator.cc
  )

SET(_n_includes_per_unity_file 20)

IF(DEAL_II_UNITY_BUILD)
  LIST(SORT _unity_include_src)
ENDIF()

SETUP_SOURCE_LIST("${_unity_include_src}"
  "${_separate_src}"
  ${_n_includes_per_unity_file}
  _src
  )

FILE(GLOB _header
  ${CMAKE_SOURCE_DIR}/include/test/*.h
  )

DEAL_II_ADD_LIBRARY(obj_test OBJECT ${_src} ${_header})

I didn’t change anything in the souce/CMakeLists.txt file.

-- 
The deal.II project is located at http://www.dealii.org/
For mailing list/forum options, see 
https://groups.google.com/d/forum/dealii?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"deal.II User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to dealii+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/dealii/DE13C37A-F916-4295-AE97-685F856C5291%40gmail.com.

Reply via email to