From: Bernhard Stiftner Subject: Re: Using libraries in a DLX (?) Newsgroups: comp.os.msdos.djgpp Message-ID: <1a08df04.53d45f41@usw-ex0108-061.remarq.com> Lines: 54 Bytes: 1988 X-Originating-Host: 195.3.96.211 Organization: http://www.remarq.com: The World's Usenet/Discussions Start Here References: <14978418 DOT 80f58605 AT usw-ex0108-061 DOT remarq DOT com> <393ebb7e$0$80802 AT SSP1NO17 DOT highway DOT telekom DOT at> X-Wren-Trace: eOrP5+b/uPK5uerr6b7l5urq9en7+avu6sbi5Puw/a/xrPuyseSsqr+9oL21+w== Date: Sat, 10 Jun 2000 07:39:24 -0700 NNTP-Posting-Host: 10.0.2.61 X-Complaints-To: wrenabuse AT remarq DOT com X-Trace: WReNphoon3 960649441 10.0.2.61 (Sat, 10 Jun 2000 08:04:01 PDT) NNTP-Posting-Date: Sat, 10 Jun 2000 08:04:01 PDT To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com I've tried out what you suggested and downloaded SEAL (nice thing!) I am no longer having problems with libraries in DLX modules, but I discovered 2 new problems: - My DLX loader can't execute an exported function of my DLX module (it leads to a general protection fault [but I'm using Windows, so I'm used to that;-)...]) I can call my routine in the LibMain procedure of my DLX, for example: DLX_FN void testproc(void) { /* do something */ }; DLX_EF lib_begin ( void ) { if ( ap_process == AP_ALLOC ) { AP_EXPORTLIB(); }; if ( ap_process == AP_INIT ) { testproc(); /* works perfectly */ }; } lib_end; but I can't import "testproc" to my DLX loader like this: typedef void (*FUNC)(); hdlx_t myd1; int main(void) { DLXImport(_LIBEXPORTTABLE); myd1 = DLXLoad("tstdlx.dlx", ""); ((FUNC)DLXGetEntry(myd1,"testproc"))(); /* GPF!!! */ DLXUnload(myd1); } - and a second problem: "extended DLX" does not support C++: If I try to generate a DLX from an C++ object file (i.e. when the file extension is .cpp or .cc or when I'm using GPP instead of GCC), DLXGEN can't create a DLX ("Error: input file has more than one section; use -M for map"). Is there a way to make DLXGEN C++ compatible??? Finally a tiny bug correction for SEAL's DLX.H file: please use #define app_end } DLX_EF #define app_main ap_begin #define app_begin(_x) \ /*...*/ and #define lib_end } DLX_EF #define lib_main lib_begin #define lib_begin(_x) \ /*...*/ instead of declarations without DLX_EF since one "}" is missing when compiling a C++ file with it [this bug is so tiny that my correction suggestion could be regarded as "cosmetic"]... Thanks in advance... * Sent from AltaVista http://www.altavista.com Where you can also find related Web Pages, Images, Audios, Videos, News, and Shopping. Smart is Beautiful