On 2008-09-12 09:07+0200 Arjen Markus wrote: > - Are symbols imported from the C library to accommodate the Fortran or other > bindings automatically visible via these other libraries? I mean: is the > visibility > transitive?
Fortunately, the above complicated case does not apply to our Fortran and C++ libraries. For example, if you look at the CMakeLists.txt files for the Fortran 95 examples, you will see this line: target_link_libraries(x${STRING_INDEX}f95 plplotf95${LIB_TAG}) That means our various Fortran 95 examples only have undefined symbols that are resolved by libplplotf95d, and for example, there are no C symbols from libplplotf95cd, libplplotd, libcsirocsa, or libcsironn directly required by our Fortran examples (as you would expect). Moving one up in the hierarchy, you will find target_link_libraries(plplotf95${LIB_TAG} plplotf95c${LIB_TAG}) That means libplplotf95d only has undefined symbols that are resolved by libplplotf95cd, and there are no C symbols from libplplotd (or libcsirocsa, or libcsironn) directly required by libplplotf95d. Moving one more up in the hierarchy, you will find target_link_libraries(plplotf95c${LIB_TAG} plplot${LIB_TAG}) That means libplplotf95cd only has undefined symbols that are resolved by libplplotd, and there are no C symbols from either libcsirocsa or libcsironn directly required by libplplotf95cd. Finally, moving one more up in the hierarchy, you will find target_link_libraries( plplot${LIB_TAG} ${libplplot${LIB_TAG}_LINK_LIBRARIES} ) where the ${libplplot${LIB_TAG}_LINK_LIBRARIES CMake list variable contains different external libraries and link flags depending on CMake logic. For the case where WITH_CSA is true, then the list includes libcsirocsa. That means for that case libplplotd has undefined symbols that are resolved by libcsirocsa. And similarly for HAVE_QHULL and libcsironn. I hope that detailed example clarifies your thoughts on what symbols should be visible for what libraries in the Fortran95 (and equivalent Fortran 77) chain of libraries. To summarize these particular example/library chains, an example or library at one level in the hierarchy only requires a library from one higher level in the hierarchy. If you look at examples/c++/CMakeLists.txt and bindings/c++/CMakeLists.txt you will see the C++ examples and libplplotcxxd also share this same useful property. Here is what I suggest you and Werner do to follow up on this. You have already indicated earlier in this thread you were not quite sure about what circumstances required use of __declspec(dllimport). So I suggest you look very carefully at all traditional and non-traditional documentation accessible to you to see under exactly what circumstances __declspec(dllimport) should be used for undefined symbols in a library. Note especially that a very good non-traditional source of documentation for Windows development is the CMake mailing list. Note also that questions about __declspec(dllimport) have been asked and answered there before so you may want to do a google search of the CMML archives before you ask your questions on that mailing list. Once you know the exact circumstances where it is necessary to specify __declspec(dllimport), then you will be in a good position to figure out how to support that requirement using a combination of CMake logic and #defines in our various *dll.h files. Good luck in getting this all sorted out so that the Fortran cases and the C++ case build and give good ctest results for bare Windows and MinGW. Alan __________________________ Alan W. Irwin Astronomical research affiliation with Department of Physics and Astronomy, University of Victoria (astrowww.phys.uvic.ca). Programming affiliations with the FreeEOS equation-of-state implementation for stellar interiors (freeeos.sf.net); PLplot scientific plotting software package (plplot.org); the libLASi project (unifont.org/lasi); the Loads of Linux Links project (loll.sf.net); and the Linux Brochure Project (lbproject.sf.net). __________________________ Linux-powered Science __________________________ ------------------------------------------------------------------------- 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