Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Duplicated symbol error #1365

Closed
daeho-ro opened this issue Nov 3, 2024 · 4 comments
Closed

Duplicated symbol error #1365

daeho-ro opened this issue Nov 3, 2024 · 4 comments

Comments

@daeho-ro
Copy link

daeho-ro commented Nov 3, 2024

During the static build with examples,

duplicated symbol error happen.

  duplicate symbol '__Z16fourcc_to_stringj' in:
      /private/tmp/libheif-20241101-9937-gl06de/libheif-1.19.1/static/examples/CMakeFiles/heif-info.dir/heif_info.cc.o
      ../libheif/libheif.a[16](common_utils.cc.o)
  ld: 1 duplicate symbols
  clang: error: linker command failed with exit code 1 (use -v to see invocation)

And indeed, there are two symbol definition for fourcc_to_string and so want to let you know here.

Thanks,

farindk added a commit that referenced this issue Nov 3, 2024
@farindk
Copy link
Contributor

farindk commented Nov 3, 2024

Thanks. Does the above change (making the function static) also fix this?

I tried to reproduce this on Linux with BUILD_SHARED_LIBS=OFF and WITH_REDUCED_VISIBILITY=OFF, but don't get that error. Any idea what combination leads to the linker error?

@daeho-ro
Copy link
Author

daeho-ro commented Nov 4, 2024

Here is the running command,

cmake -S . -B static -DCMAKE_INSTALL_RPATH=@loader_path/../lib -DWITH_DAV1D=OFF -DWITH_GDK_PIXBUF=OFF -DWITH_RAV1E=OFF -DWITH_SvtEnc=OFF -DCMAKE_INSTALL_PREFIX=/opt/homebrew/Cellar/libheif/1.19.1 -DCMAKE_INSTALL_LIBDIR=lib -DCMAKE_BUILD_TYPE=Release -DCMAKE_FIND_FRAMEWORK=LAST -DCMAKE_VERBOSE_MAKEFILE=ON -DCMAKE_PROJECT_TOP_LEVEL_INCLUDES=/opt/homebrew/Library/Homebrew/cmake/trap_fetchcontent_provider.cmake -Wno-dev -DBUILD_TESTING=OFF -DCMAKE_OSX_SYSROOT=/Library/Developer/CommandLineTools/SDKs/MacOSX14.sdk -DBUILD_SHARED_LIBS=OFF
cmake --build static

but anyway, your fix is working good. Thank you!

@kmilos
Copy link
Contributor

kmilos commented Nov 4, 2024

See also a different duplicated symbol error when linking w/ libheif 1.19.1: darktable-org/darktable#17770 (comment)

Note also that darktable is built w/ C++17.

@farindk
Copy link
Contributor

farindk commented Nov 4, 2024

dllexport changed in 2605019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants