gnuplot-iostream icon indicating copy to clipboard operation
gnuplot-iostream copied to clipboard

CLion cannot find "gnuplot-iostream"

Open dzhao123 opened this issue 6 years ago • 2 comments

Hi there, I have cloned the gnuplot on mac. But when I am trying to include the gnuplot-iostream file. The system cannot find it. Can you give some hints to solve this problem? Thanks.

dzhao123 avatar Jun 08 '18 19:06 dzhao123

Sorry, I don't know anything about CLion. You probably need to set some option to tell it where to find headers (include files). And once you get it to find gnuplot-iostream, you'll then need to install boost and make sure it can find that.

dstahlke avatar Jun 09 '18 18:06 dstahlke

@dzhao123 If you copy gnuplot-iostream.h into your projects source directory you just have to put it into your CMakeLists.txt.

Just add

find_package(Boost REQUIRED COMPONENTS iostreams system filesystem)
target_include_directories(yourTarget PUBLIC ${CMAKE_CURRENT_SOURCE_DIR} ${Boost_INCLUDE_DIRS})
target_link_libraries(yourTarget PUBLIC ${Boost_LIBRARIES})

${CMAKE_CURRENT_SOURCE_DIR} is to find your local gnuplot-iostream.h and then you have to link against the boost libraries needed for gnuplot-iostream.

LarsHaalck avatar Jul 24 '18 09:07 LarsHaalck