Я сам не большой программист на C / C ++, но мне было поручено создать программу Deconvolution, используемую в моей лаборатории.
Вот жалоба, которую я получаю:
[ 10%] Building (Device) NVCC /home/chris/Desktop/Clarity-1.0/src/WienerDeconvolveGPU.cu: /home/chris/Desktop/Clarbuild/src/cuda/src/WienerDeconvolveGPU.cu_Clarity_generated.cpp
[ 13%] Building CXX object CMakeFiles/Clarity.dir/src/WienerDeconvolve.o
/home/chris/Desktop/Clarity-1.0/src/WienerDeconvolve.cxx: In function ‘ClarityResult_t Clarity_WienerDeconvolve(float*, Clarity_Dim3, float*, Clarity_Dim3, float*, float)’:
/home/chris/Desktop/Clarity-1.0/src/WienerDeconvolve.cxx:211: error: ‘malloc’ was not declared in this scope
/home/chris/Desktop/Clarity-1.0/src/WienerDeconvolve.cxx:246: error: ‘free’ was not declared in this scope
make[2]: *** [CMakeFiles/Clarity.dir/src/WienerDeconvolve.o] Error 1
make[1]: *** [CMakeFiles/Clarity.dir/all] Error 2
make: *** [all] Error 2
Нормальное решение, которое я нашел, это вставить #include cstlib в код, WienerDeconvolve.cxx, но когда я это делаювот, это происходит:
[ 2%] Building CXX object CMakeFiles/Clarity.dir/src/WienerDeconvolve.o
Linking CXX static library libClarity.a
[ 89%] Built target Clarity
Linking CXX executable ConvolutionTest
[ 92%] Built target ConvolutionTest
Linking CXX executable JansenVanCittertTest
[ 94%] Built target JansenVanCittertTest
Linking CXX executable MaximumLikelihoodTest
[ 97%] Built target MaximumLikelihoodTest
Linking CXX executable WienerFilterTest
../../libClarity.a(WienerDeconvolve.o): In function `ComplexConjugate(float2)':
WienerDeconvolve.cxx:(.text+0x2a0): multiple definition of `ComplexConjugate(float2)'
../../libClarity.a(FFTGPU.cu_Clarity_generated.o):FFTGPU.cu_Clarity_generated.cpp:(.text+0x0): first defined here
../../libClarity.a(WienerDeconvolve.o): In function `ComplexAdd(float2, float2)':
WienerDeconvolve.cxx:(.text+0x2c6): multiple definition of `ComplexAdd(float2, float2)'
../../libClarity.a(FFTGPU.cu_Clarity_generated.o):FFTGPU.cu_Clarity_generated.cpp:(.text+0x24): first defined here
../../libClarity.a(WienerDeconvolve.o): In function `ComplexMultiply(float2, float2)':
WienerDeconvolve.cxx:(.text+0x300): multiple definition of `ComplexMultiply(float2, float2)'
../../libClarity.a(FFTGPU.cu_Clarity_generated.o):FFTGPU.cu_Clarity_generated.cpp:(.text+0x54): first defined here
../../libClarity.a(WienerDeconvolve.o): In function `ComplexScale(float2, float)':
WienerDeconvolve.cxx:(.text+0x34e): multiple definition of `ComplexScale(float2, float)'
../../libClarity.a(FFTGPU.cu_Clarity_generated.o):FFTGPU.cu_Clarity_generated.cpp:(.text+0x84): first defined here
../../libClarity.a(WienerDeconvolve.o): In function `ComplexMultiplyAndScale(float2, float2, float)':
WienerDeconvolve.cxx:(.text+0x378): multiple definition of `ComplexMultiplyAndScale(float2, float2, float)'
../../libClarity.a(FFTGPU.cu_Clarity_generated.o):FFTGPU.cu_Clarity_generated.cpp:(.text+0xa8): first defined here
../../libClarity.a(WienerDeconvolve.o): In function `ComplexMagnitudeSquared(float2)':
WienerDeconvolve.cxx:(.text+0x3ed): multiple definition of `ComplexMagnitudeSquared(float2)'
../../libClarity.a(FFTGPU.cu_Clarity_generated.o):FFTGPU.cu_Clarity_generated.cpp:(.text+0xd8): first defined here
../../libClarity.a(WienerDeconvolveGPU.cu_Clarity_generated.o): In function `ComplexConjugate(float2)':
WienerDeconvolveGPU.cu_Clarity_generated.cpp:(.text+0x0): multiple definition of `ComplexConjugate(float2)'
../../libClarity.a(FFTGPU.cu_Clarity_generated.o):FFTGPU.cu_Clarity_generated.cpp:(.text+0x0): first defined here
../../libClarity.a(WienerDeconvolveGPU.cu_Clarity_generated.o): In function `ComplexAdd(float2, float2)':
WienerDeconvolveGPU.cu_Clarity_generated.cpp:(.text+0x24): multiple definition of `ComplexAdd(float2, float2)'
../../libClarity.a(FFTGPU.cu_Clarity_generated.o):FFTGPU.cu_Clarity_generated.cpp:(.text+0x24): first defined here
../../libClarity.a(WienerDeconvolveGPU.cu_Clarity_generated.o): In function `ComplexMultiply(float2, float2)':
WienerDeconvolveGPU.cu_Clarity_generated.cpp:(.text+0x54): multiple definition of `ComplexMultiply(float2, float2)'
../../libClarity.a(FFTGPU.cu_Clarity_generated.o):FFTGPU.cu_Clarity_generated.cpp:(.text+0x54): first defined here
../../libClarity.a(WienerDeconvolveGPU.cu_Clarity_generated.o): In function `ComplexScale(float2, float)':
WienerDeconvolveGPU.cu_Clarity_generated.cpp:(.text+0x84): multiple definition of `ComplexScale(float2, float)'
../../libClarity.a(FFTGPU.cu_Clarity_generated.o):FFTGPU.cu_Clarity_generated.cpp:(.text+0x84): first defined here
../../libClarity.a(WienerDeconvolveGPU.cu_Clarity_generated.o): In function `ComplexMultiplyAndScale(float2, float2, float)':
WienerDeconvolveGPU.cu_Clarity_generated.cpp:(.text+0xa8): multiple definition of `ComplexMultiplyAndScale(float2, float2, float)'
../../libClarity.a(FFTGPU.cu_Clarity_generated.o):FFTGPU.cu_Clarity_generated.cpp:(.text+0xa8): first defined here
../../libClarity.a(WienerDeconvolveGPU.cu_Clarity_generated.o): In function `ComplexMagnitudeSquared(float2)':
WienerDeconvolveGPU.cu_Clarity_generated.cpp:(.text+0xd8): multiple definition of `ComplexMagnitudeSquared(float2)'
../../libClarity.a(FFTGPU.cu_Clarity_generated.o):FFTGPU.cu_Clarity_generated.cpp:(.text+0xd8): first defined here
collect2: ld returned 1 exit status
make[2]: *** [tests/WienerFilterTest/WienerFilterTest] Error 1
make[1]: *** [tests/WienerFilterTest/CMakeFiles/WienerFilterTest.dir/all] Error 2
make: *** [all] Error 2
Это довольно большой проект, и поэтому для меня это несколько пугающие ошибки.Кто-нибудь знает, в чем может быть проблема?Многие скомпилировали это, и это было проверено на RedHat.После того, как я возился с этим несколько дней, у меня заканчиваются идеи, но я буду рад предоставить любую информацию, которая может помочь.