Author Topic: Problem Running C programs  (Read 6190 times)

Offline Lamacide

  • Single posting newcomer
  • *
  • Posts: 2
Problem Running C programs
« 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.

Offline Lamacide

  • Single posting newcomer
  • *
  • Posts: 2
Re: Problem Running C programs
« Reply #1 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;
}

ToApolytoXaos

  • Guest
Re: Problem Running C programs
« Reply #2 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.
« Last Edit: June 21, 2013, 08:49:20 pm by ToApolytoXaos »

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7785
    • My Best Post
Re: Problem Running C programs
« Reply #3 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

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

Offline jarod42

  • Multiple posting newcomer
  • *
  • Posts: 87
Re: Problem Running C programs
« Reply #4 on: June 21, 2013, 10:41:02 pm »
"red lines" come from spell cheker plugin: so configure it (with dictionary installation) or disable it.