I don't use cmake-gui and it doesn't do that (all CMakeCache.txt is fine and changes what I change via command line)
just plain cmake works lake a charm.
[SOLVED & BUILT] From the journal of the Windows Alchemist ...
-
slapin
- Bronze Sponsor

- Posts: 388
- Joined: Fri May 23, 2025 5:04 pm
- x 28
Re: From the journal of the Windows Alchemist ...
-
paul424
- Orc
- Posts: 414
- Joined: Thu May 24, 2012 7:16 pm
- x 23
Re: From the journal of the Windows Alchemist ...
Yeah chatGPT says to use CMAKE-gui only for debugging purposes. The variables could be stored in json file, like this :
CMakePresets.json :
Code: Select all
{
"version": 3,
"configurePresets": [
{
"name": "windows-ninja-x64",
"displayName": "Windows Ninja x64 (all deps)",
"generator": "Ninja",
"binaryDir": "C:/OpenDungeonsPlus-2026",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "RelWithDebInfo",
"BOOST_NO_CXX11_SNPRINTF": "ON",
"BOOST_ROOT": "C:/local/boost_1_87_0",
"CEGUI_CONFIG_INCLUDE_DIR": "C:/cegui-scissors_test_disabled-sdk",
"CEGUI_CONFIG_INCLUDE_DIR_PREFIX": "C:/cegui-scissors_test_disabled-sdk/include/cegui-0",
"CEGUI_INCLUDE_DIR": "C:/cegui-scissors_test_disabled-sdk/include/cegui-0/CEGUI",
"CEGUI_LIBRARY": "C:/cegui-scissors_test_disabled-sdk/lib/CEGUIBase-0.lib",
"CEGUI_OgreRenderer_LIBRARY": "C:/cegui-scissors_test_disabled-sdk/lib/CEGUIOgreRenderer-0.lib",
"OD_TREAT_WARNINGS_AS_ERRORS": "OFF",
"OGRE_DIR": "C:/ogre-13.6.5-sdk/CMake",
"OIS_PREFIX_PATH": "C:/OIS/OIS-master/OIS-master",
"OIS_INCLUDE_DIR": "C:/OIS/OIS-master/OIS-master/includes",
"OIS_LIBRARY": "C:/OISBuild/Release/OIS.lib",
"SFML_INCLUDE_DIR": "C:/SFML-2.5.0/include",
"SFML_AUDIO_LIBRARY_DYNAMIC_RELEASE": "C:/sfml_build/lib/Release",
"SFML_SYSTEM_LIBRARY_DYNAMIC_RELEASE": "C:/sfml_build/lib/Release",
"SFML_NETWORK_LIBRARY_DYNAMIC_RELEASE": "C:/sfml_build/lib/Release",
"SFML_AUDIO_LIBRARY_STATIC_RELEASE": "C:/sfml_build/lib/Release",
"SFML_SYSTEM_LIBRARY_STATIC_RELEASE": "C:/sfml_build/lib/Release",
"SFML_NETWORK_LIBRARY_STATIC_RELEASE": "C:/sfml_build/lib/Release"
}
}
],
"buildPresets": [
{
"name": "build",
"configurePreset": "windows-ninja-x64",
"jobs": 24
}
]
}
-
paul424
- Orc
- Posts: 414
- Joined: Thu May 24, 2012 7:16 pm
- x 23
Re: From the journal of the Windows Alchemist ...
Now I try to compile my game. I keep getting the _snprintf is not a member of userspace std. Chatgpt probably correctly recognized that as problem that with modern boost and MSVSC 2022 there is conflict : namely current MSVSC compiler does not serve this function in this namespace. Maybe I should use the C plain version located in <cstdio> ?
That would require to put #include <cstdio> before any occurance of boost header library, in every compilation unit.
Also I do use now cmake + ninja + MSVC, how would you get the colorful output when using Cmake ?
-
slapin
- Bronze Sponsor

