[C++] Unter Windows bequem kleinere C++ Codefetzen testen

Hanfling
Eine Sache die mich unter Windows stört ist, das, wenn man z.B. hier im Forum etwas postet, vorher nicht mal ganz schnell den Fetzen C/C++ Code testen kann, Unter Linux, etc. ist das ja kein großer Aufwand.

Ansatz:
Scite als Editor benutzen und daraus MingW32 aufrufen.

Als ersten installiert ihr am besten Scite, ein sehr netter minimalistischer Allround-Highlight-Editor, sollte sowieso auf keinem System fehlen. smile

http://scintilla.sourceforge.net/SciTEDownload.html
Am besten grabscht ihr euch da da unter
[Windows] -> Windows Executables -> A full download

Optional könnt ihr euch noch die Deutsche Sprachdatei dafür runterladen, welche ich allerdings persönlich extremst störend finde und danach im Menü nix mehr finde.

Wenn ihr Standardmäßig monospaced Fonts haben wollt und monospaced Fonts haben wollt, könnt ihr zum Beispiel in eurem SciTEser.properties file folgendes eingeben:
(Options -> Open User Options File)

code:
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
# Indentation
tabsize=2
indent.size=2

# Monospaced font as default
font.base=$(font.monospace)
font.small=$(font.monospace)
font.comment=$(font.monospace)
font.text=$(font.monospace)
font.text.comment=$(font.monospace)
font.embedded.base=$(font.monospace)
font.embedded.comment=$(font.monospace)
font.vbs=$(font.monospace)

Ich denke mal das wären die zwei wichtigsten Einstellungen.

Nun installieren ihr MingW32. Am besten nehmt ihr den Installer
http://sourceforge.net/project/downloadi....4.exe&72742761

Bei Package habe ich Candidate ausgewählt. Bei den Komponten solltet ihr folgendes auswählen:
* MinGW base tools
* g++ Compiler
* MinGW Make

Ich habe es mal nach C:\Programme\MinGW installiert.

Nun fügt ihr in eure User Options folgendes ein:
code:
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
mingw=C:/Programme/MinGW/
mingwccopts=-O2

command.name.2.*.c=Compile (executable)
command.2.*.c=$(mingw)bin/gcc $(mingwccopts) $(FileNameExt) -o $(FileName).exe -std=c99
command.is.filter.2.*.c=1

command.name.2.$(file.patterns.cplusplus)=Compile (executable)
command.2.$(file.patterns.cplusplus)=$(mingw)bin/g++ $(mingwccopts) $(FileNameExt) -o $(FileName).exe
command.is.filter.2.$(file.patterns.cplusplus)=1

Nun müsst ihr nur noch ggf. den Pfad anpassen. (Ich musste irgendwie nochmal den Installer aufrufen um g++ wirklich zu installieren...)

Zum testen könnt ihr eben das hier nehmen:
code:
1:
2:
3:
4:
5:
6:
7:
#include <stdio.h>
int main()
{
	printf("Hello Scite\n");
	return 0;
}
code:
1:
2:
3:
4:
5:
6:
7:
#include <iostream>
int main()
{
	std::cout << "Hello Scite++" << std::endl;
	return 0;
}
chrigu99
Das ist nicht bequem.