Linking error with gcc 4.2.3

Hi,

I’am new to cuda an wanted to run the examples, but it wasn’t possible :( .
Please can anybody help me :) .

What i have done:

1.) Downloaded:

[url=“http://developer.download.nvidia.com/compute/cuda/1_1/Linux/sdk/NVIDIA_CUDA_SDK_1.1_Linux.run”]http://developer.download.nvidia.com/compu...K_1.1_Linux.run[/url]
[url=“http://developer.download.nvidia.com/compute/cuda/1_1/Linux/toolkits/NVIDIA_CUDA_Toolkit_1.1_Ubuntu7_x86.run”]http://developer.download.nvidia.com/compu...Ubuntu7_x86.run[/url]

2.) Install it

mkdir /home/al/libs/nvidia
sh ./NVIDIA_CUDA_Toolkit_1.1_Ubuntu7_x86.run
Enter install path (default /usr/local/cuda, ‘/cuda’ will be appended): /home/al/libs/nvidia

sh NVIDIA_CUDA_SDK_1.1_Linux.run

3.) Add the libs and bins into env

export LD_LIBRARY_PATH=/home/al/libs/nvidia/cuda/lib:${LD_LIBRARY_PATH}
export PATH=/home/al/libs/nvidia/cuda/bin:${PATH}

4.) Bulid the examples and SDK

cd ~/NVIDIA_CUDA_SDK
$ make CUDA_INSTALL_PATH=/home/al/libs/nvidia/cuda verbose=1
See “LONG OUTPUT” for the output.

My env:

uname -a
Linux firstserver 2.6.24-gentoo-r3 #1 SMP Tue Mar 11 00:21:30 CET 2008 i686 Intel® Core™2 CPU 6600 @ 2.40GHz GenuineIntel GNU/Linux

g++ --version
g++ (GCC) 4.2.3 (Gentoo 4.2.3 p1.0)

Should I wait for the next release or is there a workaround?

Cheers

Aleks

LONG OUTPUT

