On Sat, Feb 16, 2008 at 10:43 PM, Brian Dessent <brian@xxxxxxxxxxx> wrote: > Mirko Vukovic wrote: > > > But on cygwin, ld does not have the -h option, and following the > > suggested command thus: > > ld -shared -s -o libgsl.so -whole-archive libgsl.a > > gives a long listing of undefined references. And of course, no .so > > library at the end of the exercise. > > I would take that entire page with a huge grain of salt. Anyone that > advocates the practice of putting non-PIC objects into a shared library > needs their head examined. Also, directly invoking ld to link is almost > always a bad idea. > > The proper way is to rebuild the library. Forget this conversion > nonsense. With most things that use standard tools it's simply a matter > of using --enable-shared when configuring. Cygwin is similar to linux > here, each .c file gets compiled to an .o and then linked to a .dll with > "gcc -shared". There is no 'ld' invocation anywhere. Note that calling > a DLL a .so is possible but it doesn't make much sense, it's not > anything close to the same as a ELF .so. Also note that Cygwin (really, > PE) does not have a notion of PIC, however it does have a notion of > dllimport/dllexport and often times this means that code that will be > made into a DLL must be compiled with different options than code in a > static library, just as on ELF you must recompile with -fPIC. > > Brian > Thanks Brian. I took a closer look and found that the gsl distribution came with the libgsl.dll.a file. I'll try to figure out what the .a means there. And if all else fails, I will rebuild to generate the shareable library. Mirko