OpenSceneGraph icon indicating copy to clipboard operation
OpenSceneGraph copied to clipboard

Duplicate symbol FileExists when linking OSG as a static library

Open ankurvdev opened this issue 4 years ago • 4 comments

osgPlugins/zip/unzip.cpp includes a function "FileExists" in the global namespace which is a very common function name. When linking this in static-lib mode on linux, it conflicts with gdal which has the same function name in the global namespace and is a dependency.

The conflict also happens for inflate_copyright variable

I believe the convention here is to mark all local functions or variables as "static" so they do not collide with other functions of similiar name.

More details on how vcpkg incorporates a fix are here: https://github.com/microsoft/vcpkg/pull/15374/files#

ankurvdev avatar Jan 04 '21 07:01 ankurvdev

Hi there, any official reply? @robertosfield

JackBoosY avatar Jan 11 '21 02:01 JackBoosY

On Mon, 11 Jan 2021 at 02:44, Jack·Boos·Yu [email protected] wrote:

Hi there, any official reply?

If there are PR's to the OSG itself then I can review and merge changes.

openscenegraph avatar Jan 11 '21 13:01 openscenegraph

@robertosfield, Can you please review the PR ?

ankurvdev avatar Jan 15 '21 09:01 ankurvdev

On Fri, 15 Jan 2021 at 09:43, ankurverma85 [email protected] wrote:

@robertosfield https://github.com/robertosfield, Can you please review the PR ?

I will do a review of all the PR's when I get a clear block of time.

openscenegraph avatar Jan 15 '21 10:01 openscenegraph