Re: Allocatable arrays and shared libraries: help needed



<sgiannerini@xxxxxxxxx> wrote in message
news:ba0d3c16-9069-41f2-a767-99599d5560c7@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

In brief, in order to be able to use the -lLIBRARYNAME command in
linux you have to name the library as libLIBRARYNAME.a whereas in Win
you have to specify it as LIBRARYNAME.dll.
I have to say that I had to struggle a bit through the gcc docs to
find it out.
Is this difference expected?

Oh man, if you said you understood anything about building libraries
and linking with gfortran it would have been evidence that you were
delusional. First off, why does a shared library correspond to a *.a
file in LINUX? I thought it should have been a *.so (or maybe *.so.1,
what is the difference?) Now that you have seen the depths of my
ignorance about LINUX, I hasten to add that I am just about as
clueless regarding the Windows way of doing things.

Anything but the gcc family of compilers makes *.dll files for
dynamic linking or *.lib files for static linking. For some reason
gcc uses lib*.a files sort of like the rest of the world uses *.lib
files. Indeed, if you sniff around the directory structure
installed by gfortran, you will see a massive directory with files
such as libkernel32.a, which gcc &c. use for linking for some
reason when the program needs procedures from a subroutine in a *.dll
file such as kernel32.dll.

Any other compiler would use a *.lib file such as kernel32.lib for
this purpose. What all these files are for and how you make them
and how you can interconvert them is poorly documented, not just due
to the gnu cultural tradition of obsessively inadequte documentation
but in fact even MSDN doesn't have a whole lot of good dirt on this
kind of thing. And it would be a moot point if it weren't for the
fact that things can go wrong in this process and then you don't
know what to do to fix it. On 32-bit Windows, for some reason the
libkernel32.a file only has references to decorated version of the
procedure names such as _GetModuleFileName@12 but gfortran won't
create these decorated names, it only gives you GetModuleFileName
and if you try to create a binding name it gets rejected for not
being a good C name! And some decorated procedures can be made to
work via a gfortran switch, whose name I forget just now, but for
some reason most of them can't be fixed like this. It's probably a
simple fix if you knew what you were doing, after all gfortran can
make the decoration in a limited number of cases, but the
documentation is so lacking that when a little thing like this goes
wrong you are just dead in the water.

Hope you enjoyed my rant.

--
write(*,*) transfer((/17.392111325966148d0,6.5794487871554595D-85, &
6.0134700243160014d-154/),(/'x'/)); end


.



Relevant Pages

  • Re: Significant Pure Assembler Application In MASM ?
    ... When I was thinking of a literal "port" of RosAsm for LuxAsm, I was quite daunted by this!!! ... I was seeing a lot of APIs that, I'm not sure what they do, but I don't think there's a Linux equivalent. ... I was contemplating *avoiding* libraries for LuxAsm, ... If GTK is a "replacement od the Win Api", ...
    (alt.lang.asm)
  • [opensuse] Re: Manual dist upgrade procedure(s) & tools/progs/aids?
    ... and the older software needs the old libraries. ... 88 SuSE Linux 9.3 ... information on disk is stored in groupings. ... name to an inode, you can delete the first name and the information ...
    (SuSE)
  • Re: Learning C and Learning Make/Configure/Building/Linking
    ... I have found C programs that almost work and Java ... same on both Windows and Linux. ... binaries for Linux or find a way to make sure I can keep the libraries it ... I think my best bet is static binaries. ...
    (comp.lang.c)
  • Announcement
    ... Focus of site is: Linux assembly programming ... Libraries state description ... file_info stable file status and permission setting ... All programs are written in assembler using nasm. ...
    (comp.lang.asm.x86)
  • Re: Good Dungeon Mapping e-Tool?
    ... Relatively recent Linux kernels and GNU libc have gotten most ... pipelined across multiple thread stages. ... Given two libraries that both want to ... I think you're mixing up dynamic loading and threading here. ...
    (rec.games.frp.dnd)