Watch, Follow, &
Connect with Us

For forums, blogs and more please visit our
Developer Tools Community.


Welcome, Guest
Guest Settings
Help

Thread: How to create a DLL with import library


This question is not answered. Helpful answers available: 2. Correct answers available: 1.


Permlink Replies: 1 - Last Post: Jun 12, 2014 5:56 AM Last Post By: david hoke
Matt McNabb

Posts: 21
Registered: 6/9/11
How to create a DLL with import library  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jun 11, 2014 9:10 PM
I am trying to build a DLL (actually OpenSSL 1.0.1h). The link command I am using is (pseudo filenames)

    ilink32 -q -Gi -aa -Tpd -x -Gn c0d32 alltheobjectfiles.obj , output.dll,,import32.lib cw32mt.lib, ms\libeay32.def


where "ms\libeay32.def" exists. However for every symbol in the def file I get :

    Warning: Attempt to export non-public symbol 'AES_ecb_encrypt'


and it creates an import library that is only a handful of bytes big, i.e. not what I am hoping to see.

The way the source code is set up, the functions are not marked with __declspec(dllexport), it's expected that the linker will be able to look at the DEF file and export those symbols.

Iis it possible with the Embarcadero commandline tools to achieve this (i.e. build a DLL where the list of exported functions is in a file; without individually marking __declspec(dllexport) on every function to be exported) ?
david hoke

Posts: 616
Registered: 2/9/07
Re: How to create a DLL with import library [Edit]  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jun 12, 2014 5:56 AM   in response to: Matt McNabb in response to: Matt McNabb
<Matt McNabb> wrote in message news:680179 at forums dot embarcadero dot com...
I am trying to build a DLL (actually OpenSSL 1.0.1h). The link command I am
using is (pseudo filenames)

   ilink32 -q -Gi -aa -Tpd -x -Gn c0d32 alltheobjectfiles.obj , 
output.dll,,import32.lib cw32mt.lib, ms\libeay32.def


where "ms\libeay32.def" exists. However for every symbol in the def file I
get :

   Warning: Attempt to export non-public symbol 'AES_ecb_encrypt'


and it creates an import library that is only a handful of bytes big, i.e.
not what I am hoping to see.

The way the source code is set up, the functions are not marked with
__declspec(dllexport), it's expected that the linker will be able to look
at the DEF file and export those symbols.

Iis it possible with the Embarcadero commandline tools to achieve this
(i.e. build a DLL where the list of exported functions is in a file;
without individually marking __declspec(dllexport) on every function to be
exported) ?

Seems to be doable with bds2006.

May need to either compile source with -u-, or add '_' (underscore) to
beginning of symbols in the def file.

Might try playing with the following:
file trial1.def:
LIBRARY TRIAL1
EXPORTS

func1
_func1

file trial1.c:

int func1(int a)
{
return a + 1 ;
}

commandset1:
bcc32 -c trial1.c
ilink32 -Gi trial1.obj,trial1.dll,,,trial1.def,
tdump trial1.lib

commandset2:
bcc32 -c -u- trial1.c
ilink32 -Gi trial1.obj,trial1.dll,,,trial1.def,
tdump trial1.lib

Legend
Helpful Answer (5 pts)
Correct Answer (10 pts)

Server Response from: ETNAJIVE02