Sign in to follow this  
fyigit

general purpose computations on GPU & VS.NET

Recommended Posts

fyigit    122
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...

Share this post


Link to post
Share on other sites
Fruny    1658
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".

Share this post


Link to post
Share on other sites
fyigit    122
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...

Share this post


Link to post
Share on other sites
fyigit    122
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[i] = Frequency[i-1] * 2;
Persistence[i] = 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?

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this