472,958 Members | 2,154 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,958 software developers and data experts.

gcc (rh 9.0 ) I do not know how to correct the error...

program was taken from http://www.beyondlogic.org/parlcd/parlcd.htm

when compile under rh 9.0
I do not know how to correct this error.
can u help? there is dos.h in my linux box.
thanks.

[root@home BLCD]# gcc test5.c test5
gcc: test5: No such file or directory
test5.c:1: parse error before numeric constant
test5.c:9:17: dos.h: No such file or directory
In file included from test5.c:10:
/usr/include/string.h:39: parse error before "size_t"
/usr/include/string.h:42: parse error before "size_t"
/usr/include/string.h:51: parse error before "size_t"
/usr/include/string.h:58: parse error before "size_t"
/usr/include/string.h:61: parse error before "size_t"
/usr/include/string.h:65: parse error before "size_t"
/usr/include/string.h:86: parse error before "size_t"
/usr/include/string.h:93: parse error before "size_t"
/usr/include/string.h:99: parse error before "size_t"
/usr/include/string.h:106: parse error before "strxfrm"
/usr/include/string.h:107: parse error before "size_t"
/usr/include/string.h:176: parse error before "strcspn"
/usr/include/string.h:180: parse error before "strspn"
/usr/include/string.h:230: parse error before "strlen"
/usr/include/string.h:248: parse error before "size_t"
/usr/include/string.h:253: parse error before "size_t"
/usr/include/string.h:257: parse error before "size_t"
/usr/include/string.h:260: parse error before "size_t"
/usr/include/string.h:263: parse error before "size_t"
/usr/include/string.h:291: parse error before "size_t"
test5.c: In function `main':
test5.c:21: warning: return type of `main' is not `int'
[root@home BLCD]#

Jul 19 '05 #1
8 3974
Mylinux wrote:
[root@home BLCD]# gcc test5.c test5
gcc: test5: No such file or directory
test5.c:1: parse error before numeric constant


Unfortunately, you are not asking how C++ (the topic of one of your
newsgroups) works.

You are asking how gcc works - how to compile a C program with it, how to
direct it to included files, etc.

You must ask this question on a single newsgroup or mailing list that covers
gcc, for the best results.

(You also should attend to any Makefile or "configure" files that may have
come with this source.)

Use http://www.google.com and http://groups.google.com to find the best
forum for this question.

--
Phlip
Jul 19 '05 #2
[root@home BLCD]# gcc test5.c test5
gcc: test5: No such file or directory
test5.c:9:17: dos.h: No such file or directory
test5.c: In function `main':
test5.c:21: warning: return type of `main' is not `int'
[root@home BLCD]#
/* LCD Module Software */
/* 17th May 1997 */
/* Copyright 1997 Craig Peacock */
/* WWW - http://www.senet.com.au/~cpeacock */
/* Email - cp******@senet.com.au */
/* */
/* Register Select must be connected to Select Printer (PIN 17) */
/* Enable must be connected to Strobe (PIN1) */
/* DATA 0:7 Connected to DATA 0:7 */

#include <dos.h>
#include <string.h>

#define PORTADDRESS 0x378 /* Enter Your Port Address Here */

#define DATA PORTADDRESS+0
#define STATUS PORTADDRESS+1
#define CONTROL PORTADDRESS+2

void main(void)
{
char string[] = {"Testing 1,2,3 "
"It' Works ! "};
char init[10];
int count;
int len;
init[0] = 0x0F; /* Init Display */
init[1] = 0x01; /* Clear Display */
init[2] = 0x38; /* Dual Line / 8 Bits */

outportb(CONTROL, inportb(CONTROL) & 0xDF); /* Reset Control Port - Make
sure Forward Direction */

outportb(CONTROL, inportb(CONTROL) | 0x08); /* Set Select Printer (Register
Select) */

for (count = 0; count <= 2; count++)
{
outportb(DATA, init[count]);
outportb(CONTROL,inportb(CONTROL) | 0x01); /* Set Strobe (Enable)*/
delay(20); /* Larger Delay for INIT */
outportb(CONTROL,inportb(CONTROL) & 0xFE); /* Reset Strobe (Enable)*/
delay(20); /* Larger Delay for INIT */
}

outportb(CONTROL, inportb(CONTROL) & 0xF7); /* Reset Select Printer
(Register Select) */

len = strlen(string);

for (count = 0; count < len; count++)
{
outportb(DATA, string[count]);
outportb(CONTROL,inportb(CONTROL) | 0x01); /* Set Strobe */
delay(2);
outportb(CONTROL,inportb(CONTROL) & 0xFE); /* Reset Strobe */
delay(2);
}
}


Jul 19 '05 #3
I have ohter Makefile.
basically there is gcc test5.c test
since there is only one single test5.c. I think I should to ask expert to
help me out.
Jul 19 '05 #4
> void main(void)

:/
Jul 19 '05 #5

SenderX <xx*@xxx.xxx> wrote in message
news:6f4gb.504684$cF.180114@rwcrnsc53...
void main(void)
:/

