DLL

Just starting out? Need help? Post your questions and find answers here.
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by dmoc.

I have coded a dll that works as required. My next step is to use it as an add-in to another product. The documentation for the product assumes you are writing add-ins in C/C++ and states that add-in programs have to be linked to a supplied object file (no source) so that things are initialised correctly. Could Fred or someone tell if it's possible to do the linking with PB/NASM and if so what the procedure is? I would be most grateful.
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by fred.

it's thoerically possible, but PB doesn't offer the functionnality. Better link your .o with the DLL if possible..

Fred - AlphaSND
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by Danilo.

Writing a PureBasic library (.lib+.desc) that includes your .OBJ
file could be a solution.
If you make 1 dummy command like InitThis() which only is a RET,
this PB library is included in the linking process and your .OBJ
is also included.

If you are doing this for Linux, chances are bad without the
Library SDK.

Another way you can try is to make a wrapper for the linker.
Rename the linker to linker_old and write a little linker-wrapper
that catches the commandline, add your .OBJ to this string and
call the original linker_old from your tool.

Of course the needed init routines from the .OBJ
must be called anywhere in your PureBasic project.

cya,
...Danilo

(registered PureBasic user)
Post Reply