Closed xugaoyi1 closed 2 years ago
Hello @xugaoyi1
I think you should use "target_link_libraries" in CMake in order to link your target against bfd and dl libraries, so please try:
target_link_libraries(<your_target> dl bfd)
in your CMakeLists.txt
Let me know if that helps.
Hello @TomaszAugustyn. after use target_link_libraries(
No problem, glad it works.
Hello Tomasz, when I use this program in my program it occur one thing , it seems difficult to define in CMakeLists.txt that guarantee every source file complied with dynamic link bfd, like define in Makefile $(CXX) $(CXXFLAGS) -o $@ $^ -ldl -lbfd. In CMakeLists.txt it can be set CMAKE_CXX_FLAGS but the variant always before source file, but it need link of bfd after the target file. when define in CMakeLists.txt do you have any suggestions ? thanks in advance.