Filament: iOS link error with stbimage

Created on 28 Jan 2020  路  5Comments  路  Source: google/filament

Undefined symbol of stbi_load, stbi_info
Undefined symbols for architecture arm64:
"_stbi_load", referenced from:
gltfio::ResourceLoader::createTextures(gltfio::details::FFilamentAsset) const::$_4::operator()() const in libgltfio_core.a(ResourceLoader.cpp.o)
(maybe you meant: _stbi_loadf_from_callbacks, _stbi_loadf_from_memory , _stbi_load_from_callbacks , _stbi_load_16_from_callbacks , _stbi_load_16_from_memory , _stbi_load_from_memory )
"_stbi_info", referenced from:
gltfio::ResourceLoader::createTextures(gltfio::details::FFilamentAsset
) const in libgltfio_core.a(ResourceLoader.cpp.o)
(maybe you meant: _stbi_info_from_callbacks, _stbi_info_from_memory )
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

To Reproduce
run ios gltf sample.

Screenshots
image

gltfio ios

Most helpful comment

Nice find, that #def should only be defined when ANDROID or __EMSCRIPTEN__ are defined. I'll fix this.

All 5 comments

@prideout Looks like gltfio didn't compile in stb_image?

@prideout I checked gltf_core.a and extracted Image.cpp.o and I attached it.
but I couldn't find stbi_load and stbi_info symbol from it.

Image.cpp.o.zip

libs/gltfio/include/gltfio/Image.h line #25 is strange.

define STBI_NO_STDIO

I am not sure why it had been defined STBI_NO_STDIO .
should be removed?

If I remove it, then it works.

Nice find, that #def should only be defined when ANDROID or __EMSCRIPTEN__ are defined. I'll fix this.

Was this page helpful?
0 / 5 - 0 ratings