[lcd@home BLCD]$ gcc -g -c test5.c -o test5
test5.c:9:17: dos.h: No such file or directory
test5.c: In function `main':
test5.c:20: warning: return type of `main' is not `int'
[lcd@home BLCD]$

I have tried that too.
but the error is like the above.

Jul 19 '05 #6
Jay
Mylinux wrote:
program was taken from http://www.beyondlogic.org/parlcd/parlcd.htm

when compile under rh 9.0
I do not know how to correct this error.
can u help? there is dos.h in my linux box.
thanks.

[root@home BLCD]# gcc test5.c test5
gcc: test5: No such file or directory


Stupidity will never get you very far.
Don't you even read the error messages?

Or is there something inherently difficult about
interpreting what "No such file or directory" means?

Jul 19 '05 #7
Mylinux wrote:
<snip>

This is not topical in comp.lang.c++. Please remove it from the
cross-post list when replying. Thank you.

-Kevin
--
My email address is valid, but changes periodically.
To contact me please use the address from a recent posting.

Jul 19 '05 #8
"Mylinux" <my*****@My.com> wrote in message news:<bl*********@imsp212.netvigator.com>...
[root@home BLCD]# gcc test5.c test5
FWIW, this is a C++ newsgroup, not a C newsgroup. Of course your
problem has nothing to do with either C or C++...
gcc: test5: No such file or directory
test5.c:9:17: dos.h: No such file or directory
ISO C++ does not have a <dos.h> header, nor do most systems which are
not DOS (e.g., Red Hat).

The function outportb() is not part of C++. Rather, it's part of some
system-specific API. I'm guessing that this code was written to be
built under DOS, but you're now trying to build it under Red Hat. C++
cannot do what you need; you need to use Linux-specific functionality.
Consult a Linux newsgroup for more info on that.
test5.c: In function `main':
test5.c:21: warning: return type of `main' is not `int'


main() must have int as its return type, not void. (And in C, it must
also return a value, e.g., 0).

- Shane
Jul 19 '05 #9

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Jim | last post by:
im using asp.net, C# to enter data into a table in sql server...however im getting this error: Input string was not in a correct format. Description: An unhandled exception occurred during the...
5
by: titan0111 | last post by:
#include<iostream> #include<iomanip> #include<cstring> #include<fstream> using namespace std; class snowfall { private: int ft;
1
by: Michael | last post by:
I am running a web server (IIS) on Windows 2003 SP 1. My ASP.NET C# applications run fine. However, my application is a combination of Classic ASP and C#. For some reason when you attempt to...
5
by: vbMental | last post by:
I am deep into a project and cannot get this to work correctly. I am trying to make a custom error page that will be able to know what exception occurred. I already know about the defaultRedirect...
5
by: blackg | last post by:
Input string not in correct format -------------------------------------------------------------------------------- I am trying to view a picture from a table. I am getting this error Input string...
37
by: jht5945 | last post by:
For example I wrote a function: function Func() { // do something } we can call it like: var obj = new Func(); // call it as a constructor or var result = Func(); // call it as...
6
by: VMI | last post by:
What's the correct way of using try...catch in my web application? For example, if I catch a connection error or something with the DB, how am I supposed to bubble it up to the web interface? Is...
1
by: differentsri | last post by:
THIS IS AN ASP.NET 1.1 APPLICATION IAM TRYING TO UPDATE THE FIELD BUT I AM NOT ABLE TO UPDATE IT? CAN U TELL THE REASON ? IT IS GIVING THE FOLLOWING ERROR BELOW I HAVE ALSO GIVEN THE CODE OF...
8
by: AAaron123 | last post by:
If IE is open I'd like my app to receive an event or otherwise know when IE receives a mouse click. Is that fairly easy to do? Thanks in advance
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 4 Oct 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
tracyyun
by: tracyyun | last post by:
Hello everyone, I have a question and would like some advice on network connectivity. I have one computer connected to my router via WiFi, but I have two other computers that I want to be able to...
2
by: giovanniandrean | last post by:
The energy model is structured as follows and uses excel sheets to give input data: 1-Utility.py contains all the functions needed to calculate the variables and other minor things (mentions...
4
NeoPa
by: NeoPa | last post by:
Hello everyone. I find myself stuck trying to find the VBA way to get Access to create a PDF of the currently-selected (and open) object (Form or Report). I know it can be done by selecting :...
3
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be using a very simple database which has Form (clsForm) & Report (clsReport) classes that simply handle making the calling Form invisible until the Form, or all...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 1 Nov 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM) Please note that the UK and Europe revert to winter time on...
3
by: nia12 | last post by:
Hi there, I am very new to Access so apologies if any of this is obvious/not clear. I am creating a data collection tool for health care employees to complete. It consists of a number of...
0
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be focusing on the Report (clsReport) class. This simply handles making the calling Form invisible until all of the Reports opened by it have been closed, when it...
0
isladogs
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.