Observations and Issues Noticed:
When CMakeLists.txt has "target_link_libraries(linkErr ${PCL_LIBRARIES})" the code works fine.
When that line is replaced with "target_link_libraries(linkErr ${PCL_LIBRARIES} gtsam)" the code gets the runtime error.
To help with debugging, additional observations are provided as a comment at the end of src/linkErr.cpp file.