Weird exception when compiling my first example

Problems building or running the engine, queries about how to use features etc.
Urada
Gnoblar
Posts: 2
Joined: Thu Oct 10, 2024 5:50 am

Weird exception when compiling my first example

Post by Urada »

Ogre Version: :14.3/master:
Operating System: :Windows10/Msys2-Clang64/clang++ 18:

I compiled my own library in Release mode according to the tutorial, but an exception occurred at ctx.initApp() when compiling the example file.
I tried to debug it with lldb, but there was not much useful information.

Image
Image

I can see that the exception is triggered by _openFileStream, but the exception message does not include the target path. It is even reported in my system language (not English), meaning is: "The specified image file does not contain a resource areaso". I have no idea what file it is trying to load. lldb also returns assembly (not source code), and I have little experience in C++ and cannot solve this problem.

I guessed that this was caused by the resource path specified in resources.cfg not existing. I did a lot of different tests, but none of them worked.

CMakeLists.txt:

Code: Select all

cmake_minimum_required(VERSION 3.10)
project(ogre_test)

set(OGRE_DIR "D:/lch/Source/ogre/build/sdk/CMake/")

set(CMAKE_CXX_STANDARD 17)

# statically link the standard library provided by msys
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -static-libgcc -static-libstdc++")

## [discover_ogre]
# The COMPONENTS part checks that OGRE was built the way we need it
# The CONFIG flag makes sure we get OGRE instead of OGRE-next
find_package(OGRE REQUIRED COMPONENTS Bites CONFIG)

# add the source files as usual
add_executable(0_Bootstrap Bootstrap.cpp)

# this also sets the includes and pulls third party dependencies
target_link_libraries(0_Bootstrap OgreBites)
## [discover_ogre]
paroj
OGRE Team Member
OGRE Team Member
Posts: 2093
Joined: Sun Mar 30, 2014 2:51 pm
x 1129

Re: Weird exception when compiling my first example

Post by paroj »

the prebuild SDK is using MSVC, which is not compatible with clang. If built Ogre yourself with clang, try doing a debug build to get more information

Urada
Gnoblar
Posts: 2
Joined: Thu Oct 10, 2024 5:50 am

Re: Weird exception when compiling my first example

Post by Urada »

paroj wrote: Thu Oct 10, 2024 4:59 pm

the prebuild SDK is using MSVC, which is not compatible with clang. If built Ogre yourself with clang, try doing a debug build to get more information

I built the SDK myself. I tried to build the SDK with debug flag, but no SDK folder was created. Only scattered xxx_d.dll files were generated under build/bin/. I'm not sure how to use them.

Image

paroj
OGRE Team Member
OGRE Team Member
Posts: 2093
Joined: Sun Mar 30, 2014 2:51 pm
x 1129

Re: Weird exception when compiling my first example

Post by paroj »

you have to also do the install step:
https://ogrecave.github.io/ogre/api/lat ... otoc_md268