Error in building GoTools on OS X 10.9 (Mavericks) #6

Closed
yconst opened this Issue Jul 18, 2014 · 4 comments

Projects

None yet

4 participants

@yconst
yconst commented Jul 18, 2014

Tried to build GoTools on OS X 10.9. Cmake process goes all fine, but during make I get the following 2 errors:

[...]/GoTools-master/gotools-core/src/geometry/BoundedSurface.C:2286:34: error:
use of overloaded operator '!=' is ambiguous (with operand types
'shared_ptrGo::ParamCurve' and 'long')
if (cv_on_sf->parameterCurve() != NULL) {
~ ^ ~
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/memory:4781:1: note:
candidate function [with _Tp = Go::ParamCurve]
operator!=(const shared_ptr<_Tp>& __x, nullptr_t) _NOEXCEPT
^
[...]/GoTools-master/gotools-core/src/geometry/BoundedSurface.C:2286:34: note:
built-in candidate operator!=(int, long)
if (cv_on_sf->parameterCurve() != NULL) {
^

And later on:

[...]/GoTools-master/gotools-core/src/geometry/BoundedSurface.C:2297:30: error:
use of overloaded operator '!=' is ambiguous (with operand types
'shared_ptrGo::ParamCurve' and 'long')
if (cv_on_sf->spaceCurve() != NULL) {
~ ^ ~
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/memory:4781:1: note:
candidate function [with _Tp = Go::ParamCurve]
operator!=(const shared_ptr<_Tp>& __x, nullptr_t) _NOEXCEPT
^
[...]/GoTools-master/gotools-core/src/geometry/BoundedSurface.C:2297:30: note:
built-in candidate operator!=(int, long)
if (cv_on_sf->spaceCurve() != NULL) {
^

I'm not really a C++ person :), so any help in resolving this would be really appreciated.

I believe the culprit lies in incompatibilities with the clang++ compiler used in os x.

Thanks.

@tordokken
Collaborator

Hi,

I have forwarded your problem to one of my colleagues. However, we have holidays so I don't know when there will be a response.
We use Windows and Linux, so probably we don't have the expertise for OS X.

Tor

From: yconst [mailto:notifications@github.com]
Sent: 18. juli 2014 09:44
To: SINTEF-Geometry/GoTools
Subject: [GoTools] Error in building GoTools on OS X 10.9 (Mavericks) (#6)

Tried to build GoTools on OS X 10.9. Cmake process goes all fine, but during make I get the following 2 errors:

[...]/GoTools-master/gotools-core/src/geometry/BoundedSurface.C:2286:34: error:
use of overloaded operator '!=' is ambiguous (with operand types
'shared_ptrGo::ParamCurve' and 'long')
if (cv_on_sf->parameterCurve() != NULL) {
~ ^ ~
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/memory:4781:1: note:
candidate function [with _Tp = Go::ParamCurve]
operator!=(const shared_ptr<_Tp>& __x, nullptr_t) _NOEXCEPT
^
[...]/GoTools-master/gotools-core/src/geometry/BoundedSurface.C:2286:34: note:
built-in candidate operator!=(int, long)
if (cv_on_sf->parameterCurve() != NULL) {
^

And later on:

[...]/GoTools-master/gotools-core/src/geometry/BoundedSurface.C:2297:30: error:
use of overloaded operator '!=' is ambiguous (with operand types
'shared_ptrGo::ParamCurve' and 'long')
if (cv_on_sf->spaceCurve() != NULL) {
~ ^ ~
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/memory:4781:1: note:
candidate function [with _Tp = Go::ParamCurve]
operator!=(const shared_ptr<_Tp>& __x, nullptr_t) _NOEXCEPT
^
[...]/GoTools-master/gotools-core/src/geometry/BoundedSurface.C:2297:30: note:
built-in candidate operator!=(int, long)
if (cv_on_sf->spaceCurve() != NULL) {
^

I'm not really a C++ person :), so any help in resolving this would be really appreciated.

I believe the culprit lies in incompatibilities with the clang++ compiler used in os x.

Thanks.


Reply to this email directly or view it on GitHubhttps://github.com/SINTEF-Geometry/GoTools/issues/6.

@yconst
yconst commented Jul 18, 2014

Thanks a lot for the reply. As I mentioned, I am not a C++ guy, but I think I came somewhere. Replacing all explicit NULL checks with implicit ones solved the compilation issue:

if (something != NULL)

to

if (something)

I also got some erros later on about inclusions of malloc.h Changing:

#include < malloc.h >

to

#include < malloc/malloc.h >

fixed this issue as well (added spaces to avoid markdown parsing).

Now I get a different error related to abstract classes, will post this in a new issue.

Thanks

@yconst yconst closed this Jul 18, 2014
@bobbiesimpson

I fixed all the smart pointer errors by replacing e.g.

if(smartpointer != NULL)

with

if(smartpointer.get() != nullptr)

I also got the same errors with the malloc header file. But if the <stdlib.h> is present in the file, you can remove the malloc.h line.

@arthursw

I fixed the smart pointers errors by hand and it worked, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment