User forums > Using Code::Blocks

CPP DLLs ?

(1/1)

rompelstilchen:
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

Biplab:

--- Quote from: rompelstilchen on May 14, 2007, 12:42:08 pm ---is it not possible to write dlls in cpp ? only in c ?

--- End quote ---

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

raph:
Be sure your exported stuff is defined with

--- Code: ---extern "C" __declspec(dllexport)
--- End code ---

Regards
raph

Navigation

[0] Message Index

Go to full version