Reputation: 535
I compiled the same program (not library) with different compilation flags, in CMake with Clang
But I noticed that the second way doesn't seem to work. I can't find the exported symbols. I'm so surprised that only the 1st way works. I don't know if the C compilers do something tricky, or Clang, or CMake. But how to let the second way work? The first way would print a lot of warnings.
Upvotes: 2
Views: 6394
Reputation: 5135
Provide same options for second variant.
set(CMAKE_EXE_LINKER_FLAGS "-Wl,-export-dynamic")
Because compiler and linker the same in your case.
Upvotes: 5