D - Linking question
- Charles Sanders (10/10) Dec 06 2003 Hey all,
- one_mad_alien hotmail.com (27/37) Dec 06 2003 I tried some time ago to compile a lib with WinMain that expected and ex...
- Charles Sanders (19/59) Dec 07 2003 hmm ok.
- Charles Sanders (29/99) Dec 07 2003 Actually it seems to work now , i had a static constructor that was
- Georg Wrede (5/12) Dec 07 2003 Isn't the existence of a WinMain a Windows specific thing? I mean,
Hey all, I have a library that I want to compile that _has_ a WinMain () , and then just have the user compile a 'mainless' program with the compiler , is this possible ? Im having some undefined mess with it running, if you download http://www.atari-soldiers.com/windy.zip it has makefiles that will build it, If i compile them all together ( windy.exe ) it runs as expected, but if i compile Windy as a lib, then compile the main.d and link to the lib (windy_lib_main.exe) , it fails with Access Violation. Please any help is appreciated thanks! C
Dec 06 2003
In article <bqtj93$mtd$1 digitaldaemon.com>, Charles Sanders says...Hey all, I have a library that I want to compile that _has_ a WinMain () , and then just have the user compile a 'mainless' program with the compiler , is this possible ? Im having some undefined mess with it running, if you download http://www.atari-soldiers.com/windy.zip it has makefiles that will build it, If i compile them all together ( windy.exe ) it runs as expected, but if i compile Windy as a lib, then compile the main.d and link to the lib (windy_lib_main.exe) , it fails with Access Violation. Please any help is appreciated thanks! CI tried some time ago to compile a lib with WinMain that expected and external DFC_main ... but it all failed ... the linker seems to expect Main/WinMain to be in an object file not one of the included libs. I get that Access Violation lots if I add/remove a member from an included d file that is in a lib, but forget to recompile the lib (the depends in my make file do not cover imports) check that you are not compiling the lib as debug and the main as release its late and I'm going to bed soon, but here is the examples from my make file DMD=c:/dmd/bin/dmd.exe DMC=c:/dm/bin/dmc.exe DMLIB=c:/dm/bin/lib.exe LINK=c:/dm/bin/link.exe SC=c:/dm/bin/sc.exe DOPTS=-c -release -O DFLAGS= $(DOPTS) -I./src export DFLAGS DLIBS=phobos.lib snn.lib gc.lib GDI32.LIB KERNEL32.LIB USER32.LIB UUID.LIB CTL3D32.LIB COMDLG32.LIB COMCTL32.LIB ADVAPI32.LIB OLE32.LIB OLEAUT32.LIB explorer) $(BIN_DIR)/$(PROJECT_NAME).exe : $(LIB_DEPENDS) $(PROJ_OBJS) $(LINK) $(OBJS_TO_LINK),$(BIN_DIR)\$(PROJECT_NAME),,$(LIBS_TO_LINK)/noi $(BIN_DIR)/$(PROJECT_NAME).win.exe: $(BIN_DIR)/$(PROJECT_NAME).exe $(LINK) $(OBJS_TO_LINK),$(BIN_DIR)\$(PROJECT_NAME).win.exe,$(BIN_DIR)\$(PROJECT_NAME).win.map,$(LIBS_TO_LINK),app.def/noi
Dec 06 2003
hmm ok. Walter can we get a definitive 'no that is in no way possible', or a 'yes with some massaging' ? C <one_mad_alien hotmail.com> wrote in message news:bqu13f$1han$1 digitaldaemon.com...In article <bqtj93$mtd$1 digitaldaemon.com>, Charles Sanders says...thenHey all, I have a library that I want to compile that _has_ a WinMain () , andthisjust have the user compile a 'mainless' program with the compiler , isdownloadpossible ? Im having some undefined mess with it running, if youit,http://www.atari-soldiers.com/windy.zip it has makefiles that will buildiIf i compile them all together ( windy.exe ) it runs as expected, but ifiscompile Windy as a lib, then compile the main.d and link to the lib (windy_lib_main.exe) , it fails with Access Violation. Please any helpexternalappreciated thanks! CI tried some time ago to compile a lib with WinMain that expected andDFC_main ... but it all failed ... the linker seems to expect Main/WinMainto bein an object file not one of the included libs. I get that Access Violation lots if I add/remove a member from an includeddfile that is in a lib, but forget to recompile the lib (the depends in mymakefile do not cover imports) check that you are not compiling the lib as debug and the main as release its late and I'm going to bed soon, but here is the examples from my makefileDMD=c:/dmd/bin/dmd.exe DMC=c:/dm/bin/dmc.exe DMLIB=c:/dm/bin/lib.exe LINK=c:/dm/bin/link.exe SC=c:/dm/bin/sc.exe DOPTS=-c -release -O DFLAGS= $(DOPTS) -I./src export DFLAGS DLIBS=phobos.lib snn.lib gc.lib GDI32.LIB KERNEL32.LIB USER32.LIB UUID.LIB CTL3D32.LIB COMDLG32.LIB COMCTL32.LIB ADVAPI32.LIB OLE32.LIB OLEAUT32.LIB explorer) $(BIN_DIR)/$(PROJECT_NAME).exe : $(LIB_DEPENDS) $(PROJ_OBJS) $(LINK) $(OBJS_TO_LINK),$(BIN_DIR)\$(PROJECT_NAME),,$(LIBS_TO_LINK)/noi $(BIN_DIR)/$(PROJECT_NAME).win.exe: $(BIN_DIR)/$(PROJECT_NAME).exe $(LINK)$(OBJS_TO_LINK),$(BIN_DIR)\$(PROJECT_NAME).win.exe,$(BIN_DIR)\$(PROJECT_NAME ).win.map,$(LIBS_TO_LINK),app.def/noi
Dec 07 2003
Actually it seems to work now , i had a static constructor that was assigning a value to a static member of another class, i moved that into its own static constructor and somehow it seems to work ( using a WinMain in a lib, having the user link in an object file ) . Im creating some docs right now, only bad thing about the lib is manual placement ( ye old grid system ) of the controls , which I dont think will be a problem given a good resizing system and dialog editor ( using native code none of that .rc crap ). Im putting it up at http://www.atari-soldiers.com/gpage.html1.html . Its very easy to use and even easier to extend, everything's just a Window so you can do whatever you like, and with some manipulation you can even create floating controls on the desktop . P.S. its not complete, im still wrapping some of the controls but expect a usable version within a week or so. Could anyone reading this download it and report build problems ? Thanks C "Charles Sanders" <sanders-consulting comcast.net> wrote in message news:br0f0r$273d$1 digitaldaemon.com...hmm ok. Walter can we get a definitive 'no that is in no way possible', or a 'yes with some massaging' ? C <one_mad_alien hotmail.com> wrote in message news:bqu13f$1han$1 digitaldaemon.com...buildIn article <bqtj93$mtd$1 digitaldaemon.com>, Charles Sanders says...thenHey all, I have a library that I want to compile that _has_ a WinMain () , andthisjust have the user compile a 'mainless' program with the compiler , isdownloadpossible ? Im having some undefined mess with it running, if youhttp://www.atari-soldiers.com/windy.zip it has makefiles that willit,ifIf i compile them all together ( windy.exe ) it runs as expected, butiMain/WinMainiscompile Windy as a lib, then compile the main.d and link to the lib (windy_lib_main.exe) , it fails with Access Violation. Please any helpexternalappreciated thanks! CI tried some time ago to compile a lib with WinMain that expected andDFC_main ... but it all failed ... the linker seems to expectto beincludedin an object file not one of the included libs. I get that Access Violation lots if I add/remove a member from andmyfile that is in a lib, but forget to recompile the lib (the depends inmakereleasefile do not cover imports) check that you are not compiling the lib as debug and the main asmakeits late and I'm going to bed soon, but here is the examples from myfileUUID.LIBDMD=c:/dmd/bin/dmd.exe DMC=c:/dm/bin/dmc.exe DMLIB=c:/dm/bin/lib.exe LINK=c:/dm/bin/link.exe SC=c:/dm/bin/sc.exe DOPTS=-c -release -O DFLAGS= $(DOPTS) -I./src export DFLAGS DLIBS=phobos.lib snn.lib gc.lib GDI32.LIB KERNEL32.LIB USER32.LIBOLEAUT32.LIBCTL3D32.LIB COMDLG32.LIB COMCTL32.LIB ADVAPI32.LIB OLE32.LIB$(OBJS_TO_LINK),$(BIN_DIR)\$(PROJECT_NAME).win.exe,$(BIN_DIR)\$(PROJECT_NAMEexplorer) $(BIN_DIR)/$(PROJECT_NAME).exe : $(LIB_DEPENDS) $(PROJ_OBJS) $(LINK) $(OBJS_TO_LINK),$(BIN_DIR)\$(PROJECT_NAME),,$(LIBS_TO_LINK)/noi $(BIN_DIR)/$(PROJECT_NAME).win.exe: $(BIN_DIR)/$(PROJECT_NAME).exe $(LINK)).win.map,$(LIBS_TO_LINK),app.def/noi
Dec 07 2003
In article <br0f0r$273d$1 digitaldaemon.com>, Charles Sanders says...Walter can we get a definitive 'no that is in no way possible', or a 'yes with some massaging' ?Isn't the existence of a WinMain a Windows specific thing? I mean, it may not be at all possible to _have_ a WinMain in a dll? I'm no guru at this, but what if you told the library users to have an otherwise empty WinMain that just calls AtariSoldiersDllMain?then just have the user compile a 'mainless' program with the compiler, is this possible ? Im having some undefined mess with it running, if you download http://www.atari-soldiers.com/windy.zip it has makefiles that will buildI have a library that I want to compile that _has_ a WinMain () , and
Dec 07 2003