News:

Accounts with zero posts and zero activity during the last months will be deleted periodically to fight SPAM!

Main Menu

Problem Running C programs

Started by Lamacide, June 21, 2013, 07:55:57 PM

Previous topic - Next topic

Lamacide

Recently I installed codeblocks for building of C programs, I did install with proper MinGW and path ' C:\Program Files (x86)\CodeBlocks\MinGW'

The problem I am having is when I build a new app in C and load just the hello world program I have red lines on any strings such as hello world

and, when I load the program it comes up with the proper black screen to attempt to show output, but the output of hello world never shows
and instead i get this

'Process returned 1974072457 (0x75A9F489)   execution time : 0.395 s
Press any key to continue.'

after execution i get this message on build log ' Process terminated with status 1974072457 (0 minutes, 8 seconds)'

what is strange is it loads C++ hello world just fine.
Any info would be greatly appreciated I can't find anything online on this subject.

Lamacide

here is the program just so you know it's not that there is no return 0; or main function problems

#include <stdio.h>
#include <stdlib.h>

int main()
{
    printf("Hello world!\n");
    return 0;
}

ToApolytoXaos

#2
No need for <stdlib.h> btw...the first thing that comes in mind is the space I see in Program Files.

My windows setup is TDM's GCC and wxMSW-2.8.12 both installed in C:\ location for sake of safety. I have had issues with spaces in the past and decided to install it in root location. Besides, is often recommended in many places.

The awkward thing though is that C++ works just fine. Are you copying code from the web and pasting it in a C project and try to compile it? Possibly you carry hidden characters with such action.

stahta01

C Programmer working to learn more about C++.
On Windows 10 64 bit and Windows 11 64 bit.
--
When in doubt, read the CB WiKi FAQ. [url="http://wiki.codeblocks.org"]http://wiki.codeblocks.org[/url]

jarod42

"red lines" come from spell cheker plugin: so configure it (with dictionary installation) or disable it.