Dne 20.12.2011 2:22, Andrej Mitrovic napsal(a):
test.cpp: http://www.ideone.com/uh7vN
DLibrary.d: http://www.ideone.com/fOLN8
$ g++ test.cpp
$ dmd -ofDLibrary.dll DLibrary.d
$ a.exe
$ 9
Hi, Andrej,
you are right, this works. Problem is going to be either in VisualD or
cv2pdb.
For those
I'd say make a small test-case and file it to visuald's bugtracker.
Hello everyone,
I would like to ask you about linking D shared objects (.dll and .so)
from a C++ program.
Say I have this C++ loader:
typedef int (*MagicFunction) ();
HMODULE handle = LoadLibraryA(DLibrary.dll);
if (handle)
{
MagicFunction fn = (MagicFunction) GetProcAddress(handle,
Check if GetProcAddress returns null? It seems to me you're looking
for _magicFunction but defining magicNumber, two different names.
On 19/12/2011 18:01, Andrej Mitrovic wrote:
Check if GetProcAddress returns null? It seems to me you're looking
for _magicFunction but defining magicNumber, two different names.
that's be it. can't remember the rules for whether it will have a
leading underscore, but you can always use
Dne 19.12.2011 19:39, Simon napsal(a):
On 19/12/2011 18:01, Andrej Mitrovic wrote:
Check if GetProcAddress returns null? It seems to me you're looking
for _magicFunction but defining magicNumber, two different names.
that's be it. can't remember the rules for whether it will have a
leading
It actualy returns a procedure address and the procedure is called. It
lands inside export extern (C) int magicNumber() and crashes when
attempting to allocate memory for Something.
Did you properly initialize druntime?
Dne 19.12.2011 23:09, Trass3r napsal(a):
It actualy returns a procedure address and the procedure is called. It
lands inside export extern (C) int magicNumber() and crashes when
attempting to allocate memory for Something.
Did you properly initialize druntime?
As I am just starting with D,
Am 19.12.2011, 23:13 Uhr, schrieb Martin Drašar dra...@ics.muni.cz:
Dne 19.12.2011 23:09, Trass3r napsal(a):
It actualy returns a procedure address and the procedure is called. It
lands inside export extern (C) int magicNumber() and crashes when
attempting to allocate memory for Something.
Dne 20.12.2011 0:02, Trass3r napsal(a):
Am 19.12.2011, 23:13 Uhr, schrieb Martin Drašar dra...@ics.muni.cz:
Dne 19.12.2011 23:09, Trass3r napsal(a):
It actualy returns a procedure address and the procedure is called. It
lands inside export extern (C) int magicNumber() and crashes when
test.cpp: http://www.ideone.com/uh7vN
DLibrary.d: http://www.ideone.com/fOLN8
$ g++ test.cpp
$ dmd -ofDLibrary.dll DLibrary.d
$ a.exe
$ 9
11 matches
Mail list logo