Thread overview
dmdfe
Aug 13, 2005
Michael
Aug 13, 2005
Walter
Aug 13, 2005
Michael
Aug 13, 2005
M
Aug 13, 2005
Michael
August 13, 2005
Hi

I was trying to turn the dmd front end into a dll with an exported function, so I made the function dmdfeExport() in mars.c, and added a .def file with the contents:

EXPORTS
dmdfeExport

and referenced the .def in the makefile. But when linking I get the following message:

OPTLINK : Error 180: No Match Found for Export/ENTRY -  : dmdfeExport
OPTLINK : Warning 148: USE16/USE32 Mismatch : DGROUP
D:\dm\bin\..\lib\SNN.lib(constart)
Error 83: Illegal frame on start address
OPTLINK : Warning 174: 32-bit Segments Inappropriate for 16-bit Segmented output
OPTLINK : Error 81: Cannot EXPORT : dmdfeExport
dmd\access.obj(access)
Error 35: Cannot Reach TARGET from FRAME at Relative 00014H  from
Segment _TEXT
FRAME  = Frame of Group FLAT 0000
TARGET = External Symbol ?toParent@Dsymbol@@QAEPAU1@XZ (Dsymbol *syscall
Dsymbol::toParent(void ))
0B079H
FIXUPP Type = 32-bit Conditional JMP

Could someone tell me what I have to do to get it to find the exported function?


August 13, 2005
You need to tell the linker it's creating a 32 bit DLL. Add the lines:
    EXETYPE NT
    SUBSYSTEM WINDOWS
to your module definition file.


August 13, 2005
Thank you very much Walter.

I renamed the main() func (cos its not an exe anymore).

But now I have this problem where when its linking it cant find any of the win32 apis. Heres a sample:

dmd\root.obj(root)
Error 42: Symbol Undefined _FindClose@4
dmd\root.obj(root)
Error 42: Symbol Undefined _FindFirstFileA@8
dmd\root.obj(root)
Error 42: Symbol Undefined _CompareFileTime@8
dmd\root.obj(root)
Error 42: Symbol Undefined _FindNextFileA@8
dmd\root.obj(root)
Error 42: Symbol Undefined _DeleteFileA@4

Am I missing something?

In article <ddlcs6$bcm$2@digitaldaemon.com>, Walter says...
>
>You need to tell the linker it's creating a 32 bit DLL. Add the lines:
>    EXETYPE NT
>    SUBSYSTEM WINDOWS
>to your module definition file.
>
>


August 13, 2005
Ar my problem was that I wasnt linking with kernel32.lib :)

But now my problem is that the DLL runtime startup code/DLLMain() isnt being
called when the dll is loaded :(


In article <ddliii$fj1$1@digitaldaemon.com>, Michael says...
>
>Thank you very much Walter.
>
>I renamed the main() func (cos its not an exe anymore).
>
>But now I have this problem where when its linking it cant find any of the win32 apis. Heres a sample:
>
>dmd\root.obj(root)
>Error 42: Symbol Undefined _FindClose@4
>dmd\root.obj(root)
>Error 42: Symbol Undefined _FindFirstFileA@8
>dmd\root.obj(root)
>Error 42: Symbol Undefined _CompareFileTime@8
>dmd\root.obj(root)
>Error 42: Symbol Undefined _FindNextFileA@8
>dmd\root.obj(root)
>Error 42: Symbol Undefined _DeleteFileA@4
>
>Am I missing something?
>
>In article <ddlcs6$bcm$2@digitaldaemon.com>, Walter says...
>>
>>You need to tell the linker it's creating a 32 bit DLL. Add the lines:
>>    EXETYPE NT
>>    SUBSYSTEM WINDOWS
>>to your module definition file.
>>
>>
>
>


August 13, 2005
Ar my problem was that I wasnt linking with kernel32.lib :)

But now my problem is that the DLL runtime startup code/DLLMain() isnt being
called when the dll is loaded :(


In article <ddliii$fj1$1@digitaldaemon.com>, Michael says...
>
>Thank you very much Walter.
>
>I renamed the main() func (cos its not an exe anymore).
>
>But now I have this problem where when its linking it cant find any of the win32 apis. Heres a sample:
>
>dmd\root.obj(root)
>Error 42: Symbol Undefined _FindClose@4
>dmd\root.obj(root)
>Error 42: Symbol Undefined _FindFirstFileA@8
>dmd\root.obj(root)
>Error 42: Symbol Undefined _CompareFileTime@8
>dmd\root.obj(root)
>Error 42: Symbol Undefined _FindNextFileA@8
>dmd\root.obj(root)
>Error 42: Symbol Undefined _DeleteFileA@4
>
>Am I missing something?
>
>In article <ddlcs6$bcm$2@digitaldaemon.com>, Walter says...
>>
>>You need to tell the linker it's creating a 32 bit DLL. Add the lines:
>>    EXETYPE NT
>>    SUBSYSTEM WINDOWS
>>to your module definition file.
>>
>>
>
>