make CUDA_INSTALL_PATH=/home/al/libs/nvidia/cuda verbose=1 make[1]: Entering directory /home/al/NVIDIA_CUDA_SDK/common' g++ -W -Wall -Wimplicit -Wswitch -Wformat -Wchar-subscripts -Wparentheses -Wmultichar -Wtrigraphs -Wpointer-arith -Wcast-align -Wreturn-type -Wno-unused-function -fno-strict-aliasing -I. -I/home/al/libs/nvidia/cuda/include -I./../common/inc -DUNIX -O3 -o obj/release/bank_checker.cpp_o -c src/bank_checker.cpp g++ -W -Wall -Wimplicit -Wswitch -Wformat -Wchar-subscripts -Wparentheses -Wmultichar -Wtrigraphs -Wpointer-arith -Wcast-align -Wreturn-type -Wno-unused-function -fno-strict-aliasing -I. -I/home/al/libs/nvidia/cuda/include -I./../common/inc -DUNIX -O3 -o obj/release/cmd_arg_reader.cpp_o -c src/cmd_arg_reader.cpp g++ -W -Wall -Wimplicit -Wswitch -Wformat -Wchar-subscripts -Wparentheses -Wmultichar -Wtrigraphs -Wpointer-arith -Wcast-align -Wreturn-type -Wno-unused-function -fno-strict-aliasing -I. -I/home/al/libs/nvidia/cuda/include -I./../common/inc -DUNIX -O3 -o obj/release/cutil.cpp_o -c src/cutil.cpp g++ -W -Wall -Wimplicit -Wswitch -Wformat -Wchar-subscripts -Wparentheses -Wmultichar -Wtrigraphs -Wpointer-arith -Wcast-align -Wreturn-type -Wno-unused-function -fno-strict-aliasing -I. -I/home/al/libs/nvidia/cuda/include -I./../common/inc -DUNIX -O3 -o obj/release/stopwatch.cpp_o -c src/stopwatch.cpp g++ -W -Wall -Wimplicit -Wswitch -Wformat -Wchar-subscripts -Wparentheses -Wmultichar -Wtrigraphs -Wpointer-arith -Wcast-align -Wreturn-type -Wno-unused-function -fno-strict-aliasing -I. -I/home/al/libs/nvidia/cuda/include -I./../common/inc -DUNIX -O3 -o obj/release/stopwatch_linux.cpp_o -c src/stopwatch_linux.cpp g++ -W -Wall -Wimplicit -Wswitch -Wformat -Wchar-subscripts -Wparentheses -Wmultichar -Wtrigraphs -Wpointer-arith -Wcast-align -Wreturn-type -Wno-unused-function -fno-strict-aliasing -I. -I/home/al/libs/nvidia/cuda/include -I./../common/inc -DUNIX -O3 -o obj/release/multithreading.cpp_o -c src/multithreading.cpp ar qv ./../lib/libcutil.a obj/release/bank_checker.cpp_o obj/release/cmd_arg_reader.cpp_o obj/release/cutil.cpp_o obj/release/stopwatch.cpp_o obj/release/stopwatch_linux.cpp_o obj/release/multithreading.cpp_o ar: creating ./../lib/libcutil.a a - obj/release/bank_checker.cpp_o a - obj/release/cmd_arg_reader.cpp_o a - obj/release/cutil.cpp_o a - obj/release/stopwatch.cpp_o a - obj/release/stopwatch_linux.cpp_o a - obj/release/multithreading.cpp_o make[1]: Leaving directory /home/al/NVIDIA_CUDA_SDK/common’
make[1]: Entering directory /home/al/NVIDIA_CUDA_SDK/common' g++ -W -Wall -Wimplicit -Wswitch -Wformat -Wchar-subscripts -Wparentheses -Wmultichar -Wtrigraphs -Wpointer-arith -Wcast-align -Wreturn-type -Wno-unused-function -fno-strict-aliasing -I. -I/home/al/libs/nvidia/cuda/include -I./../common/inc -DUNIX -O3 -o obj/release/paramgl.cpp_o -c src/paramgl.cpp g++ -W -Wall -Wimplicit -Wswitch -Wformat -Wchar-subscripts -Wparentheses -Wmultichar -Wtrigraphs -Wpointer-arith -Wcast-align -Wreturn-type -Wno-unused-function -fno-strict-aliasing -I. -I/home/al/libs/nvidia/cuda/include -I./../common/inc -DUNIX -O3 -o obj/release/param.cpp_o -c src/param.cpp src/param.cpp:3: warning: deprecated conversion from string constant to 'char*' ar qv ./../lib/libparamgl.a obj/release/paramgl.cpp_o obj/release/param.cpp_o ar: creating ./../lib/libparamgl.a a - obj/release/paramgl.cpp_o a - obj/release/param.cpp_o make[1]: Leaving directory /home/al/NVIDIA_CUDA_SDK/common’
make -C projects/simpleTexture/
make[1]: Entering directory `/home/al/NVIDIA_CUDA_SDK/projects/simpleTexture’
nvcc -o obj/release/simpleTexture.cu_o -c simpleTexture.cu --compiler-options -fno-strict-aliasing -I. -I/home/al/libs/nvidia/cuda/include -I…/…/common/inc -DUNIX -O3
“/usr/lib/gcc/i686-pc-linux-gnu/4.2.3/include/g+±v4/i686-pc-linux-gnu/bits/c++config.h”, line 149: error:
expected a “{”
namespace std attribute ((visibility (“default”))) {
^

“/usr/lib/gcc/i686-pc-linux-gnu/4.2.3/include/g+±v4/bits/cpp_type_traits.h”, line 74: error:
expected a “{”
namespace __gnu_cxx attribute ((visibility (“default”))) {
^

“/usr/lib/gcc/i686-pc-linux-gnu/4.2.3/include/g+±v4/bits/cpp_type_traits.h”, line 81: error:
expected a “{”
namespace std attribute ((visibility (“default”))) {
^

“/usr/lib/gcc/i686-pc-linux-gnu/4.2.3/include/g+±v4/bits/cpp_type_traits.h”, line 313: error:
name followed by “::” must be a class or namespace name
struct __is_normal_iterator< __gnu_cxx::__normal_iterator<_Iterator,
^

“/usr/lib/gcc/i686-pc-linux-gnu/4.2.3/include/g+±v4/bits/cpp_type_traits.h”, line 313: error:
too many arguments for class template “::__is_normal_iterator”
struct __is_normal_iterator< __gnu_cxx::__normal_iterator<_Iterator,
^

“/usr/lib/gcc/i686-pc-linux-gnu/4.2.3/include/g+±v4/bits/cpp_type_traits.h”, line 313: error:
name followed by “::” must be a class or namespace name
struct __is_normal_iterator< __gnu_cxx::__normal_iterator<_Iterator,
^
“/usr/lib/gcc/i686-pc-linux-gnu/4.2.3/include/g+±v4/bits/cpp_type_traits.h”, line 313: error:
too many arguments for class template “::__is_normal_iterator”
struct __is_normal_iterator< __gnu_cxx::__normal_iterator<_Iterator,
^

“/usr/lib/gcc/i686-pc-linux-gnu/4.2.3/include/g+±v4/bits/cpp_type_traits.h”, line 313: error:
name followed by “::” must be a class or namespace name
struct __is_normal_iterator< __gnu_cxx::__normal_iterator<_Iterator,
^

“/usr/lib/gcc/i686-pc-linux-gnu/4.2.3/include/g+±v4/bits/cpp_type_traits.h”, line 313: error:
too many arguments for class template “::__is_normal_iterator”
struct __is_normal_iterator< __gnu_cxx::__normal_iterator<_Iterator,
^

“/usr/lib/gcc/i686-pc-linux-gnu/4.2.3/include/g+±v4/cstddef”, line 53: error:
expected a “{”
namespace std attribute ((visibility (“default”))) {
^

“/usr/lib/gcc/i686-pc-linux-gnu/4.2.3/include/g+±v4/bits/stl_relops.h”, line 74: error:
expected a “{”
namespace std attribute ((visibility (“default”))) {
^

“/usr/lib/gcc/i686-pc-linux-gnu/4.2.3/include/g+±v4/bits/stl_pair.h”, line 64: error:
expected a “{”
namespace std attribute ((visibility (“default”))) {
^

“/usr/lib/gcc/i686-pc-linux-gnu/4.2.3/include/g+±v4/ext/type_traits.h”, line 44: error:
expected a “{”
namespace __gnu_cxx attribute ((visibility (“default”))) {
^

“/usr/lib/gcc/i686-pc-linux-gnu/4.2.3/include/g+±v4/ext/type_traits.h”, line 71: error:
namespace “std” has no member “__is_integer”
typedef __enable_if<std::__is_integer<_Tp>::__value, _Tp> __if_type;
^

“/usr/lib/gcc/i686-pc-linux-gnu/4.2.3/include/g+±v4/ext/type_traits.h”, line 71: error:
type name is not allowed
typedef __enable_if<std::__is_integer<_Tp>::__value, _Tp> __if_type;
“/usr/lib/gcc/i686-pc-linux-gnu/4.2.3/include/g+±v4/ext/type_traits.h”, line 71: error:
too few arguments for class template “::__enable_if”
typedef __enable_if<std::__is_integer<_Tp>::__value, _Tp> __if_type;
^

“/usr/lib/gcc/i686-pc-linux-gnu/4.2.3/include/g+±v4/ext/type_traits.h”, line 71: error:
explicit type is missing (“int” assumed)
typedef __enable_if<std::__is_integer<_Tp>::__value, _Tp> __if_type;
^

“/usr/lib/gcc/i686-pc-linux-gnu/4.2.3/include/g+±v4/ext/type_traits.h”, line 71: error:
explicit type is missing (“int” assumed)
typedef __enable_if<std::__is_integer<_Tp>::__value, _Tp> __if_type;
^

“/usr/lib/gcc/i686-pc-linux-gnu/4.2.3/include/g+±v4/ext/type_traits.h”, line 71: error:
template parameter “_Tp” may not be redeclared in this scope
typedef __enable_if<std::__is_integer<_Tp>::__value, _Tp> __if_type;
^

“/usr/lib/gcc/i686-pc-linux-gnu/4.2.3/include/g+±v4/ext/type_traits.h”, line 71: error:
expected a “;”
typedef __enable_if<std::__is_integer<_Tp>::__value, _Tp> __if_type;
^

“/usr/lib/gcc/i686-pc-linux-gnu/4.2.3/include/g+±v4/ext/type_traits.h”, line 74: error:
name followed by “::” must be a class or namespace name
typedef typename __if_type::__type __type;
^

“/usr/lib/gcc/i686-pc-linux-gnu/4.2.3/include/g+±v4/ext/type_traits.h”, line 114: error:
namespace “std” has no member “__is_integer”
typedef __enable_if<std::__is_integer<_Tp>::__value, _Tp> __if_type;
^

“/usr/lib/gcc/i686-pc-linux-gnu/4.2.3/include/g+±v4/ext/type_traits.h”, line 114: error:
type name is not allowed
typedef __enable_if<std::__is_integer<_Tp>::__value, _Tp> __if_type;
^

“/usr/lib/gcc/i686-pc-linux-gnu/4.2.3/include/g+±v4/ext/type_traits.h”, line 114: error:
too few arguments for class template “::__enable_if”
typedef __enable_if<std::__is_integer<_Tp>::__value, _Tp> __if_type;
“/usr/lib/gcc/i686-pc-linux-gnu/4.2.3/include/g+±v4/ext/type_traits.h”, line 114: error:
explicit type is missing (“int” assumed)
typedef __enable_if<std::__is_integer<_Tp>::__value, _Tp> __if_type;
^

“/usr/lib/gcc/i686-pc-linux-gnu/4.2.3/include/g+±v4/ext/type_traits.h”, line 114: error:
explicit type is missing (“int” assumed)
typedef __enable_if<std::__is_integer<_Tp>::__value, _Tp> __if_type;
^

“/usr/lib/gcc/i686-pc-linux-gnu/4.2.3/include/g+±v4/ext/type_traits.h”, line 114: error:
template parameter “_Tp” may not be redeclared in this scope
typedef __enable_if<std::__is_integer<_Tp>::__value, _Tp> __if_type;
^

“/usr/lib/gcc/i686-pc-linux-gnu/4.2.3/include/g+±v4/ext/type_traits.h”, line 114: error:
expected a “;”
typedef __enable_if<std::__is_integer<_Tp>::__value, _Tp> __if_type;
^

“/usr/lib/gcc/i686-pc-linux-gnu/4.2.3/include/g+±v4/ext/type_traits.h”, line 117: error:
name followed by “::” must be a class or namespace name
typedef typename __if_type::__type __type;
^

“/usr/lib/gcc/i686-pc-linux-gnu/4.2.3/include/g+±v4/cmath”, line 82: error:
expected a “{”
namespace std attribute ((visibility (“default”))) {
^

“/usr/lib/gcc/i686-pc-linux-gnu/4.2.3/include/g+±v4/cmath”, line 111: error:
name followed by “::” must be a class or namespace name
inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
^

“/usr/lib/gcc/i686-pc-linux-gnu/4.2.3/include/g+±v4/cmath”, line 111: error:
name followed by “::” must be a class or namespace name
inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
^

“/usr/lib/gcc/i686-pc-linux-gnu/4.2.3/include/g+±v4/cmath”, line 127: error:
name followed by “::” must be a class or namespace name
inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,

“/usr/lib/gcc/i686-pc-linux-gnu/4.2.3/include/g+±v4/cmath”, line 127: error:
name followed by “::” must be a class or namespace name
inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
^

“/usr/lib/gcc/i686-pc-linux-gnu/4.2.3/include/g+±v4/cmath”, line 143: error:
name followed by “::” must be a class or namespace name
inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
^

“/usr/lib/gcc/i686-pc-linux-gnu/4.2.3/include/g+±v4/cmath”, line 143: error:
name followed by “::” must be a class or namespace name
inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
^

“/usr/lib/gcc/i686-pc-linux-gnu/4.2.3/include/g+±v4/cmath”, line 159: error:
name followed by “::” must be a class or namespace name
inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value
^

“/usr/lib/gcc/i686-pc-linux-gnu/4.2.3/include/g+±v4/cmath”, line 159: error:
name followed by “::” must be a class or namespace name
inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value
^

“/usr/lib/gcc/i686-pc-linux-gnu/4.2.3/include/g+±v4/cmath”, line 176: error:
name followed by “::” must be a class or namespace name
inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
^

“/usr/lib/gcc/i686-pc-linux-gnu/4.2.3/include/g+±v4/cmath”, line 176: error:
name followed by “::” must be a class or namespace name
inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
^

“/usr/lib/gcc/i686-pc-linux-gnu/4.2.3/include/g+±v4/cmath”, line 192: error:
name followed by “::” must be a class or namespace name
inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
^

“/usr/lib/gcc/i686-pc-linux-gnu/4.2.3/include/g+±v4/cmath”, line 192: error:
name followed by “::” must be a class or namespace name
inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
^
“/usr/lib/gcc/i686-pc-linux-gnu/4.2.3/include/g+±v4/cmath”, line 208: error:
name followed by “::” must be a class or namespace name
inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
^

“/usr/lib/gcc/i686-pc-linux-gnu/4.2.3/include/g+±v4/cmath”, line 208: error:
name followed by “::” must be a class or namespace name
inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
^

“/usr/lib/gcc/i686-pc-linux-gnu/4.2.3/include/g+±v4/cmath”, line 224: error:
name followed by “::” must be a class or namespace name
inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
^

“/usr/lib/gcc/i686-pc-linux-gnu/4.2.3/include/g+±v4/cmath”, line 224: error:
name followed by “::” must be a class or namespace name
inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
^

“/usr/lib/gcc/i686-pc-linux-gnu/4.2.3/include/g+±v4/cmath”, line 240: error:
name followed by “::” must be a class or namespace name
inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
^

“/usr/lib/gcc/i686-pc-linux-gnu/4.2.3/include/g+±v4/cmath”, line 240: error:
name followed by “::” must be a class or namespace name
inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
^

“/usr/lib/gcc/i686-pc-linux-gnu/4.2.3/include/g+±v4/cmath”, line 256: error:
name followed by “::” must be a class or namespace name
inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
^

“/usr/lib/gcc/i686-pc-linux-gnu/4.2.3/include/g+±v4/cmath”, line 256: error:
name followed by “::” must be a class or namespace name
inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
^

“/usr/lib/gcc/i686-pc-linux-gnu/4.2.3/include/g+±v4/cmath”, line 282: error:
name followed by “::” must be a class or namespace name
inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
^
“/usr/lib/gcc/i686-pc-linux-gnu/4.2.3/include/g+±v4/cmath”, line 282: error:
name followed by “::” must be a class or namespace name
inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
^

“/usr/lib/gcc/i686-pc-linux-gnu/4.2.3/include/g+±v4/cmath”, line 298: error:
name followed by “::” must be a class or namespace name
inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
^

“/usr/lib/gcc/i686-pc-linux-gnu/4.2.3/include/g+±v4/cmath”, line 298: error:
name followed by “::” must be a class or namespace name
inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
^

“/usr/lib/gcc/i686-pc-linux-gnu/4.2.3/include/g+±v4/cmath”, line 314: error:
name followed by “::” must be a class or namespace name
inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
^

“/usr/lib/gcc/i686-pc-linux-gnu/4.2.3/include/g+±v4/cmath”, line 314: error:
name followed by “::” must be a class or namespace name
inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
^

“/usr/lib/gcc/i686-pc-linux-gnu/4.2.3/include/g+±v4/cmath”, line 330: error:
name followed by “::” must be a class or namespace name
inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
^

“/usr/lib/gcc/i686-pc-linux-gnu/4.2.3/include/g+±v4/cmath”, line 330: error:
name followed by “::” must be a class or namespace name
inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
^

“/usr/lib/gcc/i686-pc-linux-gnu/4.2.3/include/g+±v4/cmath”, line 387: error:
name followed by “::” must be a class or namespace name
inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
^

“/usr/lib/gcc/i686-pc-linux-gnu/4.2.3/include/g+±v4/cmath”, line 387: error:
name followed by “::” must be a class or namespace name
inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
^
“/usr/lib/gcc/i686-pc-linux-gnu/4.2.3/include/g+±v4/cmath”, line 403: error:
name followed by “::” must be a class or namespace name
inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
^

“/usr/lib/gcc/i686-pc-linux-gnu/4.2.3/include/g+±v4/cmath”, line 403: error:
name followed by “::” must be a class or namespace name
inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
^

“/usr/lib/gcc/i686-pc-linux-gnu/4.2.3/include/g+±v4/cmath”, line 419: error:
name followed by “::” must be a class or namespace name
inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
^

“/usr/lib/gcc/i686-pc-linux-gnu/4.2.3/include/g+±v4/cmath”, line 419: error:
name followed by “::” must be a class or namespace name
inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
^

“/usr/lib/gcc/i686-pc-linux-gnu/4.2.3/include/g+±v4/cmath”, line 435: error:
name followed by “::” must be a class or namespace name
inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
^

“/usr/lib/gcc/i686-pc-linux-gnu/4.2.3/include/g+±v4/cmath”, line 435: error:
name followed by “::” must be a class or namespace name
inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
^

“/usr/lib/gcc/i686-pc-linux-gnu/4.2.3/include/g+±v4/cmath”, line 451: error:
name followed by “::” must be a class or namespace name
inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
^

“/usr/lib/gcc/i686-pc-linux-gnu/4.2.3/include/g+±v4/cmath”, line 451: error:
name followed by “::” must be a class or namespace name
inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
^

“/usr/lib/gcc/i686-pc-linux-gnu/4.2.3/include/g+±v4/cmath”, line 456: error:
expected a “;”
}
^
“/usr/lib/gcc/i686-pc-linux-gnu/4.2.3/include/g+±v4/cmath”, line 464: error:
expected a “{”
namespace __gnu_cxx attribute ((visibility (“default”))) {
^

“/usr/lib/gcc/i686-pc-linux-gnu/4.2.3/include/g+±v4/cmath”, line 535: error:
expected a “{”
namespace std attribute ((visibility (“default”))) {
^

“/usr/lib/gcc/i686-pc-linux-gnu/4.2.3/include/g+±v4/bits/cmath.tcc”, line 39: error:
expected a “{”
namespace std attribute ((visibility (“default”))) {
^

“/usr/lib/gcc/i686-pc-linux-gnu/4.2.3/include/g+±v4/cstdlib”, line 104: error:
expected a “{”
namespace std attribute ((visibility (“default”))) {
^

“/usr/lib/gcc/i686-pc-linux-gnu/4.2.3/include/g+±v4/cstdlib”, line 161: error:
expected a “{”
namespace __gnu_cxx attribute ((visibility (“default”))) {
^

“/usr/lib/gcc/i686-pc-linux-gnu/4.2.3/include/g+±v4/cstdlib”, line 203: error:
expected a “{”
namespace std attribute ((visibility (“default”))) {
^

“/usr/lib/gcc/i686-pc-linux-gnu/4.2.3/include/g+±v4/cstdlib”, line 206: error:
name followed by “::” must be a class or namespace name
using ::__gnu_cxx::lldiv_t;
^

“/usr/lib/gcc/i686-pc-linux-gnu/4.2.3/include/g+±v4/cstdlib”, line 208: error:
name followed by “::” must be a class or namespace name
using ::__gnu_cxx::_Exit;
^

“/usr/lib/gcc/i686-pc-linux-gnu/4.2.3/include/g+±v4/cstdlib”, line 209: error:
name followed by “::” must be a class or namespace name
using ::__gnu_cxx::abs;
^
“/usr/lib/gcc/i686-pc-linux-gnu/4.2.3/include/g+±v4/cstdlib”, line 211: error:
name followed by “::” must be a class or namespace name
using ::__gnu_cxx::llabs;
^

“/usr/lib/gcc/i686-pc-linux-gnu/4.2.3/include/g+±v4/cstdlib”, line 212: error:
name followed by “::” must be a class or namespace name
using ::__gnu_cxx::div;
^

“/usr/lib/gcc/i686-pc-linux-gnu/4.2.3/include/g+±v4/cstdlib”, line 213: error:
name followed by “::” must be a class or namespace name
using ::__gnu_cxx::lldiv;
^

“/usr/lib/gcc/i686-pc-linux-gnu/4.2.3/include/g+±v4/cstdlib”, line 215: error:
name followed by “::” must be a class or namespace name
using ::__gnu_cxx::atoll;
^

“/usr/lib/gcc/i686-pc-linux-gnu/4.2.3/include/g+±v4/cstdlib”, line 216: error:
name followed by “::” must be a class or namespace name
using ::__gnu_cxx::strtof;
^

“/usr/lib/gcc/i686-pc-linux-gnu/4.2.3/include/g+±v4/cstdlib”, line 217: error:
name followed by “::” must be a class or namespace name
using ::__gnu_cxx::strtoll;
^

“/usr/lib/gcc/i686-pc-linux-gnu/4.2.3/include/g+±v4/cstdlib”, line 218: error:
name followed by “::” must be a class or namespace name
using ::__gnu_cxx::strtoull;
^

“/usr/lib/gcc/i686-pc-linux-gnu/4.2.3/include/g+±v4/cstdlib”, line 219: error:
name followed by “::” must be a class or namespace name
using ::__gnu_cxx::strtold;
^

86 errors detected in the compilation of “/tmp/tmpxft_00007f07_00000000-2.ii”.
make[1]: *** [obj/release/simpleTexture.cu_o] Error 255
make[1]: Leaving directory `/home/al/NVIDIA_CUDA_SDK/projects/simpleTexture’
make: *** [projects/simpleTexture/Makefile.ph_build] Error 2

