#1
|
||||
|
||||
How create Static Library (lib) in delphi?
Hello everybody.
I have a delphi DLL code and want to create a LIB for it to use the code directly in my EXE in VC++. I don't want to have separate DLL file. I searched the net and could not find anything useful. Do you know the solution? I know there is a program named DLL2LIB, but I don't want to use it, as it's shareware (but cracked by myself). Best regards.
__________________
In memory of UnREal RCE... |
#2
|
|||
|
|||
Delphi cannot create *.LIB files. The only way to do something similar is to tell Delphi to generate C++ compatible *.OBJ files (check the "-J" command line switches) and link them. Delphi can only output to OMF format, not COFF. The best choice is probably to use C++ Builder instead of Visual C++.
Why don't you want to use DLLs? They don't have a real disadvantage and there are many programs available which "bundle" DLLs with the EXE files. |
The Following User Gave Reputation+1 to Kerlingen For This Useful Post: | ||
Newbie_Cracker (10-20-2011) |
#3
|
||||
|
||||
To minimize dependencies.
Assume that your patcher needs a DLL to play a chiptone!! It's so crazy to release a DLL and EXE for something like this.
__________________
In memory of UnREal RCE... |
#4
|
||||
|
||||
You'd rather use DLL2LIB. That's the way condzero is using the Delphi code of ARImpRec.dll (Delphi dll) in Armageddon (VC++) by the use of a .lib file generated by the tool, and this works fine.
Btw, to give compatibility to your exported functions in the Delphi dll, you have to give this name to all of them: <NameOfExportedFunction>@<NumberOfBytesInParameters> That is, if your function uses for instance 4 parameters of size dword, the number must be: SizeOf(dword) * 4 --> 16 So, the name of your exported function would be this: MyExportedFunction@16 Good luck with this! Nacho_dj
__________________
http://arteam.accessroot.com |
The Following User Gave Reputation+1 to Nacho_dj For This Useful Post: | ||
Newbie_Cracker (10-20-2011) |
#5
|
|||
|
|||
> Btw, to give compatibility to your exported functions in the Delphi dll, you have to give this name to all of them:
Don't forget that delphi compiles routines as fastcall, so it's better to set stdcall to all exports. I\m not sure that delphi fastcall == cl.exe fastcall. |
#6
|
|||
|
|||
Look at this old topic that may help you
or if being able to contact magic_h2001 and ask him about complete steps needed Code:
http://forum.exetools.com/showthread.php?t=11019 here is his website you may find his E-Mail address at the bottom of page |
#7
|
|||
|
|||
You can embedded your dll to resource section or data section, and use the MemoryModule to dynamic load it to memory, don't need to extract to a temp file.
MemoryModule here: https://github.com/fancycode/MemoryModule If someone uses Delphi, search for BTMemoryModule, a Delphi port form MemoryModule above. |
The Following User Gave Reputation+1 to TQN For This Useful Post: | ||
zementmischer (10-22-2011) |
#8
|
||||
|
||||
Quote:
__________________
In memory of UnREal RCE... |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
One Time API Redirection Library in Delphi (x86) | chessgod101 | Source Code | 0 | 11-23-2020 00:56 |
Static linking of Bassmod in Delphi | Sn!per X | Source Code | 0 | 01-13-2016 22:12 |
Base Encoding Library for Delphi | XorRanger | Source Code | 0 | 04-30-2015 15:37 |
Delphi Hook Library | Sir.V65j | Source Code | 0 | 09-08-2014 22:27 |