Process terminated with status 255 - codeblocks

I run Ubuntu to dual boot with Windows 7, I used to work on a C++ project on Windows in VS2013, I imported it to code:: blocks (the original project is in my other partition with Windows on, and I assume I don't have root privileges on it, but I don't really know what I'm talking about). When I try to run my project (which runs fine on Windows) I get the following messages in the "Build log":
-------------- Run: Release Win32 in Huffman (compiler: GNU GCC Compiler)---------------
Checking for existence: /media/shoham/BC5461BE54617C50/Users/Administrator.Shoham-PC/workspace/Huffman/Huffman/Huffman
Executing: /media/shoham/BC5461BE54617C50/Users/Administrator.Shoham-PC/workspace/Huffman/Huffman/Huffman (in /media/shoham/BC5461BE54617C50/Users/Administrator.Shoham-PC/workspace/Huffman/Huffman/.)
Process terminated with status 255 (0 minute(s), 0 second(s))
Most people on the Internet say to install xterm or change the terminal in Settings->Environment..., but it doesn't work for me, even though I have xterm.
What's weird is that it works on a new project I create on my system to test this. By that I mean this:
int main()
{
return 0;
}
In a new project works.
Do I not have privilleges to my project on my other partition?
Do I have to make a new project copying the files? Or can I link them to be the same one?
What do I have to do to fix this?

I got a similar message too when I compile my C++ code in Code::Blocks IDE. To correct the problem, I changed the default console program to "konsole-e".
Settings->Environment-> Terminal to launch console programs: konsole -e

This error occurs as Code::Blocks is trying to start its default application to run console programs. And since this is an app you've not installed on your local machine it stops and outputs the error
Process terminated with status 255 (0 minute(s), 0 second(s)).
Installing xterm could solve this problem if this really is the default app Code::Block is searching for, but there is no need to do so. It is more helpful to look up the current settings and to pick an app that you've already installed.
Go to Settings > Environment and you'll find a dropdown saying Terminal to launch console programs. Here you can select a different default app to launch console programs in.
In Linux Mint this should be: gnome-terminal. In other Linux OS this can be a good choice: konsole-e. If none of them work just set up a very simple C++ program such as:
#include <iostream>
int main(){
std::cout << "Hello world! << std::endl;
return 0;
}
and try out different options Code::Blocks successfully opens up a Terminal and displays Hello world!.

Related

rustc disappears when executing cargo run on windows

I am curently developing a Rust program on Windows 10. A few months ago I created a library package using cargo. Since then, I've been developing this program. Whenever I want to execute what I have, I goto to cmd and execute the following command inside my cargo folder:
cargo run --release --bin main
But, a few weeks ago something strange started to happen. Whenever I execute this same command, I notice that the program in fact starts but it finishes preemptively (I know this because of the output to the terminal). When the program finishes it is supposed to write to the terminal "FINISHED". But this never happens. If I execute the command again (without changing the code), this time the only thing that's printed to the terminal is the build message that cargo puts out. Then, when I execute a third time, I have the following message on my terminal:
error: 'cargo.exe' is not installed for the toolchain 'stable-x86_64-pc-windows-msvc'
To install, run `rustup component add cargo --toolchain stable-x86_64-pc-windows-msvc`
Then if I execute the suggested command, I have the following:
component 'cargo' for target 'x86_64-pc-windows-msvc' was automatically added because it is required for toolchain 'stable-x86_64-pc-windows-msvc'
What's weird is that if I execute the previous cargo run command on the Ubuntu terminal application that I have (it simulates a linux terminal, but I am still on my windows file system), this problem doesn't occur. I can execute 100 or 1000 times and no problems. But this isn't good, since my program creates a multi threaded environment and my Ubuntu terminal is like a virtual machine, so I don't believe that I have access to all of my laptop's memory.
Currently I have the following version of rust on windows and my ubuntu terminal:
rustup 1.18.3 (435397f48 2019-05-22)
What I have been doing until now to solve this is on my windows is to reboot my computer and reinstall rust, since when I execute "rustup self uninstall" sometimes an error of not having permissions to install it appears (I only have 1 user on my pc and supposedly I have admin privileges).
I have googled this situation, but I haven't found anything regarding rustc disappearing when executing cargo run. Now I can't even run my program on windows cmd, since this problems happens every time.
The problem was the anti virus I had on my PC.
After replacing it the program is working perfectly and finishing without the problem I had with rustc.

Exit code 256 in Pascal on Mac OS X 10

I just have installed Lazarus on my MacBook Air with OS X 10. And when I want to run a code, it says
Exit code 256
Does anyone know, what should I do?
Explanation
I had the same problem. I tried to compile this extremely basic program:
program HelloWorld;
begin
Writeln('Hello, world');
end.
And I got the error message:
Compile Project, Target: HelloWorld: Exit code 256, Errors: 1
Fatal: Compilation aborted
I think this was due to the fact that I had installed macOS Sierra last weekend. So I re-installed (with some difficulties, see below) the fcp, fpcsrc and lazarus packages and recompiled the source. Now I got a success message.
Answer
So re-download the packages above (they may have longer names, but these are the base names). Then first install fpc, then fpcsrc and then lazarus. Note that if you simply double-click the .pkg files in the .dmg files, macOS Sierra will complain:
“lazarus.pkg” can’t be opened because it is from an unidentified developer.
So open the context menu (right click) and select Open. Then you will get:
“lazarus.pkg” is from an unidentified developer. Are you sure you want to open it?
Then you can click the Open button and it will start the installer anyway. Follow the instructions and all should install well.
After that, you should be able to compile your code without that ugly error message. Note that under OS X (or, as they call it now, macOS) you won't be able to debug console mode programs from the Lazarus IDE. You'll have to start it from the console.

Windows deletes make executable file upon running. Why?

I am trying to get some code running which uses make. I've downloaded and installed both MinGW (standard 32 bit) and TDM-GCCs flavor of MinGW on my 64-bit Windows 7 machine.
When I run make (i.e. mingw32-make.exe) in Administrator mode, I get the following error message:
Windows cannot access the specified path, or file. You may not have the appropriate permissions to access the item.
The weird/scary part is that, upon running, it immediately deletes the exe file.
I ran a checksum SHA1 as recommended in the comments using the Microsoft (R) File Checksum Integrity Verifier V2.05:
C:\path\to\folder>fciv.exe -sha1 mingw32-make.exe
//
// File Checksum Integrity Verifier version 2.05.
//
c8ae5c780ab7bed652883d6443b5bfe5e23d30c9 mingw32-make.exe
I don't understand what this output means, but maybe it's helpful to someone.
Notes:
This happens regardless of where the file is located on my pc.
This behavior is specific to the make program (others such as gfortran and gcc appear to be working fine)
Renaming the file makes no difference.
I am an administrator on the pc
Same behavior when I run the program from the explorer or command line.
My anti-virus program (Avast) does not detect any problems with the file when I scan it.
I got the MinGW setup file from this SourceForge page.
I got the TDM-GCC web installer from this page.
The file size is 219,662 bytes (from both the main MinGW and TDM-GCC packages)
I have run make from the command line where I have started the command prompt by way of selecting Run as Administrator in the context menu.
I have also tried to run make by selecting Run as Administrator when I have it selected.
I run the command mingw32-make when this behavior occurs. I have also tried renaming it to things like make and foo with the same result.
The first time this happened with both MinGW it deleted the original file and I re-installed it using the mingw-get application. From thereon after I started making copies of the original mingw32-make for testing.
For the make executable, I have all permissions (including Read & execute) except the special permissions field.
After using the process manager I found out it was indeed Avast that was the problem :S A couple of lines revealed avast actually deleted the file before windows got around to executing it, which was the reason for the windows message. I put Avast on 'Silent Mode' a while back; I thought the only purpose of this mode was to suppress notifications about minor updates, but apparently it also gave Avast permission to deal with 'threats' silently as well.
After figuring that out the solution was straightforward. I just went into the settings and created an exception for the mingw32-make.exe file. It now runs without issue.
Thanks very much for your help everyone!
User account has administrator privilege but when user started to work , not all privilege are taken in account , just start your application for compiling with run with administrator mode try this : https://technet.microsoft.com/en-in/library/cc781763(v=ws.10).aspx

"cannot execute binary file" on Cygwin

Preface: Using cygwin on a Win7 machine.
I have some old (very old) f77 code (45,000 lines in 25 files) written by someone else that I am trying to use.
Yesterday I compiled, linked and ran it OK (using f77 compiler). I then made some mods (increasing array sizes) and kept getting segmentation faults when executing. Wondering if there was a compatibility problem I then fiddled with the settings in Windows (to no avail).
Now I cannot even run the compiled program - I get a "cannot execute binary file" error. I cannot even compile and run the original version of the code.
There were only some minor warnings during the compiling and none during the linking.
I have:
Checked permissions (all OK:- user::rwx)
Checked via file and get: "PE32 executable (console) Intel 80386, for MS Windows".
Written a test program to check my compiler commands and it ran as expected.
Copied all source code to another directory to see if that was problem (it didn't help).
Tried to run the executable from a windows command prompt and get "not a valid Win32 application" (and yet a previous executable executes OK).
What may have happened between yesterday and today that is stopping this program executing. Is it related to my fiddling with the compatibility settings? Or is it something in the code that lets it compile and link OK but not execute?
Any ideas appreciated.

"Hello world" Fortran (gfortran) fails to run in Windows 8.1

I have the following code:
PROGRAM TEST
IMPLICIT NONE
PRINT *, "test"
END PROGRAM TEST
It is compiled successfully using this command:
C:/cygwin64/bin/x86_64-w64-mingw32-gfortran.exe test.f08 -o test.exe
When I run the program by double clicking it, it produces the error:
"The application was unable to start correctly (0xc000007b). Click OK to close the application."
The file libgfortran-3.dll is in the same folder as the executable. My environment is Windows 8.1 64-bit. Cygwin (Setup.exe version 2.850 (64 bit)) is installed to C:\cyginw64. All defaults packages were installed, along with all "Base" and "Devel" packages. My system PATH environment variable includes C:\cygwin64\bin. Running the program from the Cygwin64 terminal produces no output.
What is causing this error? I have another, more complicated program that suffers from the same error.
Possibly related: why gfortran under cygwin can't compile correctly?
That error code is an NTSTATUS code, specifically STATUS_INVALID_IMAGE_FORMAT. Almost without fail that means you are trying to load a 32 bit module into a 64 bit process. Or vice versa. Use a dependency analysis tool to work out which module has the wrong bitness. For example Dependency Walker.

Resources