Skip to content

Duplicate symbol FileExists when linking OSG as a static library #1017

@ankurvdev

Description

@ankurvdev

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#

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions