getch(); runtime error in c and codeblock [closed] - c

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
I use codeblocks IDE and gcc compiler. I tried to write the simple program billing system.We I use the getch(); for character input there will be no error during building the project but at run time there will be error and shows the error message like this "Drawing operation was attempted when there was no current window."
What was the actual problem.

You have not mentioned in what platform you are compiling. If it's Linux you can not use getch() since conio.h is only for dos. But with this error message is most probably caused by incorrect integration of gcc with Code::Blocks. Try compling with gcc directly.

since you are using in windows with Code::Blocks with gcc I'm safely assumeing you are using cygwin toolchain, which is a linux like environment. So I recomend you to use system("pause") including the header stdlib.h

Related

What is the best way to develop C for Linux on Windows? [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 1 year ago.
Improve this question
I am in uni, and we are learning C. Up until now, I haven't had any problems writing in VS Code and compiling in Cygwin. But now that we are on sockets, my IDE is next to useless. Having #include <sys/socket.h> in my code removes all the red squiggly errors to focus on the missing #include. When wrapping it in a #ifdef along with #include <winsock2.h> is inconsistent with its error showing, this will miss basic compilation errors like missing semicolons and return types.
Right now it seems my best option is to change the compiler and write it all to fit windows.
Is there an easier way to continue without drastically changing my work environment?
Install virtualisation software. For example VM Ware Workstation player which is free for personal/educational use
Install Linux
Install Eclipse
Program Linux programs on Linux running on the Windows machine.

How can I install a C compiler on windows 8? I do not want to use an IDE [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 7 years ago.
Improve this question
I have Cygwin, but can't figure out how to install GCC, Nano, Emacs or anything of the sort. Any help is appreciated.
You should select the installation of gcc and g++ when installing cygwin.
Here is a screenshot:
Also a quick google search gave me this and this which may also answer your question about nano and emacs
you can use TDM . A compiler suite for 32- and 64-bit Windows based on the GNU toolchain

Execution of C in linux [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
I am programming in NDK for android and it got me thinking. I know C is platform independent language but compiler dependent. With that in mind how does the execution of a C program vary from Windows->Linux->Mac. I mean the source code produces .obj file and .exe file in windows. But how about Linux or Mac? What type of file extension does it follow in Linux and Mac. If someone could elaborate on this, I would be very happy.
On linux and MacOs (Unix System) the files have the extension .c and to execute this you should compile them with
gcc -o myprog myprog.c
after it a binary file .o will be product and after you can run it with the file : myprog
by using this line of command :
./myprog
see how linux work if you are interesting by this you can read about Linux things like POSIX
I hope I have explain you the best way. (sorry i'm french :( )

Cannot find include directive in Netbeans (For C programming [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
I downloaded netbeans for C/C++. I followed every instructions and downloaded MinGW, and msys and added those to the environmental path. While trying to write a simple program it gives me warning that says "cannot find include file <stdio.h>". It says that for every include directive i seem to use in the program.
Can anybody tell me what is the problem here?
UPDATE: Turns our I did not install base package from MingW. After messing around with it a little bit, I got it working. Thanks everyone!

Unable to compile a c program in Codeblocks? [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 9 years ago.
Improve this question
I have installed codeblocks in windows 8 first time and try to run a simple C program but I get this error?
"can't find compiler executable in your search path (GNU GCC compiler)"
I tried many things to solve it but unable to compile.
I kind of encountered this problems long before.. when I was still using Windows and the Air-Quality in Beijing was still good at that time.
A problem code-blocks have, is that it might not find the proper C code compiler for you automatically. One think you can do.. is to go to the options(or something like that), and look for the compiler option, and it have some settings for you to set the compiler.
If you cannot find a proper compiler, I usually go install wxDev and use the wxDev's gcc in Code::Blocks.
Hope that helps :)

Resources