Hi, All:
$ gcc -shared -o bug1-main.so bug1-main.c -ldl -Wl,--out-implib=libmain.dll.a
Creating library file: libmain.dll.a
$ gcc -shared -o bug1.so bug1.c -L. -lmain
$ gcc -o bug1-main bug1-main.c -ldl
$ ./bug1-main.exe
in myfunc.so
in main.func1()
This method is wrong, because the bug1.so
Done:-), thank Brain for the help!
$ 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\n");
func1();
}
$ cat bug1-main.c
#include
int func1()
{
printf("in main.func1()\n");
return 0;
}
int main()
{
int (*mf)();
Thanks Brain, thank you very much.
Your information is totally a guide to compile .so on the cygwin.
I ask this question because I just want to compile the asterisk 1.4
beta on the cygwin for fun, I don't care about the zaptel driver or
pstn connection, I just want the networking part of it, espe
andy wang wrote:
> I want to compile a .so which contains extern function that may be
Shared libraries have the extension .DLL on windows. You can make one
that is named .so, but it will be utterly confusing, because it is still
a DLL just with a nonstandard extension. And the tools are all
con
4 matches
Mail list logo