It is currently Sun Nov 17, 2019 9:45 am


All times are UTC




Post new topic Reply to topic  [ 26 posts ]  Go to page Previous  1, 2, 3
Author Message
 Post subject: Re: Compiler warnings and errors - Post your fixes here
PostPosted: Tue Feb 12, 2013 3:12 pm 

Joined: Sun Nov 18, 2012 8:30 pm
Posts: 3
Hi

I have problems during compilation PolyVox under Mac OS X 10.7
AStarPathfinder.h compiling with different errors.


Top
Offline Profile  
Reply with quote  
 Post subject: Re: Compiler warnings and errors - Post your fixes here
PostPosted: Tue Feb 12, 2013 3:23 pm 
Developer
User avatar

Joined: Sun May 11, 2008 4:29 pm
Posts: 198
Location: UK
What compiler, compiler version and PolyVox version are you using? Also could you paste here the exact error messages you are receiving.

_________________
Matt Williams
Linux/CMake guy


Top
Offline Profile  
Reply with quote  
 Post subject: Re: Compiler warnings and errors - Post your fixes here
PostPosted: Tue Feb 12, 2013 3:33 pm 

Joined: Sun Nov 18, 2012 8:30 pm
Posts: 3
latest clone from bitbucket

gcc version 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2336.11.00)

Code:
In file included from /Users/admin/demoprojects/PolyVoxTwo/polyvox/library/PolyVoxCore/source/AStarPathfinder.cpp:24:
/Users/admin/demoprojects/PolyVoxTwo/polyvox/library/PolyVoxCore/include/PolyVoxCore/AStarPathfinder.h:74:4: error: no type named 'function' in namespace 'std'
                        polyvox_function<bool (const VolumeType*, const Vector3DInt32&)> funcIsVoxelValidForPath = &aStarDefaultVoxelValidator,
                        ^~~~~~~~~~~~~~~~
/Users/admin/demoprojects/PolyVoxTwo/polyvox/library/PolyVoxCore/include/PolyVoxCore/Impl/TypeDef.h:98:32: note: expanded from macro 'polyvox_function'
        #define polyvox_function std::function
                                 ~~~~~^
In file included from /Users/admin/demoprojects/PolyVoxTwo/polyvox/library/PolyVoxCore/source/AStarPathfinder.cpp:24:
/Users/admin/demoprojects/PolyVoxTwo/polyvox/library/PolyVoxCore/include/PolyVoxCore/AStarPathfinder.h:74:20: error: expected ')'
                        polyvox_function<bool (const VolumeType*, const Vector3DInt32&)> funcIsVoxelValidForPath = &aStarDefaultVoxelValidator,
                                        ^
