Code::Blocks Forums

User forums => Using Code::Blocks => Topic started by: rompelstilchen on May 14, 2007, 12:42:08 pm

Title: CPP DLLs ?
Post by: rompelstilchen on May 14, 2007, 12:42:08 pm
Hi,

I create a dll with codeblocks and everything works fine
as I change the main.c to main.cpp
then something go wrong and the programm supposed to load the dll get not compiled
It says at link time that it can't find -lsample library althought it is in the same rep

is it not possible to write dlls in cpp ? only in c ?
as I change back the name to main.c, it is still not working even if i do distclean on the dll and app project

any idea ?
thx
Title: Re: CPP DLLs ?
Post by: Biplab on May 14, 2007, 06:19:47 pm
is it not possible to write dlls in cpp ? only in c ?

It's possible to write a dll in C++. But a special wrapper is necessary to avoid name mangling issue. Do a Google search and you'll come to know how to do that.

Regards,

Biplab
Title: Re: CPP DLLs ?
Post by: raph on May 14, 2007, 07:37:55 pm
Be sure your exported stuff is defined with
Code
extern "C" __declspec(dllexport)

Regards
raph