I believe gcc 4.1 is supported in CUDA 1.1. You can check the releasenotes.

Well this means I should wait for 2.0, right :)

If one of the newly supported Linux distributions has gcc 4.2, yes, I am not sure.

Ok, thanks ;-)

Correct, gcc-4.2 isn’t supported for the CUDA_1.1 release. gcc-4.2 will be supported in the next release.

In between, if your distro is gcc-4.2 based you can either :

    [*] install a separate compiler compatible with CUDA (some distro offers older packages named “gcc-4.1”, you can also play around with other compilers like ICC)

    [*] or patch a few place to make the system work.

What I managed to patch to get it work - Two files to patch:[list=1]

[*]C++CONFIG.H[list=A]

[*]This files uses attribute (the modern day equivalent to #pragma) and for some reason, the compiler bundled in CUDA doesn’t degrade gracefully when it encounters unkown attributes as it should, even if it itself uses attributes for its own functions.

[*]Make a copy of this file. In SuSE 10.3, the original is located in /usr/include/c++/4.2.1/i586-suse-linux/bits/c++config.h

[*]Replace the “_VISIBILITY” macros from the copy so they they are empty (two declarations in the file).

[*]add a line in “cuda_runtime.h” so it includes your patched copy of the file.

[*]atomicity.h[list=A]

[*] This files uses GCC-4.2 specific extension for atomic operation (on the CPU. Nothing to do with CUDA’s atomic operations).

[*] Make a copy of the file. The original should be located in /usr/include/c++/4.2.1/ext/atomicity.h

[*] Remove the “#if” to force the code path that doesn’t use the atomic built-in.

[*] add a line in “cuda_runtime.h” so it includes your patched copy of the file.

[*] When compiling CUDA code, use “-D_GLIBCXX_GCC_GTHR_POSIX_H” to prevent GCC to load the gthreadw include and use the non-patched original “atomicity.h” preload the file.

Using that modification, I’m able to use CUDA on my gcc-4.2 based openSuSE 10.3