Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » C / C++ IDE (CDT) » C++ projects give no output, am I doing something wrong?(C++ projects wont give me an output, c will though.)
C++ projects give no output, am I doing something wrong? [message #1064168] Tue, 18 June 2013 01:48 Go to next message
Nick G is currently offline Nick GFriend
Messages: 3
Registered: June 2013
Junior Member
Downloaded the C/C++ eclipse IDE today, tried out a simple hello world C project, the one the IDE includes worked fine I think. Then I tried the hello world C++ project, it compiled but it would not print on the console in eclipse. Did I do something wrong? I just started a normal C++ project that the ide included and it wont work for some reason. Anyone know what to do?
Re: C++ projects give no output, am I doing something wrong? [message #1064217 is a reply to message #1064168] Tue, 18 June 2013 10:15 Go to previous messageGo to next message
Norbert Norbert is currently offline Norbert NorbertFriend
Messages: 1
Registered: June 2013
Junior Member
Hi there,
I am new to eclipse as well. I seem to have a problem with it all the time. I am trying to make it work for almost two weeks.
I am getting no output for the following code:
#include <stdio.h>
#include <stdlib.h>

int main()
{
  int a;

  printf("Enter an integer\n");
  scanf("%d", &a);

  printf("Integer that you have entered is %d\n", a);

  return 0;
}


There is nothing appearing on the console. If I change the main() to main(void) [i know this is wrong], then I get the following error:

c:/mingw/bin/../lib/gcc/mingw32/4.6.2/../../../../mingw32/bin/ld.exe: cannot open output file *******.exe: Permission denied

and this error persists even if I change the code back to normal.
I struggle to sort the eclipse out and make it work as I need it for my engineering project. I can program in Matlab so it won't be hard to do C. Just a little practice. If you cannot help me with this problem then just, please, tell me the name of other program I can use for C. Making eclipse work for two weeks makes me sick now.

Thanks in advance
Re: C++ projects give no output, am I doing something wrong? [message #1064364 is a reply to message #1064217] Tue, 18 June 2013 22:01 Go to previous messageGo to next message
Joost Kraaijeveld is currently offline Joost KraaijeveldFriend
Messages: 273
Registered: July 2009
Senior Member
I assume that you read the FAQ:
http://wiki.eclipse.org/CDT/User/FAQ#Eclipse_console_does_not_show_output_on_Windows
?


Cheers,

Joost
Re: C++ projects give no output, am I doing something wrong? [message #1064376 is a reply to message #1064364] Wed, 19 June 2013 02:12 Go to previous messageGo to next message
Nick G is currently offline Nick GFriend
Messages: 3
Registered: June 2013
Junior Member
Yep, when I put the

setvbuf(stdout, NULL, _IONBF, 0);
setvbuf(stderr, NULL, _IONBF, 0);

At the start of main like it tells me to it gives me like 4 errors.

EDIT: Those errors being _IONBF stdout, stderr, and setvbuf were not declared in this scope.

[Updated on: Wed, 19 June 2013 02:29]

Report message to a moderator

Re: C++ projects give no output, am I doing something wrong? [message #1064558 is a reply to message #1064376] Wed, 19 June 2013 21:22 Go to previous messageGo to next message
Esa Varemo is currently offline Esa VaremoFriend
Messages: 3
Registered: June 2013
Junior Member
They are part of the stdio.h header, so try including that
(put
#include <stdio.h>
in the beginning of your source file)
Re: C++ projects give no output, am I doing something wrong? [message #1064741 is a reply to message #1064558] Thu, 20 June 2013 18:37 Go to previous message
Nick G is currently offline Nick GFriend
Messages: 3
Registered: June 2013
Junior Member
Got the errors to go away but didn't make it output. : /
Previous Topic:how to integrate a customer-developed simulator to debug in CDT
Next Topic:problem of C++ compile for AVR
Goto Forum:
  


Current Time: Fri Oct 04 03:26:40 GMT 2024

Powered by FUDForum. Page generated in 0.03517 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top