Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simple project doesn't link and examples don't build. #118

Closed
pauljurczak opened this issue Jan 2, 2021 · 1 comment
Closed

Simple project doesn't link and examples don't build. #118

pauljurczak opened this issue Jan 2, 2021 · 1 comment

Comments

@pauljurczak
Copy link

I followed the instructions at https://github.com/alandefreitas/matplotplusplus#build-from-source on Ubuntu 18.04.5 with gcc-10.1.0 for source build. The installation was successful, but when building a test project I'm getting missing linker dependencies:

[build] : && /usr/bin/g++-10 -O3 -DNDEBUG  CMakeFiles/o3d.dir/main.cpp.o -o o3d  -lmatplot && :
[build] //usr/local/lib/libmatplot.a(common.cpp.o): In function `cimg_library::CImg<unsigned char>::_save_png(_IO_FILE*, char const*, unsigned int) const [clone .isra.0]':
[build] common.cpp:(.text+0x79c4): undefined reference to `png_create_write_struct'

Here is my CMakeLists.txt:

cmake_minimum_required(VERSION 3.18)
project(o3d VERSION 0.1.0)
add_executable(o3d main.cpp)
find_package(Matplot++ REQUIRED)
target_link_libraries(o3d matplot)

I tried to build the examples and build/examples was not created:

paul@extra:~/matplotplusplus/build$ cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS="-O2"
CMAKE_MODULE_PATH=/home/paul/matplotplusplus/cmake
CMAKE_INSTALL_PREFIX=/usr/local
CMAKE_INSTALL_LIBDIR=lib
-- Configuring done
-- Generating done
-- Build files have been written to: /home/paul/matplotplusplus/build
paul@extra:~/matplotplusplus/build$ cmake --build . --parallel 2 --config Release
[ 13%] Built target nodesoup
[100%] Built target matplot
paul@extra:~/matplotplusplus/build$ ls
CMakeCache.txt  cmake_install.cmake  CPackSourceConfig.cmake  Makefile                Matplot++ConfigVersion.cmake
CMakeFiles      CPackConfig.cmake    install_manifest.txt     matplot++-config.cmake  source
@pauljurczak
Copy link
Author

I tried again with gcc 9.3.0 and gnuplot built from source instead of Ubuntu 18.04 binary package. This time, I can build sample programs. The only problem I found so far is zoom not working.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant