|
| 1 | +# Troubleshooting Guide |
| 2 | + |
| 3 | +So some peeps hav encountered issues while running the app so here are some of the ways to troubleshoot it. :D |
| 4 | +Please pray and support so I build this in C++ and make it cross-platfrom (I am a student and have exams and research work to do ;-;) |
| 5 | + |
| 6 | +--- |
| 7 | + |
| 8 | +## Wine / Linux Issues |
| 9 | + |
| 10 | +### Error: "ImportError: DLL load failed while importing QtWidgets" |
| 11 | + |
| 12 | +**Symptoms:** |
| 13 | +``` |
| 14 | +wine CppLabEngine.exe |
| 15 | +0024:err:module:import_dll Library icuuc.dll not found |
| 16 | +0024:err:module:import_dll Library Qt6Core.dll not found |
| 17 | +... |
| 18 | +ImportError: DLL load failed while importing QtWidgets: Module not found. |
| 19 | +``` |
| 20 | + |
| 21 | +**Cause:** The Windows .exe build is packaged with PyInstaller and requires native Windows. Qt6 dependencies are not compatible with Wine. |
| 22 | + |
| 23 | +**Solution:** Run CppLabEngine from source on Linux/macOS: |
| 24 | + |
| 25 | +```bash |
| 26 | +# Install dependencies (Debian/Ubuntu) |
| 27 | +sudo apt install python3 python3-pip python3-venv mingw-w64 |
| 28 | + |
| 29 | +# Or on macOS |
| 30 | +brew install python3 mingw-w64 |
| 31 | + |
| 32 | +# Clone and run |
| 33 | +git clone https://github.com/techy4shri/CppLabEngine.git |
| 34 | +cd CppLabEngine |
| 35 | +python3 -m venv .venv |
| 36 | +source .venv/bin/activate |
| 37 | +pip install -r requirements.txt |
| 38 | +python run_cpplab.py |
| 39 | +``` |
| 40 | + |
| 41 | +**Why Wine doesn't work:** |
| 42 | +- PyInstaller bundles Python runtime but Qt6 DLLs need system libraries |
| 43 | +- Qt6 has complex dependencies (ICU, D3D, etc.) not available in Wine |
| 44 | +- Wine's Windows API emulation is incomplete for modern Qt6 applications |
| 45 | + |
| 46 | +**Alternative:** Use native Linux C++ IDEs like: |
| 47 | +- Code::Blocks with MinGW cross-compiler |
| 48 | +- QtCreator |
| 49 | +- VS Code with C++ extensions |
| 50 | + |
| 51 | +--- |
| 52 | + |
| 53 | +## Windows Issues |
| 54 | + |
| 55 | +### "Unknown Publisher" Warning |
| 56 | + |
| 57 | +**Symptoms:** Windows Defender shows "Windows protected your PC - Unknown publisher" |
| 58 | + |
| 59 | +**Cause:** The .exe is not code-signed with a certificate from a trusted Certificate Authority. |
| 60 | + |
| 61 | +**Solutions:** |
| 62 | +1. **Click "More info" → "Run anyway"** (safe if downloaded from official GitHub releases) |
| 63 | +2. **For developers:** Sign the executable - see [SIGNING.md](SIGNING.md) for instructions |
| 64 | +3. **For users:** Verify SHA256 checksum matches the one in release notes |
| 65 | + |
| 66 | +### Slow Builds / Antivirus Scanning |
| 67 | + |
| 68 | +**Symptoms:** |
| 69 | +- Builds take several seconds even for small files |
| 70 | +- Disk activity spikes during compilation |
| 71 | + |
| 72 | +**Cause:** Antivirus software scans every compiler invocation and generated .exe file. |
| 73 | + |
| 74 | +**Solution:** |
| 75 | +1. Add CppLabEngine folder to antivirus exclusions |
| 76 | +2. Windows Defender: Settings → Virus & threat protection → Exclusions → Add folder |
| 77 | +3. Example path: `C:\Users\YourName\CppLabEngine\` |
| 78 | + |
| 79 | +### File Save Issues |
| 80 | + |
| 81 | +**Symptoms:** Files don't save or changes are lost |
| 82 | + |
| 83 | +**Cause:** Permissions issue or file locked by another process |
| 84 | + |
| 85 | +**Solutions:** |
| 86 | +1. Check file permissions (read-only?) |
| 87 | +2. Close any external editors/viewers |
| 88 | +3. Save As to a different location |
| 89 | +4. Run IDE as administrator (not recommended for normal use) |
| 90 | + |
| 91 | +### App Crashes on Launch |
| 92 | + |
| 93 | +**Symptoms:** CppLabEngine.exe crashes immediately or shows error dialogs |
| 94 | + |
| 95 | +**Possible Causes:** |
| 96 | +1. **Missing Visual C++ Redistributable**: Install latest [VC++ Redist](https://aka.ms/vs/17/release/vc_redist.x64.exe) |
| 97 | +2. **Corrupted download**: Re-download the .zip and extract to new location |
| 98 | +3. **Path with special characters**: Move to simple path like `C:\CppLabEngine` |
| 99 | +4. **Antivirus blocking**: Temporarily disable antivirus during first launch |
| 100 | + |
| 101 | +**Debug steps:** |
| 102 | +1. Check Windows Event Viewer for crash details |
| 103 | +2. Try running from command prompt to see error messages: |
| 104 | + ```cmd |
| 105 | + cd C:\path\to\CppLabEngine |
| 106 | + CppLabEngine.exe |
| 107 | + ``` |
| 108 | + |
| 109 | +--- |
| 110 | + |
| 111 | +## Build Issues |
| 112 | + |
| 113 | +### "Toolchains Not Found" Warning |
| 114 | + |
| 115 | +**Symptoms:** Build menu is disabled, warning about missing MinGW |
| 116 | + |
| 117 | +**Cause:** Compiler toolchains not found in `compilers/` directory |
| 118 | + |
| 119 | +**Solution:** |
| 120 | +1. Ensure `compilers/mingw32/` and `compilers/mingw64/` exist |
| 121 | +2. Check that `bin/gcc.exe` and `bin/g++.exe` are present in each |
| 122 | +3. Re-extract the full release archive (don't copy just the .exe) |
| 123 | +4. For custom setup, see [BUILDING.md](BUILDING.md) |
| 124 | + |
| 125 | +### Graphics Programs Won't Build |
| 126 | + |
| 127 | +**Symptoms:** `undefined reference to 'initgraph'` or similar graphics.h errors |
| 128 | + |
| 129 | +**Cause:** Missing 32-bit MinGW or WinBGIm libraries |
| 130 | + |
| 131 | +**Requirements:** |
| 132 | +- Must use 32-bit toolchain (mingw32) |
| 133 | +- WinBGIm libraries must be in `compilers/mingw32/lib/` |
| 134 | +- Libraries: `libbgi.a`, `libgdi32.a`, `libcomdlg32.a`, etc. |
| 135 | + |
| 136 | +**Solution:** |
| 137 | +1. Ensure project uses "Graphics Application" type |
| 138 | +2. Or for console project: Enable graphics feature in `.cpplab.json` |
| 139 | +3. Verify files exist: |
| 140 | + ``` |
| 141 | + compilers/mingw32/lib/libbgi.a |
| 142 | + compilers/mingw32/include/graphics.h |
| 143 | + ``` |
| 144 | + |
| 145 | +### OpenMP Programs Won't Build |
| 146 | + |
| 147 | +**Symptoms:** `#pragma omp` directives ignored or `omp.h` not found |
| 148 | + |
| 149 | +**Cause:** Using 32-bit toolchain or OpenMP not enabled |
| 150 | + |
| 151 | +**Requirements:** |
| 152 | +- Must use 64-bit toolchain (mingw64) - better OpenMP support |
| 153 | +- OpenMP feature must be enabled |
| 154 | + |
| 155 | +**Solution:** |
| 156 | +1. Use "Console Application" with OpenMP enabled |
| 157 | +2. Or manually enable in `.cpplab.json`: |
| 158 | + ```json |
| 159 | + "features": { |
| 160 | + "openmp": true |
| 161 | + } |
| 162 | + ``` |
| 163 | +3. Select "64-bit (mingw64)" in toolbar |
| 164 | + |
| 165 | +--- |
| 166 | + |
| 167 | +## Runtime Issues |
| 168 | + |
| 169 | +### Program Input Not Working |
| 170 | + |
| 171 | +**Symptoms:** Programs using `cin`, `scanf()`, `getchar()` don't accept input |
| 172 | + |
| 173 | +**Solution (v1.0.0+):** All programs now run in external terminal by default |
| 174 | +- Press F5 or Build → Run to launch in new cmd window |
| 175 | +- Input works normally in the terminal |
| 176 | +- Close terminal window when done |
| 177 | + |
| 178 | +**Old versions:** Update to latest release |
| 179 | + |
| 180 | +### Graphics Window Doesn't Appear |
| 181 | + |
| 182 | +**Symptoms:** Program compiles but no graphics window shows |
| 183 | + |
| 184 | +**Possible Causes:** |
| 185 | +1. **Wrong toolchain**: Graphics requires 32-bit MinGW |
| 186 | +2. **Missing DLLs**: Graphics libraries not linked |
| 187 | +3. **Code error**: Check `initgraph()` return value |
| 188 | + |
| 189 | +**Debug:** |
| 190 | +```cpp |
| 191 | +#include <graphics.h> |
| 192 | +int main() { |
| 193 | + int gd = DETECT, gm; |
| 194 | + initgraph(&gd, &gm, (char*)""); |
| 195 | + |
| 196 | + if (graphresult() != grOk) { |
| 197 | + printf("Graphics error: %s\n", grapherrormsg(graphresult())); |
| 198 | + return 1; |
| 199 | + } |
| 200 | + |
| 201 | + // Your graphics code here |
| 202 | + |
| 203 | + getch(); |
| 204 | + closegraph(); |
| 205 | + return 0; |
| 206 | +} |
| 207 | +``` |
| 208 | + |
| 209 | +### Program Runs but Terminal Closes Immediately |
| 210 | + |
| 211 | +**Symptoms:** Can't see program output, terminal flashes and closes |
| 212 | + |
| 213 | +**Cause:** This is by design - programs are launched with `cmd /k` which keeps window open |
| 214 | + |
| 215 | +**If it still closes:** Add pause at end of your code: |
| 216 | +```cpp |
| 217 | +// C++ |
| 218 | +std::cout << "\nPress Enter to exit..."; |
| 219 | +std::cin.get(); |
| 220 | + |
| 221 | +// C |
| 222 | +printf("\nPress Enter to exit..."); |
| 223 | +getchar(); |
| 224 | +``` |
| 225 | +
|
| 226 | +--- |
| 227 | +
|
| 228 | +## Compilation Errors |
| 229 | +
|
| 230 | +### "File not found" or Path Issues |
| 231 | +
|
| 232 | +**Symptoms:** Compiler can't find source files or headers |
| 233 | +
|
| 234 | +**Solutions:** |
| 235 | +1. **Avoid spaces in paths**: Use `C:\Projects\MyCode` not `C:\My Projects\My Code` |
| 236 | +2. **Avoid special characters**: Don't use `@`, `#`, `&`, etc. in folder/file names |
| 237 | +3. **Check case sensitivity**: `Main.cpp` vs `main.cpp` matters |
| 238 | +4. **Relative paths**: Headers should use relative includes: `#include "header.h"` |
| 239 | +
|
| 240 | +### "Permission Denied" Building |
| 241 | +
|
| 242 | +**Symptoms:** `gcc.exe: error: CreateProcess: Permission denied` |
| 243 | +
|
| 244 | +**Cause:** Antivirus is quarantining or blocking gcc.exe |
| 245 | +
|
| 246 | +**Solution:** |
| 247 | +1. Add `compilers/` folder to antivirus exclusions |
| 248 | +2. Temporarily disable real-time protection |
| 249 | +3. Check antivirus quarantine and restore gcc.exe |
| 250 | +
|
| 251 | +### Undefined Reference Errors |
| 252 | +
|
| 253 | +**Symptoms:** `undefined reference to 'function_name'` |
| 254 | +
|
| 255 | +**Common Causes:** |
| 256 | +1. **Missing library**: Add `-l` flag (e.g., `-lbgi` for graphics) |
| 257 | +2. **Linking order**: Libraries should come after source files |
| 258 | +3. **Wrong standard**: Some functions need specific C/C++ standard |
| 259 | +
|
| 260 | +**For graphics.h:** |
| 261 | +Ensure project type is "Graphics Application" or manually add: |
| 262 | +``` |
| 263 | +-lbgi -lgdi32 -lcomdlg32 -luuid -lole32 -loleaut32 |
| 264 | +``` |
| 265 | +
|
| 266 | +--- |
| 267 | +
|
| 268 | +## UI Issues |
| 269 | +
|
| 270 | +### Syntax Highlighting Slow or Frozen |
| 271 | +
|
| 272 | +**Symptoms:** Editor freezes when typing in large files |
| 273 | +
|
| 274 | +**Cause:** Syntax highlighter processes entire document on every keystroke |
| 275 | +
|
| 276 | +**Workaround:** |
| 277 | +1. Close other tabs to reduce memory usage |
| 278 | +2. Split large files into smaller modules |
| 279 | +3. Disable syntax highlighting (not yet implemented - feature request) |
| 280 | +
|
| 281 | +### Problems Table Not Updating |
| 282 | +
|
| 283 | +**Symptoms:** Errors persist after fixing code |
| 284 | +
|
| 285 | +**Solution:** Rebuild the project (F7) - diagnostics update on build, not on save |
| 286 | +
|
| 287 | +--- |
| 288 | +
|
| 289 | +## Getting Help |
| 290 | +
|
| 291 | +If your issue isn't listed here: |
| 292 | +
|
| 293 | +1. **Check existing issues**: [GitHub Issues](https://github.com/techy4shri/CppLabEngine/issues) |
| 294 | +2. **Search discussions**: [GitHub Discussions](https://github.com/techy4shri/CppLabEngine/discussions) |
| 295 | +3. **Ask for help**: Open a new issue with: |
| 296 | + - OS version (Windows 10/11) |
| 297 | + - CppLabEngine version |
| 298 | + - Steps to reproduce |
| 299 | + - Screenshots/error messages |
| 300 | + - Minimal code example that fails |
| 301 | +
|
| 302 | +--- |
| 303 | +
|
| 304 | +**Remember:** This is an educational tool designed for Windows college lab environments. For production development, consider professional IDEs like Visual Studio, CLion, or VS Code. |
0 commit comments