Thanks all for discussion. a The problem was fixed by adding "-shared" to target_link_libraries. a target_link_libraries(shared ${LINK_LIBRARIES} -shared) Anton