PDA

View Full Version : Trying (and failing) to build RTBarebones on linux



brycethorup
11-01-2012, 11:24 PM
Forgive me if I am missing something obvious here. I am new to both Proton SDK and C++.

I am able to successfully run the 'cmake' command and the 'make' command, however at 81% it fails with the following output:


[ 81%] Building CXX object CMakeFiles/rtbarebones.dir/home/bryce/Documents/proton/proton/shared/ClanLib-2.0/Sources/Core/Math/mat4.cpp.o
In file included from /home/bryce/Documents/proton/proton/shared/ClanLib-2.0/Sources/API/Core/Math/mat2.h:38:0,
from /home/bryce/Documents/proton/proton/shared/ClanLib-2.0/Sources/API/Core/Math/mat4.h:38,
from /home/bryce/Documents/proton/proton/shared/ClanLib-2.0/Sources/Core/Math/mat4.cpp:31:
/home/bryce/Documents/proton/proton/shared/ClanLib-2.0/Sources/API/Core/Math/mat3.h: In instantiation of ‘CL_Mat3<Type>& CL_Mat3<Type>::operator=(const CL_Mat3<Type>&) [with Type = int]’:
/home/bryce/Documents/proton/proton/shared/ClanLib-2.0/Sources/Core/Math/mat4.cpp:839:2: required from ‘double CL_Mat4<Type>::det() const [with Type = int]’
/home/bryce/Documents/proton/proton/shared/ClanLib-2.0/Sources/Core/Math/mat4.cpp:1036:16: required from here
/home/bryce/Documents/proton/proton/shared/ClanLib-2.0/Sources/API/Core/Math/mat3.h:271:56: error: ‘memcpy’ was not declared in this scope, and no declarations were found by argument-dependent lookup at the point of instantiation [-fpermissive]
In file included from /usr/include/memory.h:30:0,
from /home/bryce/Documents/proton/proton/shared/ClanLib-2.0/Sources/API/Core/Math/../System/system.h:42,
from /home/bryce/Documents/proton/proton/shared/ClanLib-2.0/Sources/API/Core/Math/../System/sharedptr.h:37,
from /home/bryce/Documents/proton/proton/shared/ClanLib-2.0/Sources/API/Core/Math/angle.h:35,
from /home/bryce/Documents/proton/proton/shared/ClanLib-2.0/Sources/API/Core/Math/mat4.h:40,
from /home/bryce/Documents/proton/proton/shared/ClanLib-2.0/Sources/Core/Math/mat4.cpp:31:
/usr/include/string.h:44:14: note: ‘void* memcpy(void*, const void*, size_t)’ declared here, later in the translation unit
In file included from /home/bryce/Documents/proton/proton/shared/ClanLib-2.0/Sources/API/Core/Math/mat2.h:38:0,
from /home/bryce/Documents/proton/proton/shared/ClanLib-2.0/Sources/API/Core/Math/mat4.h:38,
from /home/bryce/Documents/proton/proton/shared/ClanLib-2.0/Sources/Core/Math/mat4.cpp:31:
/home/bryce/Documents/proton/proton/shared/ClanLib-2.0/Sources/API/Core/Math/mat3.h: In instantiation of ‘CL_Mat3<Type>& CL_Mat3<Type>::operator=(const CL_Mat3<Type>&) [with Type = float]’:
/home/bryce/Documents/proton/proton/shared/ClanLib-2.0/Sources/Core/Math/mat4.cpp:839:2: required from ‘double CL_Mat4<Type>::det() const [with Type = float]’
/home/bryce/Documents/proton/proton/shared/ClanLib-2.0/Sources/Core/Math/mat4.cpp:1037:16: required from here
/home/bryce/Documents/proton/proton/shared/ClanLib-2.0/Sources/API/Core/Math/mat3.h:271:56: error: ‘memcpy’ was not declared in this scope, and no declarations were found by argument-dependent lookup at the point of instantiation [-fpermissive]
In file included from /usr/include/memory.h:30:0,
from /home/bryce/Documents/proton/proton/shared/ClanLib-2.0/Sources/API/Core/Math/../System/system.h:42,
from /home/bryce/Documents/proton/proton/shared/ClanLib-2.0/Sources/API/Core/Math/../System/sharedptr.h:37,
from /home/bryce/Documents/proton/proton/shared/ClanLib-2.0/Sources/API/Core/Math/angle.h:35,
from /home/bryce/Documents/proton/proton/shared/ClanLib-2.0/Sources/API/Core/Math/mat4.h:40,
from /home/bryce/Documents/proton/proton/shared/ClanLib-2.0/Sources/Core/Math/mat4.cpp:31:
/usr/include/string.h:44:14: note: ‘void* memcpy(void*, const void*, size_t)’ declared here, later in the translation unit
In file included from /home/bryce/Documents/proton/proton/shared/ClanLib-2.0/Sources/API/Core/Math/mat2.h:38:0,
from /home/bryce/Documents/proton/proton/shared/ClanLib-2.0/Sources/API/Core/Math/mat4.h:38,
from /home/bryce/Documents/proton/proton/shared/ClanLib-2.0/Sources/Core/Math/mat4.cpp:31:
/home/bryce/Documents/proton/proton/shared/ClanLib-2.0/Sources/API/Core/Math/mat3.h: In instantiation of ‘CL_Mat3<Type>& CL_Mat3<Type>::operator=(const CL_Mat3<Type>&) [with Type = double]’:
/home/bryce/Documents/proton/proton/shared/ClanLib-2.0/Sources/Core/Math/mat4.cpp:839:2: required from ‘double CL_Mat4<Type>::det() const [with Type = double]’
/home/bryce/Documents/proton/proton/shared/ClanLib-2.0/Sources/Core/Math/mat4.cpp:1038:16: required from here
/home/bryce/Documents/proton/proton/shared/ClanLib-2.0/Sources/API/Core/Math/mat3.h:271:56: error: ‘memcpy’ was not declared in this scope, and no declarations were found by argument-dependent lookup at the point of instantiation [-fpermissive]
In file included from /usr/include/memory.h:30:0,
from /home/bryce/Documents/proton/proton/shared/ClanLib-2.0/Sources/API/Core/Math/../System/system.h:42,
from /home/bryce/Documents/proton/proton/shared/ClanLib-2.0/Sources/API/Core/Math/../System/sharedptr.h:37,
from /home/bryce/Documents/proton/proton/shared/ClanLib-2.0/Sources/API/Core/Math/angle.h:35,
from /home/bryce/Documents/proton/proton/shared/ClanLib-2.0/Sources/API/Core/Math/mat4.h:40,
from /home/bryce/Documents/proton/proton/shared/ClanLib-2.0/Sources/Core/Math/mat4.cpp:31:
/usr/include/string.h:44:14: note: ‘void* memcpy(void*, const void*, size_t)’ declared here, later in the translation unit
make[2]: *** [CMakeFiles/rtbarebones.dir/home/bryce/Documents/proton/proton/shared/ClanLib-2.0/Sources/Core/Math/mat4.cpp.o] Error 1
make[1]: *** [CMakeFiles/rtbarebones.dir/all] Error 2
make: *** [all] Error 2

