Closed starlight-traveler closed 4 months ago
Hello!
The crash originates from an abort() call within HelloImGui::LoadAssetFileData(char const*)
The log should display the name of the file that is not found. If it does not display the name of the file, there might be another source of the error.
Interesting point: files are copied at CMake configure step. If a file is not found, you might want to run CMake another time.
an ".app" is simply a "package" folder whose content is hidden by default:
And here is an example content of such a package: In the image below, the executable is "Contents/MacOS/demo_docking"
It is perfectly possible to attach a debugger to an app contained in such a package.
When using CMake, you can also pass -DHELLOIMGUI_MACOS_NO_BUNDLE=ON to force the creation of standard binaries.
Thanks for the information!
Looks like with the standard configuration:
Copying OS X content imgui_bundle_example_integration.app/Contents/Resources/assets//.DS_Store Copying OS X content imgui_bundle_example_integration.app/Contents/Resources/assets/app_settings/android/res/mipmap-anydpi-v26/ic_launcher.xml Copying OS X content imgui_bundle_example_integration.app/Contents/Resources/assets/app_settings/android/res/mipmap-xxxhdpi/ic_launcher_foreground.webp Copying OS X content imgui_bundle_example_integration.app/Contents/Resources/assets/app_settings/android/res/values/colors.xml Copying OS X content imgui_bundle_example_integration.app/Contents/Resources/assets/app_settings/android/res/values/ic_launcher_background.xml Copying OS X content imgui_bundle_example_integration.app/Contents/Resources/assets/app_settings/android/res/values/strings.xml Copying OS X content imgui_bundle_example_integration.app/Contents/Resources/assets/app_settings/android/res/values/styles.xml Copying OS X content imgui_bundle_example_integration.app/Contents/Resources/assets/app_settings/apple/Info.plist Copying OS X content imgui_bundle_example_integration.app/Contents/Resources/assets/app_settings/apple/Resources/ios/LaunchScreen.storyboard Copying OS X content imgui_bundle_example_integration.app/Contents/Resources/assets/app_settings/apple/Resources/ios/Readme.md Copying OS X content imgui_bundle_example_integration.app/Contents/Resources/assets/app_settings/emscripten/custom.js Copying OS X content imgui_bundle_example_integration.app/Contents/Resources/assets/app_settings/emscripten/shell.emscripten.html Copying OS X content imgui_bundle_example_integration.app/Contents/Resources/assets/app_settings/icon.png Copying OS X content imgui_bundle_example_integration.app/Contents/Resources/assets/fonts/Akronim-Regular.ttf Copying OS X content imgui_bundle_example_integration.app/Contents/Resources/assets/fonts/DroidSans.ttf Copying OS X content imgui_bundle_example_integration.app/Contents/Resources/assets/fonts/Font_Awesome_6_Free-Solid-900.otf Copying OS X content imgui_bundle_example_integration.app/Contents/Resources/assets/fonts/Roboto/LICENSE.txt Copying OS X content imgui_bundle_example_integration.app/Contents/Resources/assets/fonts/Roboto/Roboto-Bold.ttf Copying OS X content imgui_bundle_example_integration.app/Contents/Resources/assets/fonts/Roboto/Roboto-BoldItalic.ttf Copying OS X content imgui_bundle_example_integration.app/Contents/Resources/assets/fonts/Roboto/Roboto-Regular.ttf Copying OS X content imgui_bundle_example_integration.app/Contents/Resources/assets/fonts/Roboto/Roboto-RegularItalic.ttf Copying OS X content imgui_bundle_example_integration.app/Contents/Resources/assets/fonts/SourceCodePro-Regular.ttf Copying OS X content imgui_bundle_example_integration.app/Contents/Resources/assets/fonts/fontawesome-webfont.ttf Copying OS X content imgui_bundle_example_integration.app/Contents/Resources/assets/images/markdown_broken_image.png Copying OS X content imgui_bundle_example_integration.app/Contents/Resources/assets/images/world.png Copying OS X content imgui_bundle_example_integration.app/Contents/Resources/icon.icns
That "fonts/Inconsolata-Medium.ttf" is not being copied over in the Cmake process... which is the main issue. Once I add that manually to resources it works.
Glfw Error 65548: Cocoa: Regular windows do not have icons on macOS HelloImGui ERROR: assetFileFullPath(fonts/Inconsolata-Medium.ttf) failed! Tried the following assets folders: AppleAppBundle/Contents/Resources/assets: /Users/foo/Documents/Projects/C/GUI/imgui_bundle_template/build/imgui_bundle_example_integration.app/Contents/Resources/assets current_folder/assets: /Users/foo/Documents/Projects/C/GUI/imgui_bundle_template/build/imgui_bundle_example_integration.app/Contents/MacOS/assets exe_folder/assets: /Users/foo/Documents/Projects/C/GUI/imgui_bundle_template/build/imgui_bundle_example_integration.app/Contents/MacOS/assets (you can call HelloImGui::SetAssetsFolder() to set the default search location) at /Users/foo/Documents/Projects/C/GUI/imgui_bundle_template/build/_deps/imgui_bundle-src/external/hello_imgui/hello_imgui/src/hello_imgui/internal/hello_imgui_assets.cpp:241 IM_ASSERT( false ) --- hello_imgui_assets.cpp:241 libc++abi: terminating zsh: abort ./imgui_bundle_example_integration
Hello!
I attempted to build the bundle to see how hard it would to integrate into a long standing cmake project, and it seems that the .app that gets created calls abort(). I could not figure out to just output a bin file to attach a debugger, but the Darwin stderr references such:
The crash originates from an abort() call within HelloImGui::LoadAssetFileData(char const*). Problem related to asset loading, possibly because a file could not be found or accessed correctly.
Specifically, HelloImGui::LoadFontTTF. This is likely due to an attempt to load a font file that cannot be found or read, however I do not know which one or where in the code and several calls it references?
Is there
1) A way to just output a bin file instead of an app to attach a debugger?
2) Where would I start finding the asset error if I can not use a debugger?