Code::Blocks Forums

User forums => Help => Topic started by: Lamacide on June 21, 2013, 07:55:57 pm

Title: Problem Running C programs
Post by: Lamacide on June 21, 2013, 07:55:57 pm
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.
Title: Re: Problem Running C programs
Post by: Lamacide on June 21, 2013, 08:00:37 pm
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;
}
Title: Re: Problem Running C programs
Post by: ToApolytoXaos on June 21, 2013, 08:04:50 pm
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.
Title: Re: Problem Running C programs
Post by: stahta01 on June 21, 2013, 10:03:27 pm
Post full "build log". (do a re-build and post the build log after turning on Full logging)

http://wiki.codeblocks.org/index.php?title=FAQ-Compiling_%28errors%29#Q:_How_do_I_troubleshoot_a_compiler_problem.3F (http://wiki.codeblocks.org/index.php?title=FAQ-Compiling_%28errors%29#Q:_How_do_I_troubleshoot_a_compiler_problem.3F)

Tim S.
Title: Re: Problem Running C programs
Post by: jarod42 on June 21, 2013, 10:41:02 pm
"red lines" come from spell cheker plugin: so configure it (with dictionary installation) or disable it.