X-Spam-Check-By: sourceware.org To: cygwin AT cygwin DOT com From: =?utf-8?b?SsO4cmdlbg==?= Steensgaard-Madsen Subject: Initialisation with data from dll-libraries Date: Sat, 1 Apr 2006 09:03:26 +0000 (UTC) Lines: 40 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit User-Agent: Loom/3.14 (http://gmane.org/) X-IsSubscribed: yes Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Asking for help. I am porting a tool to implement interpreters from Linux to Windows/Cygwin, and have succeeded with a statically linked version. Interpreters depend on several libraries and use a dispatch table with pointers to functions from the libraries. The statically linked port has been tested succesfully. With gcc it is possible to build dll-versions of the libraries (i.e. pairs of cygXXX.dll and libXXX.dll.a). An application can be built, if there is no dispatch table, but when I try to build an interpreter the resulting dispatch table contains just null references. The terminology related to dll is rather confusing to me as a novice user of these. After having looked into various descriptions I am left with a number of questions: . The following command (outline) has been used: $(CC) -o demo */glue.o dispatch.o \ -Wl,--enable-auto-import \ -Wl,--no-whole-archive $(LFLAGS) No error or warning arises, and the interpreter starts to ask for input as expected, but the first attempt to use the dispatch table leads to a segmentation fault. Am I missing some options here? . Will a *.def file be helpful (or: required) in order to have the linker initialise the dispatch table correctly? . Must I use dlltool rather than just gcc to build the libraries with enough information to get the dispatch table initialised? Please help me if you can. Jørgen -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/