Stay up-to-date with everything C++!
Content directly fetched from the subreddit just for you.
Join our group for discussions : @programminginc
Powered by : @r_channels
Post #24661
26
Solar simulator problem
Our Project
CosmoUIT - Educational 2D Solar System Simulator
5 students | C++17 + SFML 2.6.1 | Visual Studio 2022 | University project
Goal: Create a one-click executable CosmoUIT.exe with all resources bundled - a standalone simulator with realistic physics, planetary details, space missions, and educational quizzes.
---
Main Problems
1. UTF-8 BOM Nightmare
• Problem: 4000-line UI.cpp had invisible BOM bytes at start
• Error: syntax error: '?' on line 1
• Why it was hell: File looked PERFECT in Visual Studio - no visible characters, IntelliSense OK
• Cause: Used Notepad initially, which added BOM silently (0xEF 0xBB 0xBF)
• Time wasted: 2 full days
2. C++17 Deprecation
• Problem: std::randomshuffle removed in C++17
• Error: 'randomshuffle': is not a member of 'std'
• Fix: Had to use std::shuffle with modern random engine
3. SFML DLL Deployment Hell
• Problem: Build succeeded but runtime failed
• Error: sfml-graphics-d-2.dll was not found
• Issue: Debug vs Release DLL mismatch
• Goal blocked: Couldn't create standalone CosmoUIT.exe for weeks
---
Questions
1. How do you prevent BOM in C++ projects automatically?
2. Why doesn't Visual Studio warn about BOM in source files?
3. Best tools to detect encoding issues?
4. How to create a truly portable .exe with SFML on Windows?
Final Goal: We wanted a simple double-click CosmoUIT.exe that works anywhere - took us way too long to achieve.
https://redd.it/1q9lerl
@r_cpp
Our Project
CosmoUIT - Educational 2D Solar System Simulator
5 students | C++17 + SFML 2.6.1 | Visual Studio 2022 | University project
Goal: Create a one-click executable CosmoUIT.exe with all resources bundled - a standalone simulator with realistic physics, planetary details, space missions, and educational quizzes.
---
Main Problems
1. UTF-8 BOM Nightmare
• Problem: 4000-line UI.cpp had invisible BOM bytes at start
• Error: syntax error: '?' on line 1
• Why it was hell: File looked PERFECT in Visual Studio - no visible characters, IntelliSense OK
• Cause: Used Notepad initially, which added BOM silently (0xEF 0xBB 0xBF)
• Time wasted: 2 full days
2. C++17 Deprecation
• Problem: std::randomshuffle removed in C++17
• Error: 'randomshuffle': is not a member of 'std'
• Fix: Had to use std::shuffle with modern random engine
3. SFML DLL Deployment Hell
• Problem: Build succeeded but runtime failed
• Error: sfml-graphics-d-2.dll was not found
• Issue: Debug vs Release DLL mismatch
• Goal blocked: Couldn't create standalone CosmoUIT.exe for weeks
---
Questions
1. How do you prevent BOM in C++ projects automatically?
2. Why doesn't Visual Studio warn about BOM in source files?
3. Best tools to detect encoding issues?
4. How to create a truly portable .exe with SFML on Windows?
Final Goal: We wanted a simple double-click CosmoUIT.exe that works anywhere - took us way too long to achieve.
https://redd.it/1q9lerl
@r_cpp