X-Spam-Check-By: sourceware.org Message-ID: <89c3ea2b0612152114u5150ecfara058c41a00a70dac@mail.gmail.com> Date: Sat, 16 Dec 2006 00:14:52 -0500 From: "andy wang" To: cygwin AT cygwin DOT com Subject: how to compile the .so to allow extern functions MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline X-IsSubscribed: yes Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Id: 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 Hi, All I want to compile a .so which contains extern function that may be defined on the main program. The following file can be compiled on linux without any problem but how to compile it on cygwin? $ cat bug1.c //this will be .so and will call an extern func1() in the main proc int func1(); int myfunc() { printf("in myfunc.so"); func1(); } $ gcc -o bug1.so -shared bug1.c /cygdrive/c/DOCUME~1/Flyiky/LOCALS~1/Temp/ccBB7v0l.o: bug1.c:(.text+0x13): undefined reference to `_func1' collect2: ld returned 1 exit status Thanks in advance! Regards, Andy -- 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/