Hello,
I try to inherit a class in my cuda class. Here is my mother class:
class BB
{
public:
BB(int iwidth,int iheight)
{}
~BB()
{}
};
class BBCPU:public BB
{
public:
BBCPU(int iwidth,int iheight):
BB(iwidth,iheight)
{
};
~BBCPU()
{}
};
class BBGPU:public BB
{
public:
BBGPU(int iwidth,int iheight):
BB(iwidth,iheight)
{
}
~BBGPU()
{
}
};
Here is the code where I use this header file:
BBProd.h:
#include "../include/BB.h"
namespace gpu {
class BBGPU_Prod:public BBGPU
{
public:
BBGPU_Prod(int iwidth,int iheight);
~BBGPU_Prod();
};
}
And my cu file:
#include "BB.h"
namespace gpu {
BBGPU_Prod::BBGPU_Prod(int iwidth,int iheight):
BBGPU(iwidth,iheight)
{
}
BBGPU_Prod::~BBGPU_Prod()
{
// free device memory
std::cout << "Destroy BBGPU_Prod " << std::endl;
}
And the compilation result send me that:
BB_cuda.o : Dans la fonction « __sti____cudaRegisterAll_58_tmpxft_0000729b_00000000_10_BB_compute_52_cpp1_ii_cfe1355d() » :
tmpxft_0000729b_00000000-7_BB.compute_50.cudafe1.cpp:(.text+0x127) : référence indéfinie vers « __cudaRegisterLinkedBinary_58_tmpxft_0000729b_00000000_10_BB_compute_52_cpp1_ii_cfe1355d »
Makefile:261 : la recette pour la cible « Prog » a échouée
collect2: error: ld returned 1 exit status
make: *** [Prog] Erreur 1
11:12:27: Le processus "/usr/bin/make" s'est terminé avec le code 2.
Erreur lors de la compilation/déploiement du projet Prog (kit : Desktop Qt 5.7.0 GCC 64bit)
When executing step "Make"
11:12:27: Temps écoulé : 00:37.
I don’t understand why this append.