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 Message-ID: <3FF1EFB3.5000509@keypro.fi> Date: Tue, 30 Dec 2003 23:35:47 +0200 From: Jani Tiainen User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.6b) Gecko/20031205 Thunderbird/0.4 MIME-Version: 1.0 To: cygwin AT cygwin DOT com Subject: DLL and external symbols Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Hi, I'm sure that this has been answered several times, but I'll ask again because couldn't find any solution by myself. I would like to build DLL (or any other sort of library) that refers to external symbols in main application. So far I have been able to build non-working constructs. =) Let's say that I've two files: main.c: #include extern void funcInMyLib(int); void funcInMain(int i) { printf("funcInMain(%ld)\n", i); } int main(int argc, char **argv) { funcInMyLib(1); return 0; } and second file (library) mylib.c: extern void funcInMain(int); void funcInMyLib(int i) { printf("Calling back..."); funcInMain(i + 1); } -------- Now how I can get this working, or is it possible at all? With .DEF files I can get things compiled and linked, but even program crashes at startup, or end up requesting "main.exp.dll". -- 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/