general purpose computations on GPU & VS.NET

Started by
3 comments, last by fyigit 19 years, 2 months ago
Hi... I am working with brook language to realize some general purpose computing on GPU... I compile my "mathlib.br" brook file with "brcc" brook compiler and get "mathlib.cpp" file after compilation. After I get "mathlib.cpp", I add it to my VS.NET project. But when I add "mathlib.cpp" to my project and then built, some link errors occured. Can you explain me how to add my "mathlib.cpp" file into my VS.NET project successfully... (what kind of arrangements do i have to make on the link properties of my project in VS.NET or anything like ) THANKS...
Advertisement
Quote:Can you explain me how to add my "mathlib.cpp" file into my VS.NET project successfully...


Just add it to the list of source files for the project. IIRC, right click in the project browser and select "add existing file".
"Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it." — Brian W. Kernighan
Oh I think I can not explain my problem briefly...

I add my "mathlib.cpp" file to my project by using "AddExistingItem". After I add, I try to built my project but it gives link errors. I arrange the paths but can not succedded :(

Is anyone try such a thing?

Thanks...
what are the linker errors?
simply my .cpp file is like that:

int oct=20;
float *Frequency;
float *Persistence;

int Cloud_main(int argc, char* argv[]) {

float P=0.5f;
int i;
int fin; //color info
int cidx; //index of a pixel

Frequency = (float*)malloc(oct*sizeof(float));
Persistence = (float*)malloc(oct*sizeof(float));

Frequency[0]= 0.05f;
Persistence[0]= 0.5f;

for(i=1; i<oct; i++)
{
Frequency = Frequency[i-1] * 2;
Persistence = Persistence[i-1] * P;
}

return 0;
}

after I add this file to my project and then built I hav got the following link errors:

LIBCD.lib(dbgheap.obj) : error LNK2005: _malloc already defined in MSVCRT.lib(MSVCR71.dll)

LIBCD.lib(dbgheap.obj) : error LNK2005: _free already defined in MSVCRT.lib(MSVCR71.dll)

LIBCD.lib(stdexcpt.obj) : error LNK2005: "public: __thiscall exception::exception(void)" (??0exception@@QAE@XZ) already defined in MSVCRT.lib(MSVCR71.dll)

LIBCD.lib(stdexcpt.obj) : error LNK2005: "public: __thiscall exception::exception(class exception const &)" (??0exception@@QAE@ABV0@@Z) already defined in MSVCRT.lib(MSVCR71.dll)

LIBCD.lib(stdexcpt.obj) : error LNK2005: "public: virtual __thiscall exception::~exception(void)" (??1exception@@UAE@XZ) already defined in MSVCRT.lib(MSVCR71.dll)

LIBCD.lib(stdexcpt.obj) : error LNK2005: "public: __thiscall bad_cast::bad_cast(char const *)" (??0bad_cast@@QAE@PBD@Z) already defined in MSVCRT.lib(MSVCR71.dll)

LIBCD.lib(stdexcpt.obj) : error LNK2005: "public: __thiscall bad_cast::bad_cast(class bad_cast const &)" (??0bad_cast@@QAE@ABV0@@Z) already defined in MSVCRT.lib(MSVCR71.dll)

LIBCD.lib(stdexcpt.obj) : error LNK2005: "public: virtual __thiscall bad_cast::~bad_cast(void)" (??1bad_cast@@UAE@XZ) already defined in MSVCRT.lib(MSVCR71.dll)

So what is the problem?

This topic is closed to new replies.

Advertisement