Alan W. Irwin wrote:

> There are some questions below for Arjen and Werner in addition to my
> response to some of Andrew's comments.
>
>
>
> Here is a question for Arjen and Werner. One thing I am confused about at
> the present time is whether there has been any visibility work done 
> yet for
> our non-C libraries such as libplplotcxxd, libplplotf77d, and 
> libplplotf95d.
> My impression is no work has been done on that, but then if Windows 
> default
> is no visibility for the C++ and Fortran symbols in those libraries, 
> how can
> our C++, Fortran 77, and Fortran 95 examples be linked on Windows? 
> Have you
> guys tried to build our examples in the build tree and run ctest there?
>
Hi Alan, Andrew,

what may be hidden because of all the #ifdefs is that for the 
Windows/MSVC/(I|C)VF
case we do use the PLDLLEXPIMP macro, so the visibility issue _is_ taken 
care of.
Otherwise things would indeed not work correctly. In fact, this is also 
the solution
to the problem Werner found with the new MinGW stuff.

Let me elaborate this:
(long version)
I had some problems with the MinGW distribution because my MSYS installation
interferred (when compiling and linking a small program, the linker from 
my MSYS
and g95 installation kicked in). I moved that out of the way (renamed 
the MSYS
installation directory) and then found out that the GCC distribution I 
had installed
(version 4.2.1) was incomplete: no linker (ld) program.

I went back to the TDM distribution with the bleeding-edge release of 
the GCC
compilers and was successful in building the small example, using a 
Fortran and a
C DLL - with no attention to visibility. Rather like it used to be. But 
I did have
an issue with multiply defined symbols: the Fortran DLL already 
contained them.
With the linker option --allow-multiple-definition I finally got it to work.

Then I moved on to PLplot proper. Again the undefined symbols - 
plsetopt7_ etc.
but some fiddling with the FNAME macro (inventing a new LINK_* macro
on the way: the proper decoration for the names in the C library is 
PLDLLEXPIMP name_)
helped to build the FORTRAN 77 DLL. (The Fortran 95 bindings failed, as 
I had
not made similar changes there yet.)

I have not had time to investigate these issues in conjunction with the 
new visibility
stuff - it may be that this is now taken care of already - but otherwise 
it will be easy
to combine my solution with it.

(short version)
In the new MinGW installation, it looks as if the default visibility for 
symbols in
a (C) DLL has changed. By explicitly exporting the various functions in 
a similar
way as for Windows/MSVC/... we can get it right.

What needs to be checked:
- Effect on the other build environments on Windows:
  - Cygwin/gcc/gfortran
  - old-style MSYS/MinGW/g95
  - native Windows/MSVC/(I|C)VF)
- Whether the examples can be built properly - perhaps an extra linker 
flag is required

Regards,

Arjen

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Plplot-devel mailing list
Plplot-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/plplot-devel

Reply via email to