Like I said I am pretty new to C++, so this is all mostly gibberish to me. If I had to guess I would say that it is having trouble compiling the mat4.cpp file in ClanLib. Am I missing a dependency? I am lost.

Aki Koskinen
11-02-2012, 08:20 AM
/home/bryce/Documents/proton/proton/shared/ClanLib-2.0/Sources/API/Core/Math/mat3.h:271:56: error: ‘memcpy’ was not declared in this scope, and no declarations were found by argument-dependent lookup at the point of instantiation [-fpermissive]


This error message leads me to believe that you have gcc 4.7 in use [1]. If that's the case then apparently Proton (or the code bundled with it) isn't quite compatible with that gcc version.

In [1] it says that you could temporarily get rid of this error by passing the -fpermissive argument to the compiler. You can try this by editing the shared/linux/Proton.cmake file. On line 25 there is a add_definitions... directive. Add the -fpermissive flag there. The modified line should be like this:
add_definitions(-DRTLINUX -DBOOST_ALL_NO_LIB -DC_GL_MODE -fpermissive)

Now try to run make again and see if that helps.

This is obviously not the real solution for this error case so I wouldn't commit such a change to the Proton code base. The real solution would off course be to modify the source code to compile with the newer gcc too.

[1] http://gcc.gnu.org/gcc-4.7/porting_to.html