www.digitalmars.com         C & C++   DMDScript  

c++.command-line - a sample makefile to build a DLL

reply Nicky <Nicky_member pathlink.com> writes:
How to build a dll with makefile? Could anyone give me a sample?
Sep 28 2003
parent reply "Walter" <walter digitalmars.com> writes:
"Nicky" <Nicky_member pathlink.com> wrote in message
news:bl6jug$22tt$1 digitaldaemon.com...
 How to build a dll with makefile? Could anyone give me a sample?

Here's one I use to build a dll that plugs into cooledit: -------------------------------------------------- targets: distort.dll distort.obj : distort.c dmc -c distort distort.res : distort.rc distort.bmp rc /r /i\dm\mfc\include distort.rc distort.dll : distort.obj distort.res link distort,distort.dll,,kernel32+user32,distort.def,distort.res; clean : del *.obj del *.res del *.map --------------------------------------------
Sep 28 2003
next sibling parent Nicky <Nicky_member pathlink.com> writes:
In article <bl76es$2qcv$1 digitaldaemon.com>, Walter says...
"Nicky" <Nicky_member pathlink.com> wrote in message
news:bl6jug$22tt$1 digitaldaemon.com...
 How to build a dll with makefile? Could anyone give me a sample?

Here's one I use to build a dll that plugs into cooledit: -------------------------------------------------- targets: distort.dll distort.obj : distort.c dmc -c distort distort.res : distort.rc distort.bmp rc /r /i\dm\mfc\include distort.rc distort.dll : distort.obj distort.res link distort,distort.dll,,kernel32+user32,distort.def,distort.res; clean : del *.obj del *.res del *.map --------------------------------------------

Thanks for the makefile. Now I'm having another trouble to link my dll with definition file (happen too when it's just blank inside). Error 35: Cannot Reach TARGET from FRAME at Relative 00021H from Segment _TEXT FRAME = Frame of Group FLAT 0000 TARGET = External Symbol _strcmp 01624H FIXUPP Type = 32-bit Conditional JMP It doesn't happen when I don't link my dll file with definition file.
Sep 29 2003
prev sibling parent reply Nicky <Nicky_member pathlink.com> writes:
In article <bl76es$2qcv$1 digitaldaemon.com>, Walter says...
"Nicky" <Nicky_member pathlink.com> wrote in message
news:bl6jug$22tt$1 digitaldaemon.com...
 How to build a dll with makefile? Could anyone give me a sample?

Here's one I use to build a dll that plugs into cooledit: -------------------------------------------------- targets: distort.dll distort.obj : distort.c dmc -c distort distort.res : distort.rc distort.bmp rc /r /i\dm\mfc\include distort.rc distort.dll : distort.obj distort.res link distort,distort.dll,,kernel32+user32,distort.def,distort.res; clean : del *.obj del *.res del *.map --------------------------------------------

Thanks for the makefile, it's works nice. Now I'm having trouble to link my dll with definition file (happen too when it's blank inside). Error messages: OPTLINK : Warning 148: USE16/USE32 Mismatch : DGROUP C:\dm\bin\..\lib\SNN.lib(dllstart) Error 83: Illegal frame on start address OPTLINK : Warning 174: 32-bit Segments Inappropriate for 16-bit Segmented output botaim_mm.obj(botaim_mm) Error 35: Cannot Reach TARGET from FRAME at Relative 00021H from Segment _TEXT FRAME = Frame of Group FLAT 0000 TARGET = External Symbol _strcmp 01624H FIXUPP Type = 32-bit Conditional JMP --- errorlevel 2 It won't happen when I don't link my dll with definition file. My definition file looks like: LIBRARY botaim_mm EXPORTS GiveFnptrsToDll = GiveFnptrsToDll 8
Sep 29 2003
parent "Walter" <walter digitalmars.com> writes:
"Nicky" <Nicky_member pathlink.com> wrote in message
news:bl8sj1$24k0$1 digitaldaemon.com...
 OPTLINK : Warning 148: USE16/USE32 Mismatch : DGROUP
 C:\dm\bin\..\lib\SNN.lib(dllstart)
 Error 83: Illegal frame on start address
 OPTLINK : Warning 174: 32-bit Segments Inappropriate for 16-bit Segmented

That means something in your def file is saying 16 bits, but your .obj files are 32 bits.
 My definition file looks like:

 LIBRARY botaim_mm
 EXPORTS
 GiveFnptrsToDll = GiveFnptrsToDll 8

Add: EXETYPE NT SUBSYSTEM WINDOWS
Sep 29 2003