BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

woes of .dll compiling....

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder (Command Line Tools)
View previous topic :: View next topic  
Author Message
peter
Guest





PostPosted: Wed Dec 03, 2003 4:29 pm    Post subject: woes of .dll compiling.... Reply with quote




i have 2 questions:
First, why is my makefile suddenly not generating a batch.lib?
Here is is:
BATCH=C:jdk1.3.1_09libjvm1.lib
OTSORT=c:sursprogramcbatchotsw321.lib

batch.dll: batch.obj $(BATCH)
ilink32 /Tpd/ap/Gn/x/Gl c0d32 batch,batch,,$(OTSORT) $(BATCH) import32 cw32

batch.obj: batch.c
bcc32 -IC:BorlandBcc55Include -LC:jdk1.3.1_09lib -LC:sursprogramcbatch -c -RT- -x- batch.c


Question 2:
I compiled my batch.dll using the above code. I then
linked it to a program cdsur030.c, using this makefile:

BATCH=C:jdk1.3.1_09libjvm1.lib
OTSORT=c:sursprogramcbatchotsw321.lib

batch.dll: batch.obj $(BATCH)
ilink32 /Tpd/ap/Gn/x/Gl c0d32 batch,batch,,$(OTSORT) $(BATCH) import32 cw32

batch.obj: batch.c
bcc32 -IC:BorlandBcc55Include -LC:jdk1.3.1_09lib -LC:sursprogramcbatch -c -RT- -x- batch.c

and I get the error that all the functions I call from
batch.dll are unresolved externals. What do i need to do
in order to call functions from batch? am i compiling the
batch.dll correctly? thanks.
Back to top
Ed Mulroy [TeamB]
Guest





PostPosted: Thu Dec 04, 2003 9:49 pm    Post subject: Re: woes of .dll compiling.... Reply with quote



Quote:
First, why is my makefile suddenly not generating a batch.lib?
Here is is:
BATCH=C:jdk1.3.1_09libjvm1.lib
OTSORT=c:sursprogramcbatchotsw321.lib

batch.dll: batch.obj $(BATCH)
ilink32 /Tpd/ap/Gn/x/Gl c0d32 batch,batch,,$(OTSORT)
$(BATCH) import32 cw32

I don't know. Try changing your commands following the batch.dll target to

ilink32 /Tpd/ap/Gn/x c0d32 batch,batch,,$(OTSORT) $(BATCH) import32 cw32
implib -c batch.dll batch.lib

Quote:
Question 2:
I compiled my batch.dll using the above code. I then
linked it to a program cdsur030.c, using this makefile:

You have a cut and paste error. No targets or commands related to a file
with the base name cdsur030.c are shown.

Quote:
and I get the error that all the functions I call from
batch.dll are unresolved externals. What do i need to do
in order to call functions from batch? am i compiling the
batch.dll correctly? thanks.

From what you show I cannot know the answer to that.

Change to the directory where batch.dll is located and give this command:

tdump -ee batch.dll | more

That will show you the exports. Pay special attention to the exact text,
case and extra characters.

Any exported function from a C file should be identified in the source code
with __declspec(dllexport). Did you do that? The function prototypes for
items imported should be identified with __declspec(dllimport). Did you do
that?

Here is a link to a zip file containing code. The code unpacks into several
directories, each of which has a deliberately simplistic hello world
program. There are console and GUI versions, both static linked and using a
DLL both implicitly linked and explicitly linked and built with batch files
or make files. Among the various versions it contains there should be at
least one that handles a DLL similarly to how you are trying to do things.

http://www.mulroy.org/hello.zip

.. Ed

Quote:
peter wrote in message
news:3fce1d91$1 (AT) newsgroups (DOT) borland.com...

i have 2 questions:
First, why is my makefile suddenly not generating a batch.lib?
Here is is:
BATCH=C:jdk1.3.1_09libjvm1.lib
OTSORT=c:sursprogramcbatchotsw321.lib

batch.dll: batch.obj $(BATCH)
ilink32 /Tpd/ap/Gn/x/Gl c0d32 batch,batch,,$(OTSORT) $(BATCH) import32
cw32

batch.obj: batch.c





bcc32 -IC:BorlandBcc55Include -LC:jdk1.3.1_09lib -LC:sursprogramcba
tch -c -RT- -x- batch.c
Quote:


Question 2:
I compiled my batch.dll using the above code. I then
linked it to a program cdsur030.c, using this makefile:

BATCH=C:jdk1.3.1_09libjvm1.lib
OTSORT=c:sursprogramcbatchotsw321.lib

batch.dll: batch.obj $(BATCH)
ilink32 /Tpd/ap/Gn/x/Gl c0d32 batch,batch,,$(OTSORT) $(BATCH) import32
cw32

batch.obj: batch.c





bcc32 -IC:BorlandBcc55Include -LC:jdk1.3.1_09lib -LC:sursprogramcba
tch -c -RT- -x- batch.c
Quote:

and I get the error that all the functions I call from
batch.dll are unresolved externals. What do i need to do
in order to call functions from batch? am i compiling the
batch.dll correctly? thanks.



Back to top
Maurice Barnum
Guest





PostPosted: Fri Dec 05, 2003 11:20 am    Post subject: Re: woes of .dll compiling.... Reply with quote



Quote:
First, why is my makefile suddenly not generating a batch.lib?
Here is is:
BATCH=C:jdk1.3.1_09libjvm1.lib
OTSORT=c:sursprogramcbatchotsw321.lib

batch.dll: batch.obj $(BATCH)
ilink32 /Tpd/ap/Gn/x/Gl c0d32 batch,batch,,$(OTSORT)
$(BATCH) import32 cw32

I don't know. Try changing your commands following the batch.dll target to

ilink32 /Tpd/ap/Gn/x c0d32 batch,batch,,$(OTSORT) $(BATCH) import32 cw32
implib -c batch.dll batch.lib

/Gi will cause ilink32 to create an import lib. the resulting import
lib will generally be smaller than the one created by implib and will
conveniently never accidentally be a "link by ordinal" lib.

/Gl is probably just a typo.

Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder (Command Line Tools) All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.