jbeder / yaml-cpp

A YAML parser and emitter in C++
MIT License
4.91k stars 1.77k forks source link

YAML::Scanner needs to have dll-interface to be used by clients of class YAML::Parser #1268

Closed vkasapu1289 closed 5 months ago

vkasapu1289 commented 5 months ago

Linked yaml-cpp as per instructions given, it is working fine for linux but got this warning in windows build and this warning is treated as error. What is the best way to link yaml-cpp in our projects to work in linux and windows

jbeder commented 5 months ago

Ask on Stack Overflow?

vkasapu1289 commented 5 months ago

Yes I got one solution like add a cmake option that allow export all symbols in windows, I tried that but not useful

jbeder commented 5 months ago

OK, if you have a PR, happy to look at it.

vkasapu1289 commented 5 months ago

# YAML-CPP include(FetchContent) FetchContent_Declare(yaml-cpp GIT_REPOSITORY https://github.com/jbeder/yaml-cpp.git GIT_TAG 9eb1142900096b9115ba2db2a521c76c117cacd9) # The latest yaml-cpp commit at the time of writing. FetchContent_GetProperties(yaml-cpp) if(NOT yaml-cpp_POPULATED) message(STATUS "Fetching yaml-cpp...") FetchContent_Populate(yaml-cpp) add_subdirectory(${yaml-cpp_SOURCE_DIR} ${yaml-cpp_BINARY_DIR}) endif()

vkasapu1289 commented 5 months ago

after that I am linking to my target by target_link_libraries()