www.digitalmars.com         C & C++   DMDScript  

c++.command-line - How do I build and use my own dll????

reply Wayne <Wayne_member pathlink.com> writes:
For several hours now I have been attempting to use the command line tools to
build and test my own dll with little success.  I am able to compile X.dll as I
see the file is created but if I run "implib X.lib X.dll" to create the import
library, implib tells me there are no exported functions.  I am writing in C and
have prefixed the function with
__descspec(dllexport)

When I try to link the dll with a small test C program I get the error message:
Error 42: Symbol Undefined _FunctionNameHere

Can anyone help with this?
May 13 2003
next sibling parent Jan Knepper <jan smartsoft.us> writes:
Did you compile with -WD ?

Wayne wrote:

 For several hours now I have been attempting to use the command line tools to
 build and test my own dll with little success.  I am able to compile X.dll as I
 see the file is created but if I run "implib X.lib X.dll" to create the import
 library, implib tells me there are no exported functions.  I am writing in C
and
 have prefixed the function with
 __descspec(dllexport)

 When I try to link the dll with a small test C program I get the error message:
 Error 42: Symbol Undefined _FunctionNameHere

 Can anyone help with this?
-- ManiaC++ Jan Knepper
May 13 2003
prev sibling next sibling parent "Matthew Wilson" <matthew stlsoft.org> writes:
Post your source, and your exact cmd-line(s), and we'll take a look

If there's any valuable IP in the source, just chop it out from the
functions and leave them as shells. But do leave the functions in. :)

"Wayne" <Wayne_member pathlink.com> wrote in message
news:b9rvv3$2lpu$1 digitaldaemon.com...
 For several hours now I have been attempting to use the command line tools
to
 build and test my own dll with little success.  I am able to compile X.dll
as I
 see the file is created but if I run "implib X.lib X.dll" to create the
import
 library, implib tells me there are no exported functions.  I am writing in
C and
 have prefixed the function with
 __descspec(dllexport)

 When I try to link the dll with a small test C program I get the error
message:
 Error 42: Symbol Undefined _FunctionNameHere

 Can anyone help with this?
May 21 2003
prev sibling parent starkweatherr mchsi.com writes:
I've been able to create a working DLL from the DMCDLL sample code with no
problem, but when I try to call the DLL from VB I get an error message: Error 49
Bad DLL calling convention.

I tried 30-40 times and can't remember exactly what changes I made, and I can't
find the command line commands that I used, but dmctest.exe produces the
expected results.

I don't want to know anything about DLLs except how to create one that can be
used by VB to add two integers. I don't wnat to know anything about the linker
or impdef other than what command line switches to use. I don't want to buy any
books that have one paragraph that will be of use to me.

Does anyone have any suitable source code?
Mar 17 2006