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

Issues when linking Rust bindings to C++ code. #1472

Open
scott-wilson opened this issue Mar 14, 2025 · 0 comments
Open

Issues when linking Rust bindings to C++ code. #1472

scott-wilson opened this issue Mar 14, 2025 · 0 comments

Comments

@scott-wilson
Copy link

scott-wilson commented Mar 14, 2025

I have the following PR here: https://github.com/AcademySoftwareFoundation/OpenImageIO/pull/4643/files

The test https://github.com/AcademySoftwareFoundation/OpenImageIO/pull/4643/files#diff-69049d4580f06ecbf7e0576174f3b9770f08ab0b1c284de13052fe3505253424R248 is throwing a link error due to the error undefined reference to OpenImageIO::v3_1_0::TypeDesc::TypeDesc(OpenImageIO::v3_1_0::basic_string_view<char, std::char_traits<char> >)'.

The cc command looks like this (OpenImageIO and OpenImageIO_Util is linked, and the search path points to the binary):

LC_ALL="C" VSLANG="1033" cc \
  -m64 \
  -Wl,--as-needed \
  -Wl,-Bdynamic \
  -lOpenImageIO \
  -lOpenImageIO_Util \
  -Wl,-Bstatic \
  -loiio-sys \
  -Wl,-Bdynamic \
  -lstdc++ \
  -lgcc_s \
  -lutil \
  -lrt \
  -lpthread \
  -lm \
  -ldl \
  -lc \
  -Wl,--eh-frame-hdr \
  -Wl,-z,noexecstack \
  -L /path/to/compiled/OpenImageIO/dist/lib \
  -Wl,--gc-sections \
  -pie \
  -Wl,-z,relro,-z,now \
  -nodefaultlibs

The OIIO team and I are scratching our heads, since it looks like the C++ side should all be happy, but I feel like I'm probably doing something very obviously wrong.

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

1 participant