Code::Blocks 13.12 error - CC1.exe has stopped working - c

I am using Code::Blocks 13.12 for programming in C. After building and running my simple HelloWorld.c program, it gives an error.
Error: An alert box pop up saying -"cc1.exe has stopped working.A problem caused the program to stop working correctly.Windows will close the program and notify you if a solution is available."
I tried using Notepad++ , the same pop up appears saying a.exe has stopped working.
I am a naive,so have no idea on how to deal with this.
My queries:
1) Am I using an outdated version? If not, how can I get rid of this problem?
2) Which is the most efficient IDE available for C/C++ if Code::Blocks is not that efficient?
My requirement"
-I had been using Turbo C and it doesn't give errors like segmentation fault and other memory related errors that we get in online Compilers or compilers of competitive programming.So, I need an efficient compiler which behaves same as online compilers, so I don't get stuck while solving problems during competitive programming.
This is the simple code giving error:
#include <stdio.h>
void main()
{
printf("Hello world!");
//return 0;
}
Edit:
Even after changing the code to return int, it's giving an error.I tried editing the code as below, but the same window is being popped up again.
int main(void)
{
printf("Hello world!");
return 0;
}

There's no problem with your code, though indeed, as pointed out in the comments, neither void main() nor int main(void) is considered correct, but that's not what's causing the problem. cc1.exe is a MinGW-related file (MinGW is the GCC port for Windows that Code::Blocks uses by default for compilation); if it's crashing, it's possible the installation is corrupt.
I suggest you try reinstalling MinGW - remove Code::Blocks, install the standalone MinGW version, then download Code::Blocks without the compiler suite, install it and configure to use your version of MinGW.

For me, the solution was to choose,
Select target -> Release
from the Build menu. It took lots of time for me to find this!

Related

How to compile C program in Visual Studio Code?

I installed VSC and wrote this program
#include <stdio.h>
int main( void )
{
printf("Hello world!");
}
Then I installed a C/C++ debugger and I saved the file on the desktop as "hello.c" and magically the syntax became higlighted.
Now I would like to run the program, but can't find a way.
There's no "run" or "build" option anywhere, and if I start the debugging and choose the debugger then I got a new tab named "settings.json" with a couple of brackets waiting for me to write something.
Also in the left I can read that I "have not yet opened a folder". What does it even mean?
And the line #include <stdio.h> is underlined in red, like there's something wrong going on, maybe I have to download the library?
I would do anything to see the output of the program, please help me.
have you added c/c++ and code runner extensions?

codeblocks autocomplete / calltips not working for C standard library functions

I'm trying to start using code::blocks to do some C programming in just to learn. I was hoping to use the codecompletion / calltips feature (e.g. when typing say "printf" it popsup a handy dropdown box that shows the parameters.
I've made a new project and a new file in that project called "hello.c"
#include <stdio.h>
int main(){
int test=0;
printf("%d",test);
return 0;
}
but midway through typing prin---only "priority_queue and private" show up, no printf functions, and nothing happens when pressing ctrl-j, ctrl-space, alt-shift-space, ctrl-n or p nothing works. I've tried reparsing the project. I initially had 13.12 version installed because that's what Ubuntu (14.04.4LTS) had but then I installed version 16.01 by mucking with the apt-get ppas. That version also doesn't work. I've tried disabling and reenabling the code completion plugin and I've made sure under settings->editor-> that code completion box is checked.
What am I doing wrong here? Any help would be very appreciated. Thanks so much!
The new Code::Blocks IDE is not so polished on Ubuntu yet. You can try reinstalling it. And if it didn't work try reverting to 13.12.

Error in linking in C using C-free compiler

I'm using C-Free compiler for c. This was my first program after installation.
I have also installed MinGw.
Here's my program.
#include<stdio.h>
int main()
{
printf("Hello World!");
}
I have this error and I don't know how to solve it.
[Error]\mingw\lib\crt2.o:(.text+0x188):undefined refrence to `__dyn_tls_init_callback`
[Error]\mingw\lib\crt2.o:(.text+0x1c6):undefined refrence to `_setargv`
[Error]collect2:ld returned 1 exit status
Sounds like your installation is corrupted. Check if you have MINGW installed twice.

Error running *.c file in Eclipse Kepler

I've started programming in C so weeks ago, and I choose Eclipse Kepler as my IDE for C, since I had already used it for programming in some other languages and really liked.
However, after I had installed Cygwin and the C programming tools in Eclipse, I tried to run the old "Hello World" and it didn't work, It didn't appeared anything in the Console, only the message "Terminated".
#include <stdio.h>
int main(){
printf("Hello World!");
return 0;
}
Anyone has any idea what the problem could be?
Thanks to all of you. I tried everything you said but I wasn't able to get my problem solved. I gave up! Right now, i'm using as workspace in eclipse the Cygwin home. I write the program in the Eclipse and run it in the Cygwin command line.
Again, thanks to all for trying to help, it won't be forgotten. You're a really awesome crowd!
Maybe the program was too fast for you to see it?
The window with the program output appeared and disappeared in the blink of an eye.
You could try to prevent that from happening by changing your program to do its stuff AND wait for ENTER before it terminates.
#include <stdio.h>
int main(){
printf("Hello World!");
getchar(); /* simple wait for ENTER, error prone in more complicated programs */
return 0;
}
Note: your original program "prints a string"; this version "prints a string and waits for ENTER". It's a program with different requirements. If you want to keep to your initial requirements, try running the program from the DOS console.
you could try to system("pause") may this can help
#include <stdio.h>
int main(){
printf("Hello World!");
system("pause");
return 0;
}

Compiling real mode asm (rootkit.arsenal)

Im stuck on compiling the tsr.asm code provided in the book rootkit arsenal.
I installed open watcom on a XP maschine and the first asm listing was compiled well.
When compiling, it throws the error: "multiple starting address found" (nothing found on google). Can anyone confirm that this code is compilable, and how?
Im thankful for any suggestions.
When you're writing some code, there is a particular address where the execution is to begin (the main function in C for example), but in your code there are more than one starting address, and it crashes when compiling. But without seeing the code I can't tell you more.
Sorry for the late answer, but I was searching for an answer to this and just figured it out - hopefully it'll help someone else Googling around for an answer.
Since you're using OpenWatcom (I'm using version 1.9), I'll assume that you have tsr.asm in its own OpenWatcom 16-bit DOS COM project. In the IDE, go to Targets -> Target Options -> Linker Switches. In the window that appears, select "2. Import, Export and Library Switches" from the drop-down at the top and remove the cstart_t entry under "Library files(,): [libf]".
Recompile, and your TSR COM file should be generated.

Resources