[vtkusers] MinGW visibility attribute not supported warning

Jim Peterson jimcp at cox.net
Fri Aug 27 08:50:03 EDT 2010


Sascha,
Maybe a bit off topic, but probably related. I was not able to get a set 
of workable Java wrappers and shared libraries created for use on a 
Windows machine using cmake and MinGW. all of the dlls are prefixed with 
"lib" resulting in errors loading the vtk java wrapper libraries with 
the existing examples, If I added the lib prefix to the vtk java source 
code to load the libraries, an internal library load failure would occur 
for the corresponding vtk shared library. if I renamed the vtk shared 
library to match the expectation, the VTKINIT function was not found in 
the renamed shared library.

I finally switched to Visual Studio 2008 Express to build the shared 
libraries for use by the java wrappers. I am not sure what your intended 
use of shared libraries is, but be aware that the perceived intentions 
of MinGW as building libraries for use from a unix like shell in Windows 
or by native Windows applications does not appear to be clearly identified.

I am still trying to get myself up to speed on the cmake specification 
files to make MinGW generate usable shared libraries for use by java 
applications running on Windows. Any insight regarding exactly where to 
look to address this would be appreciated. IMHOP, all DLL libraries in 
windows should not get prefixed with "lib".  I did try adding to the  
kitCommonBlock.cmake after the add library statement a  statement:

# IF (WIN32)
SET_TARGET_PROPERTIES (vtk${KIT} PROPERTIES PREFIX "" )
# ENDIF (WIN32)

but it had no effect on the resultant build that I could see.
Hope that helps,
Jim
 
Sascha Zelzer wrote:
> Forgot the attachment...
>
> Am 27.08.2010 14:04, schrieb Sascha Zelzer:
>> Hi,
>>
>> when building VTK with MinGW, a lot of visibility warnings ("visibility
>> attribute not supported in this configuration") are displayed. This is
>> due to
>>
>> set(VTK_ABI_CXX_FLAGS "-fvisibility=hidden -fvisibility-inlines-hidden")
>>
>> in line 43 of vtkCompilerExtras.cmake. Although MinGW is a gcc variant,
>> it is not necessary to set the visibility flags if you use
>> __declspec(export) attributes and don't use --export-all-symbols. See
>> for example
>> http://www.redhat.com/docs/manuals/enterprise/RHEL-4-Manual/gnu-linker/win32.html 
>>
>>
>> I attached a patch which would fix this issue by not adding the
>> visibility flags if the compiler is MinGW. Any feedback is appreciated.
>>
>> Thanks,
>> Sascha
>>    
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
>   




More information about the vtkusers mailing list