www.digitalmars.com         C & C++   DMDScript  

c++.windows.32-bits - Exporting MAIN for an DLL (VST instrument)

reply WilliamK <WilliamK_member pathlink.com> writes:
Hello, I hope someone could help me out. I'm trying to compile my latest work
with mars compiler. Is a VST Instrument. Basic, a DLL file with an EXPORT MAIN
on the DEF file. The problem is that I'm getting an error during final LINK. (it
compiles with no errors)

link
Main+VstSynthProc+VstSynthPar+VstSynthPresets+audioeffectx+AudioEffect+Chorus+DashMain+DelayFX+DelayL+Filter+LFO+Limiter+MidiNote+WvIn+ADSR,,,user32+kernel32,main/RC:resources/noi;

OPTLINK (R) for Win32  Release 7.50B1
Copyright (C) Digital Mars 1989 - 2001  All Rights Reserved

OPTLINK : Error 180: No Match Found for Export/ENTRY -  : main
OPTLINK : Warning 148: USE16/USE32 Mismatch : DGROUP
C:\TEMP\MARRS\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 : main
Main.obj(Main) 
Error 35: Cannot Reach TARGET from FRAME at Relative 00026H  from
Segment _TEXT
FRAME  = Frame of Group FLAT 0000
TARGET = External Symbol ??2 YAPAXI Z (void *cdecl new(unsigned )) 12AB0H 
FIXUPP Type = 32-bit Conditional JMP

--- errorlevel 4

Regards, WilliamK
Nov 22 2002
parent "Walter" <walter digitalmars.com> writes:
What does your .def file look like? It should contain the lines:

EXETYPE NT
SUBSYSTEM WINDOWS (or SUBSYSTEM CONSOLE)


Also, DLLs should not have a main() function, such will pull in the wrong
startup code. You'll need a dllmain().

"WilliamK" <WilliamK_member pathlink.com> wrote in message
news:arlrrj$tko$1 digitaldaemon.com...
 Hello, I hope someone could help me out. I'm trying to compile my latest
work
 with mars compiler. Is a VST Instrument. Basic, a DLL file with an EXPORT
MAIN
 on the DEF file. The problem is that I'm getting an error during final
LINK. (it
 compiles with no errors)

 link
Main+VstSynthProc+VstSynthPar+VstSynthPresets+audioeffectx+AudioEffect+Choru s+DashMain+DelayFX+DelayL+Filter+LFO+Limiter+MidiNote+WvIn+ADSR,,,user32+ker nel32,main/RC:resources/noi;
 OPTLINK (R) for Win32  Release 7.50B1
 Copyright (C) Digital Mars 1989 - 2001  All Rights Reserved

 OPTLINK : Error 180: No Match Found for Export/ENTRY -  : main
 OPTLINK : Warning 148: USE16/USE32 Mismatch : DGROUP
 C:\TEMP\MARRS\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 : main
 Main.obj(Main)
 Error 35: Cannot Reach TARGET from FRAME at Relative 00026H  from
 Segment _TEXT
 FRAME  = Frame of Group FLAT 0000
 TARGET = External Symbol ??2 YAPAXI Z (void *cdecl new(unsigned )) 12AB0H
 FIXUPP Type = 32-bit Conditional JMP

 --- errorlevel 4

 Regards, WilliamK
Nov 22 2002