Skip to content

Commit 76f6b2b

Browse files
committed
bug fixes for file saving, using Qt's own document modification tracking (QTextDocument.isModified()) instead of trying to suppress signals. Also trying signing my build this time to prevent unknown publisher error. added troubleshooting info for linux peeps for now.
1 parent a221443 commit 76f6b2b

File tree

6 files changed

+566
-82
lines changed

6 files changed

+566
-82
lines changed

README.md

Lines changed: 34 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ Look, I know you would rather go with VS Code, but I ain't got that in my colleg
99

1010
## Downloads
1111

12+
### Windows Release (Standalone .exe)
13+
1214
**Latest Release: v1.0.0**
1315

1416
📦 [Download CppLabEngine-v1.0.0-win64.zip](https://github.com/techy4shri/CppLabEngine/releases/tag/v1.0.0)
@@ -18,7 +20,27 @@ Look, I know you would rather go with VS Code, but I ain't got that in my colleg
1820
2. Run `CppLabEngine.exe` - no installation needed
1921
3. Start coding with C/C++ immediately
2022

21-
**Requirements:** Windows 10/11 (64-bit) (again, this app was built in windows 11 so yeah, I got no idea if this will work with older versions but if it does, good for you)
23+
**Requirements:** Windows 10/11 (64-bit) - native Windows only, Wine is NOT supported
24+
25+
### Linux/macOS Users
26+
27+
The Windows .exe build **does not work under Wine** due to Qt6 dependencies. Instead, run from source:
28+
29+
```bash
30+
# Install dependencies
31+
sudo apt install python3 python3-pip python3-venv mingw-w64 # Debian/Ubuntu
32+
# or: brew install python3 mingw-w64 # macOS
33+
34+
# Clone and run
35+
git clone https://github.com/techy4shri/CppLabEngine.git
36+
cd CppLabEngine
37+
python3 -m venv .venv
38+
source .venv/bin/activate # or: .venv\Scripts\activate on Windows
39+
pip install -r requirements.txt
40+
python run_cpplab.py
41+
```
42+
43+
**Note:** MinGW cross-compilation toolchain is required on Linux/macOS to compile Windows executables.
2244

2345
## Features
2446

@@ -182,6 +204,8 @@ Each project contains a `.cpplab.json` file:
182204
This is an early release focused on core functionality:
183205

184206
- **Windows Only**: Currently targets Windows 10/11 (64-bit)
207+
- **Wine is NOT supported**: The PyInstaller .exe build requires native Windows for Qt6 dependencies
208+
- Linux/macOS users should run from source (see Downloads section)
185209
- **No Debugger**: Integrated debugging not yet implemented (use GDB externally)
186210
- **Build Performance**: Builds may be slow on some systems
187211
- Recommendation: Add CppLabEngine folder to antivirus exclusions for faster builds
@@ -217,6 +241,15 @@ The codebase follows these conventions:
217241
- PyInstaller (for building)
218242
- MinGW toolchains (not in repository)
219243

244+
## Troubleshooting
245+
246+
Having issues? Check the [Troubleshooting Guide](TROUBLESHOOTING.md) for solutions to common problems:
247+
- Wine/Linux compatibility issues
248+
- "Unknown Publisher" warnings
249+
- Slow builds and antivirus interference
250+
- Input/graphics/OpenMP problems
251+
- And more...
252+
220253
## License
221254

222255
The source code of Cpp Lab Engine is licensed under the **GNU General Public License v3.0 (GPL-3.0)**.

TROUBLESHOOTING.md

Lines changed: 304 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,304 @@
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

Comments
 (0)