Reputation: 7716
I'm trying to compile C/C++ code from an external source using SciTE. The SciTE has a built-in feature where it searches for the gcc compiler and libraries in the same folder. The problem occurs if I try to compile from SciTE externally. Compiling with F5 (compile and run) or CTRL-F7 (compile) results in SciTE not being able to find the compiler.
I'm wondering if there is a way (there always is) to embed the gcc compiler's path into one of SciTE's files without generally rewriting SciTE's code?
EDIT: Found a solution in Linux.
Upvotes: 2
Views: 8615
Reputation: 499
I used MinGW as an external source to compile in C and C++ code in scite.
If you do not have MinGW you can get MinGW here: http://sourceforge.net/projects/mingw/files/Installer/mingw-get-inst/
mingw may have problems if installed into directories containing spaces.
After installing MinGW add the bin directory to sysytem path environment variables.
In scite:
cc=g++ $(ccopts) -c $(FileNameExt) -o $(FileName).o
cc=C:\MinGW\bin\g++.exe $(ccopts) -c $(FileNameExt) -o $(FileName).o
ccc=gcc.exe $(ccopts) -c $(FileNameExt) -o $(FileName).o
to ccc=C:\MinGW\bin\gcc $(ccopts) -c $(FileNameExt) -o $(FileName).o
command.go.$(file.patterns.cplusplus)=./$(FileName)
command.go.$(file.patterns.cplusplus)=$(FileName).exe
command.go.*.c=./$(FileName)
and change it similarly.Please note that you may have to change permissions in the scite folder before you will be able to save the changes to cpp.properties
Your code will now be able to compile (use shift+F7) and run(F5).
Upvotes: 4
Reputation: 11
Go to options -> cpp.properties -> goto line 303 or find the following line:
cc=g++ $(ccopts) -c $(FileNameExt) -o $(FileName).o
next line will be for gcc option.
Now set full path for gcc or g++ as follows,
ccc=D:\Dev-Cpp\bin\gcc.exe $(ccopts) -c $(FileNameExt) -o $(FileName).o
In the above line D:\Dev-Cpp\bin\gcc.exe is the path for gcc on my system. You can do the similar thing by editing the path according to your own installation of gcc. Once set write a program and compile.
Note: There are other options for you to set for example the standard to use for compiling your programs.
I hope it helps.
Upvotes: 1