View Issue Details

IDProjectCategoryView StatusLast Update
0002145AssemblyBugpublic2016-04-18 23:25
ReporterPsirus Assigned Toian.rees  
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionfixed 
OSArch Linux 
Summary0002145: 'nullptr' was not declared in this scope
DescriptionI was trying to compile the jriegel/dev-assembly2 branch to evaluate the current state of the assembly module. However, the compilation fails on my machine (Linux 4.0.4, gcc 5.1.0) with the following error:

Scanning dependencies of target FreeCADApp
[ 13%] Building CXX object src/App/CMakeFiles/FreeCADApp.dir/Application.cpp.o
Linking CXX shared library ../../lib/libFreeCADApp.so
[ 14%] Built target FreeCADApp
[ 14%] Building CXX object src/Gui/CMakeFiles/FreeCADGui.dir/Document.cpp.o
In file included from /home/psirus/Code/AUR/freecad/freecad-git/src/freecad/src/Gui/Document.cpp:48:0:
/home/psirus/Code/AUR/freecad/freecad-git/src/freecad/src/Gui/SoObjectSeparator.h:48:47: error: 'nullptr' was not declared in this scope
     SoObjectSeparator(Gui::ViewProvider *vp = nullptr);
                                               ^
src/Gui/CMakeFiles/FreeCADGui.dir/build.make:1170: recipe for target 'src/Gui/CMakeFiles/FreeCADGui.dir/Document.cpp.o' failed
make[2]: *** [src/Gui/CMakeFiles/FreeCADGui.dir/Document.cpp.o] Error 1
CMakeFiles/Makefile2:4129: recipe for target 'src/Gui/CMakeFiles/FreeCADGui.dir/all' failed
make[1]: *** [src/Gui/CMakeFiles/FreeCADGui.dir/all] Error 2
TagsNo tags attached.
FreeCAD Information

Activities

Psirus

2015-06-11 12:06

reporter  

add_c11_flag.patch (596 bytes)   
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 118d65e..f4cfa43 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -52,6 +52,7 @@ if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_COMPILER_IS_CLANGXX)
     include(cMake/ConfigureChecks.cmake)
     configure_file(config.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config.h)
     add_definitions(-DHAVE_CONFIG_H)
+    add_definitions(-std=c++11)
     set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-deprecated -Wno-write-strings")
     INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR})
     # get linker errors as soon as possible and not at runtime e.g. for modules
add_c11_flag.patch (596 bytes)   

Psirus

2015-06-11 12:07

reporter   ~0006198

Last edited: 2015-06-11 12:08

I've read in the forum that the assembly module uses the new C++11 standard, and a corresponding flag needs to be passed to gcc. The patch adds this flag to CMakeLists.txt for the gcc. With it, it compiles on my machine.

ian.rees

2016-04-18 23:25

developer   ~0006989

We're using C++11 in FreeCAD now.

Issue History

Date Modified Username Field Change
2015-06-03 11:40 Psirus New Issue
2015-06-11 12:06 Psirus File Added: add_c11_flag.patch
2015-06-11 12:07 Psirus Note Added: 0006198
2015-06-11 12:08 Psirus Note Edited: 0006198
2016-04-18 23:25 ian.rees Note Added: 0006989
2016-04-18 23:25 ian.rees Status new => closed
2016-04-18 23:25 ian.rees Assigned To => ian.rees
2016-04-18 23:25 ian.rees Resolution open => fixed