/Users/admin/demoprojects/PolyVoxTwo/polyvox/library/PolyVoxCore/include/PolyVoxCore/AStarPathfinder.h:66:3: note: to match this '('
                (
                ^
/Users/admin/demoprojects/PolyVoxTwo/polyvox/library/PolyVoxCore/include/PolyVoxCore/AStarPathfinder.h:129:3: error: no type named 'function' in namespace
      'std'
                polyvox_function<bool (const VolumeType*, const Vector3DInt32&)> isVoxelValidForPath;
                ^~~~~~~~~~~~~~~~
/Users/admin/demoprojects/PolyVoxTwo/polyvox/library/PolyVoxCore/include/PolyVoxCore/Impl/TypeDef.h:98:32: note: expanded from macro 'polyvox_function'
        #define polyvox_function std::function
                                 ~~~~~^
In file included from /Users/admin/demoprojects/PolyVoxTwo/polyvox/library/PolyVoxCore/source/AStarPathfinder.cpp:24:
/Users/admin/demoprojects/PolyVoxTwo/polyvox/library/PolyVoxCore/include/PolyVoxCore/AStarPathfinder.h:129:19: error: expected member name or ';' after
      declaration specifiers
                polyvox_function<bool (const VolumeType*, const Vector3DInt32&)> isVoxelValidForPath;
                ~~~~~~~~~~~~~~~~^
/Users/admin/demoprojects/PolyVoxTwo/polyvox/library/PolyVoxCore/include/PolyVoxCore/AStarPathfinder.h:136:3: error: no type named 'function' in namespace
      'std'
                polyvox_function<void (float)> progressCallback;
                ^~~~~~~~~~~~~~~~
/Users/admin/demoprojects/PolyVoxTwo/polyvox/library/PolyVoxCore/include/PolyVoxCore/Impl/TypeDef.h:98:32: note: expanded from macro 'polyvox_function'
        #define polyvox_function std::function
                                 ~~~~~^
In file included from /Users/admin/demoprojects/PolyVoxTwo/polyvox/library/PolyVoxCore/source/AStarPathfinder.cpp:24:
/Users/admin/demoprojects/PolyVoxTwo/polyvox/library/PolyVoxCore/include/PolyVoxCore/AStarPathfinder.h:136:19: error: expected member name or ';' after
      declaration specifiers
                polyvox_function<void (float)> progressCallback;
                ~~~~~~~~~~~~~~~~^
/Users/admin/demoprojects/PolyVoxTwo/polyvox/library/PolyVoxCore/include/PolyVoxCore/AStarPathfinder.h:84:25: error: use of undeclared identifier
      'funcIsVoxelValidForPath'
                        ,isVoxelValidForPath(funcIsVoxelValidForPath)
                                             ^
/Users/admin/demoprojects/PolyVoxTwo/polyvox/library/PolyVoxCore/include/PolyVoxCore/AStarPathfinder.h:85:22: error: use of undeclared identifier
      'funcProgressCallback'
                        ,progressCallback(funcProgressCallback)
                                          ^
8 errors generated.
make[2]: *** [library/PolyVoxCore/CMakeFiles/PolyVoxCore.dir/source/AStarPathfinder.cpp.o] Error 1
make[1]: *** [library/PolyVoxCore/CMakeFiles/PolyVoxCore.dir/all] Error 2
make: *** [all] Error 2


Top
Offline Profile  
Reply with quote  
 Post subject: Re: Compiler warnings and errors - Post your fixes here
PostPosted: Tue Feb 12, 2013 4:16 pm 
Developer
User avatar

Joined: Sun May 11, 2008 4:29 pm
Posts: 198
Location: UK
This is almost certainly caused by the old version of GCC that Apple continues to provide in MacOS. GCC 4.2.1 is almost 6 years old now and doesn't provide some modern features of C++.

The best solution for you is probably to try compiling PolyVox using Clang which should be provided with XCode and is the officially supported Apple compiler. While I haven't compiled on a Mac myself, I have used Clang on Linux and it works fine.

Once you have that working, let me know if you have any problems with it.

_________________
Matt Williams
Linux/CMake guy


Top
Offline Profile  
Reply with quote  
 Post subject: Re: Compiler warnings and errors - Post your fixes here
PostPosted: Tue Feb 12, 2013 4:53 pm 

Joined: Sun Nov 18, 2012 8:30 pm
Posts: 3
I have Clang installed. How to force CMake use Clang?
Actually now I am not sure that it was compiled by gcc.

Code:
-- The C compiler identification is Clang 4.1.0
-- The CXX compiler identification is Clang 4.1.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Found OpenGL: /System/Library/Frameworks/OpenGL.framework 
-- Configuring done
-- Generating done
-- Build files have been written to: /Users/admin/demoprojects/PolyVoxTwo/polyvox/examples/SmoothLOD/build
admin@Ihor-Vlasyuk:~/demoprojects/PolyVoxTwo/polyvox/examples/SmoothLOD/build$ ls
CMakeCache.txt      CMakeFiles          Makefile            cmake_install.cmake
admin@Ihor-Vlasyuk:~/demoprojects/PolyVoxTwo/polyvox/examples/SmoothLOD/build$ make
Scanning dependencies of target SmoothLODExample
[ 33%] Building CXX object CMakeFiles/SmoothLODExample.dir/glew/glew.cpp.o
[ 66%] Building CXX object CMakeFiles/SmoothLODExample.dir/main.cpp.o
In file included from /Users/admin/demoprojects/PolyVoxTwo/polyvox/examples/SmoothLOD/main.cpp:24:
/Users/admin/demoprojects/PolyVoxTwo/polyvox/examples/SmoothLOD/OpenGLWidget.h:27:10: fatal error: 'PolyVoxCore/SurfaceMesh.h' file not found
#include "PolyVoxCore/SurfaceMesh.h"
         ^
1 error generated.
make[2]: *** [CMakeFiles/SmoothLODExample.dir/main.cpp.o] Error 1
make[1]: *** [CMakeFiles/SmoothLODExample.dir/all] Error 2
make: *** [all] Error 2


Top
Offline Profile  
Reply with quote  
 Post subject: Re: Compiler warnings and errors - Post your fixes here
PostPosted: Wed Feb 13, 2013 9:32 am 
Developer
User avatar

Joined: Sun May 04, 2008 6:35 pm
Posts: 1827
ivlasyuk wrote:
Code:
'PolyVoxCore/SurfaceMesh.h' file not found


So it looks like it can't find the PolyVox headers, which probably means the include directories have not been properly set up by CMake. I had a quick look at our CMakeLists.txt files and I don't see anything obvious which would cause this, but unfortunatly we don't have access to a Mac for testing so it's hard to fix this ourselves.

As it's failing when building the examples it may be that the main library has already been built, so perhaps you can still use PolyVox. You could also try modifying the CMake files to add the required include directory manually. It depends how comfortable you are with CMake/C++ really.


Top
Offline Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 26 posts ]  Go to page Previous  1, 2, 3

All times are UTC


Who is online

Users browsing this forum: No registered users and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
Theme created StylerBB.net