- Posts: 388
- Joined: Fri May 23, 2025 5:04 pm
- x 28
Re: From the journal of the Windows Alchemist ...
I guess you can handle that in your own header and for gcc you can -include header.h it in your CFLAGS, for MSVS compiler you can use /FI header.h option
-
paul424
- Orc
- Posts: 414
- Joined: Thu May 24, 2012 7:16 pm
- x 23
Re: From the journal of the Windows Alchemist ...
uhh some header library was poisoning the whole build with
Code: Select all
#define snprintf _snprintfI had to go to deep dungeons to disable that
.... !
How to get colors again ? ( here even chatgpt cannot get reliable answer ! ) ...
-
paul424
- Orc
- Posts: 414
- Joined: Thu May 24, 2012 7:16 pm
- x 23
Re: From the journal of the Windows Alchemist ...
I am on the finish line again.
I got the linker error , namely I cannot point the boost libraries inside the choco package manager's chosen directory :
"C:/local/boost_1_87_0/lib64-msvc-14.3/libboost_filesystem-....lib"
[246/246] Linking CXX executable opendungeons-plus.exe
FAILED: opendungeons-plus.exeC:\Windows\system32\cmd.exe /C "cd . && "C:\Program Files\CMake\bin\cmake.exe" -E vs_link_exe --intdir=CMakeFiles\opendungeons-plus.dir --rc=... --mt=... --manifests -- ...link.exe ..."
LINK Pass 1: command "...link.exe..." failed (exit code 1104) with the following output:
LINK : warning LNK4075: option "/INCREMENTAL" ignored due to specifying option "/FORCE"
LINK : fatal error LNK1104: cannot open file "libboost_filesystem-vc143-mt-x64-1_87.lib"
ninja: build stopped: subcommand failed.
ChatGPT seems to be stuck upon the CMakeList.txt script, all it is proposing is :
Code: Select all
# link boost
set(BOOST_LIBRARYDIR "C:/local/boost_1_87_0/lib64-msvc-14.3")
find_package(Boost REQUIRED COMPONENTS
filesystem system thread program_options chrono
)
target_include_directories(${PROJECT_BINARY_NAME}
PRIVATE ${Boost_INCLUDE_DIRS}
)
target_link_libraries(${PROJECT_BINARY_NAME}
${Boost_FILESYSTEM_LIBRARY}
${Boost_SYSTEM_LIBRARY}
${Boost_THREAD_LIBRARY}
${Boost_PROGRAM_OPTIONS_LIBRARY}
${Boost_CHRONO_LIBRARY}
Threads::Threads
)Any CMake expert on board ? How do I link to the boost libraries correctly for my config ?
EDIT : IT was lacking :
Code: Select all
set(Boost_USE_STATIC_LIBS ON)Without it, my build was requesting static Boost, but CMake was linking dynamic Boost import libs.
So MSVC: tried to resolve static lib name (libboost_*) and did not find it in link line.
Error == LNK1104.
-
paul424
- Orc
- Posts: 414
- Joined: Thu May 24, 2012 7:16 pm
- x 23
Re: From the journal of the Windows Alchemist ...
The game still crashes on click on CEGUI button as described a few post before. What I have discovered : The linker option /FORCE:MULTIPLE is not harmless ! It tells MSVC:
“If two libraries define the same symbol, don’t error — just pick one.”
For example : If two libraries define:
global singleton
custom allocator
RTTI helper
inline function instantiated differently
/FORCE allows both copies to exist.
That can absolutely produce:
virtual call into wrong implementation
corrupted object layout
crash on button press ....
Removing the /FORCE:MULTIPLE option from the linking stage (and CMakeList.txt) did not cure the output binary opendungeons-plus.exe. However there are much less crashes -- I would say the chance for that lowered from 50% to 25% and I am able even to walk through the menus and start the game ......
There are some several other things to try when building binary here on Windows.
How much more pain it would cost me to fix the Windows binary?
-
paul424
- Orc
- Posts: 414
- Joined: Thu May 24, 2012 7:16 pm
- x 23
Re: From the journal of the Windows Alchemist ...
THIS seems to be the culprit ( however it requires further testing ! ) :
The problems seems to be gone after I enabled the OD_USE_SFML_WINDOW preporcessor branch !
Code: Select all
#ifdef OD_USE_SFML_WINDOW
bool running = true;
try {
while (running)
{
sf::Event event;
while (sfmlWindow.pollEvent(event)) {
if (event.type == sf::Event::Closed)
{
OD_LOG_INF("Requested window close ....");
frameListener.requestExit();
break;
}
else
{
if (event.type == sf::Event::Resized)
{
renderWindow->resize(event.size.width, event.size.height);
frameListener.windowResized(renderWindow);
}
frameListener.getModeManager()->getInputManager().handleSFMLEvent(event);
}
}
sfmlWindow.clear();
// If renderOneFrame returns false, it indicates that an exit has been requested
running = ogreRoot.renderOneFrame();
sfmlWindow.display();
}
}
catch (const CEGUI::Exception& e)
{
OD_LOG_ERR("a CEGUI exception " + e.what() + " has broken the main sfml loop");
throw ;
}
catch (const Ogre::Exception& e)
{
OD_LOG_ERR("an Ogre exception " + e.what() + " has broken the main sfml loop");
throw ;
}
catch (const boost::exception& e)
{
OD_LOG_ERR("a boost exception " + dynamic_cast<std::exception const&>(e).what()+ " has broken the main sfml loop");
throw;
}
catch (const OIS::Exception& e)
{
std::stringstream ss;
ss << "an OIS exception " << e.what() << " " + static_cast<int>(e.eType) << " " << e.eLine << " " << e.eFile << " " << e.eText << " has broken the main sfml loop";
OD_LOG_ERR(ss.str());
throw;
}
catch (const std::exception& e)
{
OD_LOG_ERR("a std exception " + e.what() + " has broken the main sfml loop");
throw;
}
catch (...)
{
OD_LOG_ERR("an unkown exception has broken the main sfml loop");
throw ;
}
#else /* OD_USE_SFML_WINDOW */
ogreRoot.startRendering();
#endif /* OD_USE_SFML_WINDOW */That is the custom window loop is better it seeems then the OGRE native one !
Why is that ? I have not any idea .......
-
slapin
- Bronze Sponsor

