# linkage specification is incompatible with previous "hypot"

Hi all

I try to build a very simple cuda C# class using VS2010 or VS2008 with a empty test.cu kernel. I use Cuda.Net 3.0 and .Net 4.0

pre bild event is

nvcc “(ProjectDir)Kernel\test.cu" --cubin --output-directory "(ProjectDir)Kernel”

the class file also is empty

using System;
using System.Collections.Generic;
using System.Text;
using GASS.CUDA;
using GASS.CUDA.Types;

namespace CudaTest
{
public class test
{
}
}

But I got this error and I have no idea where it comes from.

Error 1 linkage specification is incompatible with previous “hypot” C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\INCLUDE\math.h
Error 2 linkage specification is incompatible with previous “hypotf” C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\INCLUDE\math.h
Error 3 function “abs(long long)” has already been defined d:\cuda\include\math_functions.h
Error 4 The command "nvcc “F:\projects\test\test\Kernel\conv.cu” --cubin --output-directory “F:\projects\test\test\Kernel”
" exited with code 2.

my OS is XP 64bit and installed VS208 and VS2010

Thanks

Hi there,

did you find a solution to your problem? I am receiving the exact same error while trying to compile CUDA/Matlab Mex code.

Best.

Ali

Hi there,

did you find a solution to your problem? I am receiving the exact same error while trying to compile CUDA/Matlab Mex code.

Best.

Ali

Try Jacket SDK for compiling MEX code in MATLAB.

Try Jacket SDK for compiling MEX code in MATLAB.

It sounds like math.h gets included for some reason and it conflicts with the CUDA headers as both define the same functions.

Are you using any other headers in the file?

You can try defining _MATH_H at the top of the file and see if that helps

It sounds like math.h gets included for some reason and it conflicts with the CUDA headers as both define the same functions.

Are you using any other headers in the file?

You can try defining _MATH_H at the top of the file and see if that helps