I am getting Error Code 2 when compiling C Program using Notepad++ - nppexec

Using instructions I found on stackoverflow I am trying to use NppExec to compile my C files, run them, and show their output, all within Notepad++.
However when I try to use it I get this error message (see below) in Console.
Does anyone know how I fix this?
TIA
Roger
These are the instructions I followed:
I am using MinGW compiler.
Go to plugins->NppExec->Execute
paste this into there
NPP_SAVE
CD $(CURRENT_DIRECTORY)
C:\MinGW32\bin\gcc.exe -g "$(FILE_NAME)"
a
(Remember to give above four lines separate lines.)
Now, give name, save and ok.
Restart Npp.
Go to plugins->NppExec->Advanced options.
Menu Item->Item Name (I have C compiler)
Associated Script-> from combo box select the above name of script.
Click on Add/modify and Ok.
Now assign shortcut key as given in first answer.
Current directory: C:\Users\Roger\Documents\Personal\UNB\F19\CS2263\Programs
C:\MinGW32\bin\gcc.exe -g "playStack.c"
; about to start a child process: "C:\MinGW32\bin\gcc.exe -g "playStack.c""
CreateProcess() failed with error code 2:
The system cannot find the file specified.
a
; about to start a child process: "a"
CreateProcess() failed with error code 2:
The system cannot find the file specified.

Related

How to feed file input into C program in Xcode

I have a program that I built in Xcode however I need to supply input to the program in the following way as would be done from the Terminal:
./program < fileInput
I followed the steps suggested here Running C scripts with terminal instead of Xcode but no luck.
Below is the screenshot of my attempt. The file I'm providing exists in the Build directory. I also tried supplying the input file as absolute path without any luck either. My xcode version is 8.1.
The screenshot:

How do you run programs in Windows terminal?

What is the windows equivalent to "./filename"
So for example I would usually compile by doing something like:
gcc -c homework1.c
gcc -o homework1 homework1.o
This would give me the executable names homework1
And for me to run the program, I would type: ( ./homework1 ) <-- ignore the parenthesis.
Usually I was write all my code in my schools Unix Shell thingy and I also compile it and run it there, but recently I think I took up all the disc space (because it says "disc quota exceeded").
Run cmd.exe
Go to where the program is example : cd C:\foder1\
Then type the program name with extension, for example : test1.exe or "test1.exe"
In windows (as in Linux) you can either run a program though a GUI interface or from a shell environment.
The GUI option is a program called Explorer, you navigate through the file system and double click executable files to run then. Executable typically have the extension '.exe' or '.bat', but there are others.
The shell environment in windows is called the 'command prompt', you can run it by going to the start menu and selecting 'run' or simply press the windows key and 'r' simultaneously. A box will popup, type 'cmd' (without the quotes) and hit enter - the command prompt should open. From there you can navigate the file system using commands like 'cd'. To run your executable type the name of the file (it should work with or without the '.exe').
A nice shortcut to open the command prompt already at a particular path, is to browse to the folder in Explorer, hold shift and then right-click the folder - the resulting context menu that pops up should have an option like 'open in command prompt'.

emacs' org-cdlatex-mode, where do you put the cdlatex.el script?

Does anyone know where to put the cdlatex.el script written by C. Dominik to allow swift LaTeX math insertion within an *.org file? CDLatex is a minor mode that can work with Org-mode, at least that's what I gather.
I've followed the instructions given [in this link] but when I type M-x org-cdlatex-mode RET I get "Cannot open load file: no such file or directory, cdlatex" in the Emacs' echo buffer. What does it mean? I've also tried looking for a package named "cdlatex" in the list of packages (M-x list-packages) but there wasn't any. How do I get this minor mode activated in Org?
I'm running Windows 7, Emacs 24.1, Org-mode 8.2.10, AUCTEX 11.88, TexLive 2015. At least another user has this same problem, please check this address.
My emacs working path file is C:\home\.emacs.d\. Do I put the script in C:\home\.emacs.d\elpa\? Inside the ~\.emacs.d\elpa\ I also have yasnippets and auctex directories, among others. Here's a snapshot:
Put the cdlatex.el script in one of the Load paths. To find all the load paths type C-h v RET load-path RET, then pick one and place the script in there. Restart emacs (or the machine if you prefer) and try out the CDLaTeX mode in one of the *.org files by enabling it either through menu or keyboard command:M-x org-cdlatex-mode RET.
Unfortunately for me there's some configuration problem because every time I type backquote or backtick (`), Org doesn't seem to recognize it when in CDLaTeX mode. It says: "Wrong type argument: characterp, 134217782"

how to start executable from command line in windows

I have a program when I click it, it opens fine.But when I run it command prompt it gives an error that is related to a dll that my program uses.I do in cmd
"Path_to_program\program.exe"
And a note:my program is installed my D: drive
But it gives an error related to dll.the dll is in the same directory with program.I guess it is related to dll.is there an option to give the dll as dependency to my command?
You need to change to the same folder that the program is in so that your working directory matches.
Try
cd Path_to_program
program.exe

djgpp compiled harbour exe does not run in pure dos

I have compiled one clipper program using haarbour compiler and the c file produced was compiled using djgpp to produce final exe. This exe runs fine in console window of Windows 98.
However, when I exit to msdos prompt or try to run in pure dos, it does not give any error. But did not go further. however num lock and cap locks responds propery. When I press ctrl+al+del it gives me message hdpmi terminated by the user. I have tried cwsdpmi instead of Hdpmi32 but the problem remains same.
There is on exe HBRUN.exe which acts as an interpreter to .hrb files produced instead of stand alone exe. When I run HBRUn in pure do,it behaved in the same fashion. But when I runit another directory where no dbf files were there, it gave me error dbf file not found ! This also works fine in console window but compiled for pure DOS.
I think there is some problem with all the exes produced using harbour and djgpp if they are big.
one simple 5-6 line program's .hrb file was run correctly in pure dos by hbrun ( Size of hbrun is about 1700 K where as my exe file size is 950 K
Can anybody shade some light ?
Sadly, you're unlikely to find any help here. I would suggest approaching the Harbour Project itself for help. They can be found on github with their list of developers (with email addresses!)
Harbour is powerful.
http://harbour.github.io/
To run in pure DOS I would recommend you to try OPENWATCOM
Here is a copy of the message from Pritpal Bedi (one of the developers):
I could compile Harbour with OpenWatcom DOS.
Machine : WIndows 7 32 Bits
STEPS:
Downloaded: http://ftp.heanet.ie/pub/openwatcom/open-watcom-c-dos-1.9.exe
Installed in C:\WATCOM. Follow all default options when installing except making changes to AUTOEXEC.bat and CONFIG.sys.
WATCOM will save these two files with .DOS as extention.
Copy C:\Watcom\autoexec.dos C:\Watcom\m.bat
Redefine PATH statement as : SET PATH=C:\WATCOM\BINW;C:\Harbour\bin\dos\watcom;%PATH%
Keep all other SETs intact.
CD to C:\Harbour
Execute C:\Watcom\m.bat
Execute DOS-MAKE [ Do Not use "install" option, it will pollute your existing environment ]
Harbour binaries will be deposited in C:\Harbour\bin\dos\watcom
NOTE [ And it is strange ] that steps 7 and 8 will have to be repeated for few times
as console window from where you are initiating it will disappear, but do not worry,
it seems to be an issue with memory.
CD to harbour\tests
Issue : hbmk2 hello -workdir= -run
It appears long command line do not go through, so we have to shorten the path and hence command line length.
Be cheerful as you will see "Hello World" printed in current console.
Pritpal Bedi

Resources