Error occurs when compile the ToVTK4 source code

Hello everyone,
I want to compile the ToVTK4 source code, but a error without reference about vtk and xml files always occurs. Here is part of the script:
daye@daye-Inspiron-7577:~/DualSPHysics/DualSPHysics_v4.0_Linux_x64/For_Learn/SOURCE/ToVtk4/source_check$ make all
g++ -std=c++11 -c -O3 main.cpp
g++ -std=c++11 -c -O3 Functions.cpp
g++ -std=c++11 -c -O3 JBinaryData.cpp
g++ -std=c++11 -c -O3 JCfgRun.cpp
g++ -std=c++11 -c -O3 JException.cpp
g++ -std=c++11 -c -O3 JObject.cpp
g++ -std=c++11 -c -O3 JPartDataBi4.cpp
g++ -std=c++11 -c -O3 JRangeFilter.cpp
g++ -std=c++11 -c -O3 JSpaceCtes.cpp
g++ -std=c++11 -c -O3 JSpaceEParms.cpp
g++ -std=c++11 -c -O3 JSpaceParts.cpp
g++ -std=c++11 -c -O3 JSpaceProperties.cpp
g++ -std=c++11 main.o Functions.o JBinaryData.o JCfgRun.o JException.o JObject.o JPartDataBi4.o JRangeFilter.o JSpaceCtes.o JSpaceEParms.o JSpaceParts.o JSpaceProperties.o -o tovtk -L ./ -ljxml_64 -ljcreatevtk_64
main.o: In function `RunFiles(JCfgRun const*)':
main.cpp:(.text+0x518): undefined reference to `JXml::LoadFile(std::__cxx11::basic_string, std::allocator > const&)'
main.cpp:(.text+0x1ce2): undefined reference to `JCreateVtk::SaveVtk(std::__cxx11::basic_string, std::allocator >, unsigned int, tfloat3 const*, unsigned int, JCreateVtk::StScalarData const*)'
main.cpp:(.text+0x1dd1): undefined reference to `JCreateVtk::SaveCsv(std::__cxx11::basic_string, std::allocator >, unsigned int, tfloat3 const*, unsigned int, JCreateVtk::StScalarData const*)'
JSpaceCtes.o: In function `JSpaceCtes::ReadXmlElementAuto(JXml*, TiXmlElement*, bool, std::__cxx11::basic_string, std::allocator >, double&, bool&)':
JSpaceCtes.cpp:(.text+0xa32): undefined reference to `JXml::GetFirstElement(TiXmlNode const*, std::__cxx11::basic_string, std::allocator > const&, bool) const'
......
Looking forward for your help!
Daye

Comments

  • Hi,

    in order to use recent GCC versions, you should edit the Makefile and change the variable USE_GCC5=NO to USE_GCC5=YES , then do a make clean and make.

    You can also use cmake:
    mkdir build
    cd build
    cmake ..
    make
    Best regards,
    Orlando.
  • I got it! Thank you very much!
Sign In or Register to comment.