Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

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

Closed
yconst opened this Issue · 3 comments

3 participants

@yconst

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
Owner
@yconst

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
@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.