Re: Compiling a DLL? [message #53755] |
Wed, 02 May 2007 04:10 |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
Mark Hadfield writes:
> Believe it or not, I manged to build a DLL for IDL once. Thank you for
> posting your experiences so that I know not to bother trying in
> future. Oh, I'm sure I could sort it out if I really needed to, but
> life's too short for this sort of thing...
Well, darn, Mark. I had you pictured as a young man.
I didn't realize you were about my age. ;-)
Cheers,
David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
|
|
|
Re: Compiling a DLL? [message #53756 is a reply to message #53755] |
Tue, 01 May 2007 22:31  |
badjelly.witch
Messages: 27 Registered: May 2006
|
Junior Member |
|
|
Believe it or not, I manged to build a DLL for IDL once. Thank you for
posting your experiences so that I know not to bother trying in
future. Oh, I'm sure I could sort it out if I really needed to, but
life's too short for this sort of thing...
|
|
|
Re: Compiling a DLL? [message #53776 is a reply to message #53756] |
Mon, 30 April 2007 14:27  |
wclift01
Messages: 6 Registered: April 2007
|
Junior Member |
|
|
On Apr 29, 9:40 pm, "r...@rlkling.com" <r...@rlkling.com> wrote:
> Hi Bill,
>
> Using IDL_export.h is perfectly fine, but export.h should be in the
> directory above it (external).
>
> I just upgraded to version 8 also and I still haven't figured out all
> the compiler flags. But get the program depends.exe from microsoft
> and open up your dll. It will highlite any dll's it can't find and
> tell you where it looked. However, I just checked and msvcr80.dll is
> in the system32 directory on my machine, so maybe copying yours there
> might help.
>
> Ronn Kling
Ronn,
For some reason (server errors) I have not been able to post my reply
to the group, so for closure I wanted to let you know how things are
going....
Apparently the default 6.3 installation does not include the
external linking option which includes the export.h file. Checking
another machine with 6.1 the external linking option was included in
the default installation and the export.h file was where it should be.
Running depends.exe on my .dll quickly pointed out I also needed to
update RHTgrAABB.dll using IDL.lib vice IDL32.lib. Following the
update, depends.exe issues a warning "At least one module has an
unresolved import due to a missing export function in a delay-load
dependent module". I am assuming this is due to the .dll using the
stubs in the .dlm file (delay load?) and can be ignored. I also moved
my msvcr80.dll to my system32 directory as you recommended and that
eliminated the ""This application has failed to start because
MSVCR80.dll was not found." error message.
I now suspected my compile and link options were wrong so after
some research successfully used:
cl /LD /Gd -I "C:\RSI\IDL63\external" -I "C:\VC\RHTgrCamera" -nologo /
c /Tc C:\RHTgrCamera.c
and
link /out:"RHTgrCamera.dll" /nologo /nodefaultlib /dll
"RHTgrCamera.obj" /def:"C:\VC\RHTgrCamera.def" \RSI\IDL63\bin
\bin.x86\idl.lib msvcrt.lib kernel32.lib
Next, when I ran an application using the new .dll I was getting a
runtime error message "R6034 An application has made an attempt to
load the C runtime library incorrectly". Chasing down R6034 revealed
that I had not embedded a manifest(?) file in my .dll which can be
done by running mt.exe following after linking:
mt.exe -manifest RHTgrCamera.dll.manifest -
outputresource:RHTgrCamera.dll;2
Now everything works!
Many Thanks!
Bill
|
|
|
Re: Compiling a DLL? [message #53784 is a reply to message #53776] |
Sun, 29 April 2007 18:40  |
ronn
Messages: 123 Registered: April 1999
|
Senior Member |
|
|
Hi Bill,
Using IDL_export.h is perfectly fine, but export.h should be in the
directory above it (external).
I just upgraded to version 8 also and I still haven't figured out all
the compiler flags. But get the program depends.exe from microsoft
and open up your dll. It will highlite any dll's it can't find and
tell you where it looked. However, I just checked and msvcr80.dll is
in the system32 directory on my machine, so maybe copying yours there
might help.
Ronn Kling
|
|
|