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

error: use of undeclared identifier 'SIP_NULLPTR' #92

Open
Atomzdq opened this issue Feb 22, 2019 · 9 comments · Fixed by #134
Open

error: use of undeclared identifier 'SIP_NULLPTR' #92

Atomzdq opened this issue Feb 22, 2019 · 9 comments · Fixed by #134

Comments

@Atomzdq
Copy link

Atomzdq commented Feb 22, 2019

(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
Copy link
Contributor

Ghostkeeper commented Feb 22, 2019

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

@Atomzdq
Copy link
Author

Atomzdq commented Feb 22, 2019

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

@Ghostkeeper
Copy link
Contributor

Ghostkeeper commented Feb 22, 2019

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
Copy link
Author

Atomzdq commented Feb 22, 2019

@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
Copy link
Contributor

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
Copy link

Fulg commented Apr 20, 2019

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
Copy link
Contributor

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

  • SIP_BINARY_PATH
  • SIP_EXECUTABLE
  • SIP_INCLUDE_DIR
  • SIP_INCLUDE_DIRS (I believe this one is just left in my CMake cache because of older versions.)

@NikhilAshodariya
Copy link

Hello,

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

@Ghostkeeper
Copy link
Contributor

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.

@jellespijker jellespijker linked a pull request Apr 12, 2022 that will close this issue
2 tasks
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

Successfully merging a pull request may close this issue.

4 participants