Ultimaker / libArcus

Communication library between internal components for Ultimaker software
GNU Lesser General Public License v3.0
75 stars 81 forks source link

error: use of undeclared identifier 'SIP_NULLPTR' #92

Open Atomzdq opened 5 years ago

Atomzdq commented 5 years ago

(Python_3.5.2-PyQt_5.10) zhoudeMacBook-Pro:build zhou$ cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=$VIRTUAL_ENV -DCMAKE_PREFIX_PATH=$VIRTUAL_ENV -DBUILD_STATIC=ON -DBUILD_PYTHON=ON -DBUILD_EXAMPLES=OFF .. -- Configuring done -- Generating done -- Build files have been written to: /Users/zhou/Documents/cura-environment/libArcus-master/build (Python_3.5.2-PyQt_5.10) zhoudeMacBook-Pro:build zhou$ make -j4 [ 35%] Built target Arcus [ 47%] Building CXX object CMakeFiles/python_module_Arcus.dir/python/sipArcuspart1.cpp.o [ 47%] Building CXX object CMakeFiles/python_module_Arcus.dir/python/sipArcuspart2.cpp.o [ 58%] Building CXX object CMakeFiles/python_module_Arcus.dir/python/sipArcuspart3.cpp.o [ 58%] Building CXX object CMakeFiles/python_module_Arcus.dir/python/sipArcuspart0.cpp.o In file included from In file included from In file included from /Users/zhou/Documents/cura-environment/libArcus-master/build/python/sipArcuspart0.cpp/Users/zhou/Documents/cura-environment/libArcus-master/build/python/sipArcuspart3.cpp::1010: : /Users/zhou/Documents/cura-environment/libArcus-master/build/python/sipArcuspart2.cpp:10: In file included from /Users/zhou/Documents/cura-environment/libArcus-master/build/python/sipArcuspart1.cpp:10: /Users/zhou/Documents/cura-environment/libArcus-master/build/python/sipAPIArcus.h/Users/zhou/Documents/cura-environment/libArcus-master/build/python/sipAPIArcus.h::163163::99:: warningwarning: : /Users/zhou/Documents/cura-environment/libArcus-master/build/python/sipAPIArcus.h:163:9: warning: 'sipConvertFromSliceObject' 'sipConvertFromSliceObject' macromacro redefinedredefined [-Wmacro-redefined][-Wmacro-redefined]

/Users/zhou/Documents/cura-environment/libArcus-master/build/python/sipAPIArcus.h:163:9: warning: 'sipConvertFromSliceObject' macro redefined [-Wmacro-redefined] 'sipConvertFromSliceObject' macro redefined [-Wmacro-redefined]

define sipConvertFromSliceObject sipAPI_Arcus->api_convert_from_slice_object#define sipConvertFromSliceObject sipAPI_Arcus->api_convert_from_slice_object#define sipConvertFromSliceObject sipAPI_Arcus->api_convert_from_slice_object

define sipConvertFromSliceObject sipAPI_Arcus->api_convert_from_slice_object

/usr/local/include/sip.h:2021:9: note: previous definition is here /usr/local/include/sip.h#define sipConvertFromSliceObject PySlice_GetIndicesEx: 2021:9 /usr/local/include/sip.h:2021note:: 9:previous definition noteis: hereprevious definition is here

define sipConvertFromSliceObject PySlice_GetIndicesEx

define sipConvertFromSliceObject PySlice_GetIndicesEx

/usr/local/include/sip.h:2021:9: note: previous definition is here

define sipConvertFromSliceObject PySlice_GetIndicesEx

/Users/zhou/Documents/cura-environment/libArcus-master/build/python/sipArcuspart3.cpp:29:9: error: use of undeclared identifier 'SIP_NULLPTR' SIP_NULLPTR,

What I should do to solve this problem?Thanks!

Ghostkeeper commented 5 years ago

SIP_NULLPTR was added to Sip in version 4.19.14. Which version of Sip are you using?

Atomzdq commented 5 years ago

@Ghostkeeper 4.19.14. I figure out that my gcc version is 4.2.1 ,should I update it to the newer one?

Ghostkeeper commented 5 years ago

Oh yeah that could help. We build it using GCC 4.9 on our build server (and I'm using 8.2 in my development environment). As far as I know we've always required version 4.9.2 or higher.

Atomzdq commented 5 years ago

@Ghostkeeper I found that My sip version is 4.19.8. It's up to date from homebrew. What should I do to solve this problem? I update GCC version to GCC5.But this problem still happen.

Ghostkeeper commented 5 years ago

I looked it up, now, and I'm using SIP 4.19.12, but it shouldn't matter much.

I think that your problem is more along the lines of that it's using a different version of SIP to generate the C++ source code than the SIP headers that get linked to that source code. I don't know how to debug that for you though. It needs a lot of rummaging around through CMake.

Fulg commented 5 years ago

For some reason libArcus always uses the global SIP, not the one from the current env. The workaround is to uninstall SIP from Homebrew (because it is outdated!), and install SIP 4.19.14+ from source into the global Python env. I don't know how to fix that from the CMake files.

Ghostkeeper commented 5 years ago

Did you see if you could change the following CMake variables:

NikhilAshodariya commented 5 years ago

Hello,

I tried all the things but none of them worked. Can anyone please suggest a solution. Thank you. Capture

Ghostkeeper commented 4 years ago

I encountered this myself today. The solution was to dig into the CMake parameters (toggle advanced) and make sure that SIP_EXECUTABLE was set to refer to the same Sip version as SIP_INCLUDE_DIR. In my case, both needed to be an older version (4.19.8). The Sip executable then no longer generated source code that contains the SIP_NULLPTR reference which is not present in the headers.

Like Fulg says, for some reason it always finds the Sip executable installed on my system. But it does snap to the Sip headers in my installation folder as desired. If the two are incompatible you'll get this error.