gcc test5.c test5

M

Mylinux

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]#
I added this "/* in the left hand corner of the first line but I have the
above error.





what is happened. dos.h is found in the linux box.

/* LCD Module Software */
/* 17th May 1997 */
/* Copyright 1997 Craig Peacock */
/* WWW - http://www.senet.com.au/~cpeacock */
/* Email - (e-mail address removed) */
/* */
/* 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);
}
}
 
N

Noah Roberts

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

gcc -o test5 test5.c
test5.c:9:17: dos.h: No such file or directory

Linux != DOS.
test5.c: In function `main':
test5.c:21: warning: return type of `main' is not `int'
[root@home BLCD]#
I added this "/* in the left hand corner of the first line but I have the
above error.

I have no idea what that means.
what is happened. dos.h is found in the linux box.

If indeed dos.h is on your *linux* computer you obviously need to let
gcc know where. Assuming it is in "/some/dir/dos.h" you need

gcc -I/some/dir -o test5 test5.c

I am betting there is no dos.h on your linux computer. If indeed there
is you will also need to supply the correct linker options and I have
absolutely no idea what those would be.

Try "man gcc" as a command as well, and as others have said your asking
here is erroneous on 2 counts: 1 - not a C++ question at all, but C, and
2- not a language question but a compiler question. Try
comp.os.linux.development.apps.

NR
 
M

Mylinux

Noah Roberts said:
Mylinux said:
root@home BLCD]# gcc test5.c test5
gcc: test5: No such file or directory

gcc -o test5 test5.c
test5.c:9:17: dos.h: No such file or directory

Linux != DOS.
test5.c: In function `main':
test5.c:21: warning: return type of `main' is not `int'
[root@home BLCD]#
I added this "/* in the left hand corner of the first line but I have the
above error.

I have no idea what that means.
what is happened. dos.h is found in the linux box.

If indeed dos.h is on your *linux* computer you obviously need to let
gcc know where. Assuming it is in "/some/dir/dos.h" you need

gcc -I/some/dir -o test5 test5.c

I am betting there is no dos.h on your linux computer. If indeed there
is you will also need to supply the correct linker options and I have
absolutely no idea what those would be.

Try "man gcc" as a command as well, and as others have said your asking
here is erroneous on 2 counts: 1 - not a C++ question at all, but C, and
2- not a language question but a compiler question. Try
comp.os.linux.development.apps.

NR


dos.h is found in the linux box.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,059
Latest member
cryptoseoagencies

Latest Threads

Top