This is the mail archive of the
cygwin
mailing list for the Cygwin project.
how to compile the .so to allow extern functions
- From: "andy wang" <ypwangreg at gmail dot com>
- To: cygwin at cygwin dot com
- Date: Sat, 16 Dec 2006 00:14:52 -0500
- Subject: how to compile the .so to allow extern functions
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/