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

Linker error with CesiumGltfReader #813

Closed
jaadelgren opened this issue Feb 15, 2024 · 3 comments
Closed

Linker error with CesiumGltfReader #813

jaadelgren opened this issue Feb 15, 2024 · 3 comments
Labels
bug Something isn't working

Comments

@jaadelgren
Copy link

CesiumGltfReader makes use of stb_image image resizing functionality (specifically, stbir_resize_uint8, see GltfReader.cpp, but does not include the implementation by defining STB_IMAGE_RESIZE_IMPLEMENTATION before the stb_image_resize.h include. Because the implementation is never built, linking to CesiumGltfReader will result in an error, assuming clients don't separately build stb_image_resize or link against CesiumGltfContent (see below).

It looks like CesiumGltfContent does define the macro (in ImageManipulation.cpp, and therefore does have the necessary stbir_resize_XX functions implemented. However, CesiumGltfReader does not link against CesiumGltfContent.

Of course, there may be duplicate symbols issues if both libraries build the implementations. It's unclear to me whether it would be appropriate for CesiumGltfReader to simply link to CesiumGltfContent, or if perhaps another, separate library (e.g. CesiumtImageResize) is a better route.

@j9liu j9liu added the bug Something isn't working label Feb 21, 2024
@appybara13
Copy link

I've encountered the same linker error, and sure enough I had to link CesiumGltfReader against CesiumGltfContent to avoid issues with duplicate symbols.

I'd say a separate library for all stb implementations would make the most sense, to avoid similar problems in the future.

@csciguy8
Copy link
Contributor

csciguy8 commented Apr 8, 2024

It sounds like the output libraries from cesium-native might need to be looked at again, but from a usage perspective.

For example, if CesiumGltfReader isn't meant to be used by itself, but also with CesiumGltfContent, maybe it shouldn't even be compiled into a separate lib? Could be all the Gltf related logic just goes into a single CesiumGltf lib.

This inspired me to write up #855. This relates to the general question of "what are the ways I can use cesium-native?". If cherry picking libs is something we intend users to do, we should have some reference for this, or at least document it.

@lilleyse
Copy link
Contributor

Fixed in #860

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants