473,569 Members | 2,688 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 4002
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(CONTRO L, inportb(CONTROL ) & 0xDF); /* Reset Control Port - Make
sure Forward Direction */

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

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

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

len = strlen(string);

for (count = 0; count < len; count++)
{
outportb(DATA, string[count]);
outportb(CONTRO L,inportb(CONTR OL) | 0x01); /* Set Strobe */
delay(2);
outportb(CONTRO L,inportb(CONTR OL) & 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.5046 84$cF.180114@rw crnsc53...
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.netv igator.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
21077
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 execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. ...
5
2823
by: titan0111 | last post by:
#include<iostream> #include<iomanip> #include<cstring> #include<fstream> using namespace std; class snowfall { private: int ft;
1
1354
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 access the Classic ASP components of the application you are presented with this useless error message: "The system cannot find the file specified" ...
5
1469
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 page - <customErrors mode="on" defaultRedirect="Error.aspx"/> But how do I reference the exception that occurred from that page? If I cant, then...
5
2504
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 not in the correct format. Input string was not in a correct format. Description: An unhandled exception occurred during the execution of the...
37
3912
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 a function
6
1484
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 there a correct way? Thanks for the help.
1
4743
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 THE PROGRAM PLEASE HELP ME Server Error in '/WebApplication1' Application....
8
1311
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
0
7703
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7926
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8138
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7679
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7983
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6287
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
3657
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3647
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2117
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.