usnistgov / STP2X3D

Translator from STEP format to X3D format
Other
70 stars 24 forks source link

ERROR in compile STEP_Reader.cpp #18

Open wc188996 opened 2 weeks ago

wc188996 commented 2 weeks ago

I have test the v1.21 on opensuse15.6, the opensuse error is `bogon:/opt/STP2X3D-1.21/build # rpm -aq |grep occt occt-resources-7.7.0-bp155.1.20.noarch occt-DRAWEXE-7.7.0-bp155.1.20.x86_64 occt-devel-7.7.0-bp155.1.20.x86_64 occt-devel-doc-7.7.0-bp155.1.20.noarch bogon:/opt/STP2X3D-1.21/build # gcc -v Using built-in specs. COLLECT_GCC=gcc COLLECT_LTO_WRAPPER=/usr/lib64/gcc/x86_64-suse-linux/7/lto-wrapper OFFLOAD_TARGET_NAMES=hsa:nvptx-none Target: x86_64-suse-linux Configured with: ../configure --prefix=/usr --infodir=/usr/share/info --mandir=/usr/share/man --libdir=/usr/lib64 --libexecdir=/usr/lib64 --enable-languages=c,c++,objc,fortran,obj-c++,ada,go --enable-offload-targets=hsa,nvptx-none, --without-cuda-driver --enable-checking=release --disable-werror --with-gxx-include-dir=/usr/include/c++/7 --enable-ssp --disable-libssp --disable-libvtv --disable-libcc1 --disable-plugin --with-bugurl=https://bugs.opensuse.org/ --with-pkgversion='SUSE Linux' --with-slibdir=/lib64 --with-system-zlib --enable-libstdcxx-allocator=new --disable-libstdcxx-pch --enable-version-specific-runtime-libs --with-gcc-major-version-only --enable-linker-build-id --enable-linux-futex --enable-gnu-indirect-function --program-suffix=-7 --without-system-libunwind --enable-multilib --with-arch-32=x86-64 --with-tune=generic --build=x86_64-suse-linux --host=x86_64-suse-linux Thread model: posix gcc version 7.5.0 (SUSE Linux) bogon:/opt/STP2X3D-1.21/build # cmake --version cmake version 3.20.4

CMake suite maintained and supported by Kitware (kitware.com/cmake).

bogon:/opt/STP2X3D-1.21/build # cmake .. -- The C compiler identification is GNU 7.5.0 -- The CXX compiler identification is GNU 7.5.0 -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Check for working C compiler: /usr/bin/cc - skipped -- Detecting C compile features -- Detecting C compile features - done -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Check for working CXX compiler: /usr/bin/c++ - skipped -- Detecting CXX compile features -- Detecting CXX compile features - done -- Configuring done -- Generating done -- Build files have been written to: /opt/STP2X3D-1.21/build bogon:/opt/STP2X3D-1.21/build # make [ 7%] Building CXX object STP2X3D/CMakeFiles/STP2X3D.dir/Component.cpp.o [ 14%] Building CXX object STP2X3D/CMakeFiles/STP2X3D.dir/IShape.cpp.o [ 21%] Building CXX object STP2X3D/CMakeFiles/STP2X3D.dir/Mesh.cpp.o [ 28%] Building CXX object STP2X3D/CMakeFiles/STP2X3D.dir/Model.cpp.o [ 35%] Building CXX object STP2X3D/CMakeFiles/STP2X3D.dir/OCCUtil.cpp.o [ 42%] Building CXX object STP2X3D/CMakeFiles/STP2X3D.dir/S2X_Option.cpp.o [ 50%] Building CXX object STP2X3D/CMakeFiles/STP2X3D.dir/stdafx.cpp.o [ 57%] Building CXX object STP2X3D/CMakeFiles/STP2X3D.dir/STEP_Data.cpp.o [ 64%] Building CXX object STP2X3D/CMakeFiles/STP2X3D.dir/STEP_Reader.cpp.o /opt/STP2X3D-1.21/STP2X3D/STEP_Reader.cpp: In member function ‘bool STEP_Reader::ReadSTEP(Model*)’: /opt/STP2X3D-1.21/STP2X3D/STEP_Reader.cpp:75:48: error: cannot bind non-const lvalue reference of type ‘TopoDS_Shape&’ to an rvalue of type ‘TopoDS_Shape’ TopoDS_Shape& shape = m_shapeTool->GetShape(label_shape);


make[2]: *** [STP2X3D/CMakeFiles/STP2X3D.dir/build.make:188: STP2X3D/CMakeFiles/STP2X3D.dir/STEP_Reader.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:98: STP2X3D/CMakeFiles/STP2X3D.dir/all] Error 2
make: *** [Makefile:91: all] Error 2
`
How to fix the error ?Help me please ,the same error when compile the v1.20. 
wc188996 commented 2 weeks ago

Change this TopoDS_Shape& shape = m_shapeTool->GetShape(label_shape); to TopoDS_Shape shape = m_shapeTool->GetShape(label_shape); will fix.