Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Newcomers » Newcomers » Character input(How do I input a character from the keyboard (stdin))
Character input [message #1799809] Fri, 14 December 2018 05:38 Go to next message
Art Schupp is currently offline Art SchuppFriend
Messages: 4
Registered: January 2017
Junior Member
I have been trying to input a character from the keyboard using the simple program shown below, with many different variations, but have had no luck.

The program and error is shown below:
/*
* main.c
*/

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

int main ()
{
int c;

c = getchar(stdin);

asm ("sld %r1, c");
asm ("halt");
return 0;
}

When the function 'main' is compiled an errer like the one below occurs. Each time it compiles the file after "\\included\\scr\\ is
different even when it is included in the functions 'scr' file


Info: Internal Builder is used for build
"\\xgcc" -O0 -g3 -Wall -c -fmessage-length=0 -o "include\\src\\scanf.o" "..\\include\\src\\scanf.c"
Cannot run program "\xgcc": Launching failed

What am I doing wrong? Any help would be much appreciated.
Re: Character input [message #1799842 is a reply to message #1799809] Fri, 14 December 2018 15:29 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33140
Registered: July 2009
Senior Member
It's best to ask on the CDT forum: https://www.eclipse.org/forums/eclipse.tools.cdt


It doesn't look like you've configured a toolchain properly. I.e., "\\xgcc" looks kind of bogus to me.


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Character input [message #1799849 is a reply to message #1799842] Fri, 14 December 2018 19:26 Go to previous message
Tauno Voipio is currently offline Tauno VoipioFriend
Messages: 742
Registered: August 2014
Senior Member
Looking at the embedded assembler code in the snippet, it seems that the poster is attempting a cross-compile, but hides the fact from us.

The code snippet does not make sense, even on bare hardware.


--

Tauno Voipio
Previous Topic:two eclipse workspace use the same project
Next Topic:How can SpringLayout code be made immutable?
Goto Forum:
  


Current Time: Thu Apr 25 06:19:42 GMT 2024

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

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

Back to the top