Volumes Of Fun
http://www.volumesoffun.com/phpBB3/

Compiler warnings and errors - Post your fixes here
http://www.volumesoffun.com/phpBB3/viewtopic.php?f=15&t=242
Page 3 of 3

Author:  ivlasyuk [ Tue Feb 12, 2013 3:12 pm ]
Post subject:  Re: Compiler warnings and errors - Post your fixes here

Hi

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

Author:  milliams [ Tue Feb 12, 2013 3:23 pm ]
Post subject:  Re: Compiler warnings and errors - Post your fixes here

What compiler, compiler version and PolyVox version are you using? Also could you paste here the exact error messages you are receiving.

Author:  ivlasyuk [ Tue Feb 12, 2013 3:33 pm ]
Post subject:  Re: Compiler warnings and errors - Post your fixes here

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

Author:  milliams [ Tue Feb 12, 2013 4:16 pm ]
Post subject:  Re: Compiler warnings and errors - Post your fixes here

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.

Author:  ivlasyuk [ Tue Feb 12, 2013 4:53 pm ]
Post subject:  Re: Compiler warnings and errors - Post your fixes here

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

Author:  David Williams [ Wed Feb 13, 2013 9:32 am ]
Post subject:  Re: Compiler warnings and errors - Post your fixes here

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.

Page 3 of 3 All times are UTC
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/