- Posts: 388
- Joined: Fri May 23, 2025 5:04 pm
- x 28
Re: From the journal of the Windows Alchemist ...
I only can point that I'm so happy I did not invest much more time into my CEGUI struggles and just use Dear ImGUI. Sorry for interference.
-
paul424
- Orc
- Posts: 414
- Joined: Thu May 24, 2012 7:16 pm
- x 23
Re: From the journal of the Windows Alchemist ...
Problem is not in CEGUI, but the Windows system.... Now I fight to create console output in my program, this is ridiculous !
After the WINMAIN() entry function:
Code: Select all
#if OGRE_PLATFORM == OGRE_PLATFORM_WIN32
if (AttachConsole(ATTACH_PARENT_PROCESS))
{
freopen("CONOUT$", "w", stdout);
freopen("CONOUT$", "w", stderr);
freopen("CONIN$", "r", stdin);
}
#endifThere are of course switches /SUBSYSTEM:WINDOWS and /SUBSYSTEM:CONSOLE which force the proper behaviour ( the former is for GUI apps -- you must use WINMAIN() , the later is for console applications and you must use main()).
If you want to stay with the /SUBSYSTEM:WINDOWS style and yet produce console outpus via std::cout and std::cerr please use the above code pattern.
-
paul424
- Orc
- Posts: 414
- Joined: Thu May 24, 2012 7:16 pm
- x 23
Re: From the journal of the Windows Alchemist ...
so Good as DONE .... now only package the whole thing, that would be easy as rpgplayerobin showed me how to do it a dozen months ago for previous version and the process is wholly repeatable !
-
paul424
- Orc
- Posts: 414
- Joined: Thu May 24, 2012 7:16 pm
- x 23
-
slapin
- Bronze Sponsor

- Posts: 388
- Joined: Fri May 23, 2025 5:04 pm
- x 28
Re: From the journal of the Windows Alchemist ...
Waiting for Linux build on github with fresh Ogre... ![]()