LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 10-16-2009, 11:44 PM   #1
Danteleo
LQ Newbie
 
Registered: Oct 2006
Posts: 28

Rep: Reputation: 16
Error compiling C code


Hello all,

I'm working on connecting my computer to my RC car (cheap car) and found a tutorial of someone who got this working years ago. Well, the hardware is built and connected to my parallel printer port but, the code doesn't work. It's written in C (of which I am not knowledgeable) and presents me with some errors. I've manages to fix a couple by using Google but, have come to a stopping point.

I have emailed the dev but, don't expect to hear from him given the 6 yrs since the posting. Here is the source code. I'm using Ubuntu Jaunty.

Code:
/*
* rccar.c: lpt port control of a radio controlled car
*
* MORE INFO HERE:       http://www.engr.uvic.ca/~sbowman/prog.php
*
* By: 	    Shaun Bowman Sept. 2003, shaun_bowman@hotmail.com 
*
* Notes: This program is unlikely to be ready-2-port because of the ioctl 
method
*	  of changing terminal settings. This program was written so i could
*	  control a tiny 10$ remote control car (and to procrastinate homework).
*	  The lpt port pins (6,7,8,9) are used to control Forward, Reverse, Left
*	  and Right in the controller. In addition to this program, I had to build
*	  a simple circuit to bypass the buttons on the remote control. This is
*	  because even in the low state, the Control and Ground pins still form a
*	  complete circuit.
*
*	  Crude Diagram (1 for each button):
*
*	  GrndPin(18-25)   PinX(5-9)
*		|		|			   T1: NPN transistor, i used 2N222
*		|		|
*		|		L---R1--R2--R3		R1-R3: Resistors, i didn't have
*		|	 T1:		     |	               ones with high enough
*		|--------|\		     |                 resistance, so i had to use
*		|        | ------------------                  3. Total R ~= 100k ohm's
*               |    |---|/(<-collector pin)
*		|    |
*      -ButtnLead  +ButtnLead
*
* Compile with: gcc -O2 -o rccar rccar.c (must be root)
*
* Pin bits (numbered at female end)
*  outb(8, x)   = pin 5      UNUSED
*  outb(16, x)  = pin 6      Forward
*  outb(32, x)  = pin 7      Reverse
*  outb(64, x)  = pin 8      Left
*  outb(128, x) = pin 9      Right
*  outb(80, x)  = pin 6 & 8  FORWARDLEFT
*  outb(144, x) = pin 6 & 9  FORWARDRIGHT
*  outb(96, x)  = pin 7 & 8  REVERSELEFT
*  outb(160, x) = pin 7 & 9  REVERSERIGHT
*/

#include <stdio.h>
#include <unistd.h>
#include <asm/io.h>
#include <string.h>
#include <libio.h>

#include <sys/ioctl.h>
#include <termios.h>
#include <unistd.h>

#define LPT1PORT 0x378 								/* lpt1 */

int main()
{

struct termios oldT, newT; 							/* create our termios identifiers, uphere because C++ is retarted*/

void forward( char key ){
	outb(16, LPT1PORT);							/* Set pin 9 to high */
	usleep(10000);								/* Sleep for a while (100 ms) */
}

void reverse( char key ){
	outb(32, LPT1PORT);
	usleep(10000);
}

void left( char key ){
	outb(64, LPT1PORT);
	usleep(10000);
}

void right( char key ){
	outb(128, LPT1PORT);
	usleep(10000);
}

void forwardleft( char key ){
	outb(80, LPT1PORT);
	usleep(10000);
}

void forwardright( char key ){
	outb(144, LPT1PORT);
	usleep(10000);
}

void reverseleft( char key ){
	outb(96, LPT1PORT);
	usleep(10000);
}

void reverseright( char key ){
	outb(160, LPT1PORT);
	usleep(10000);
}


void stop( char key ){
	outb(0, LPT1PORT);							/* Set the data signals (D0-7) of the port to all low (0) */
	usleep(10000);
}

void end () {									/* The Beggining of the end.... */
	outb(0, LPT1PORT);
	usleep(10000);
	if (ioperm(LPT1PORT, 3, 0)) {perror("ioperm"); exit(1);}		/* We don't need the port anymore */
	ioctl(0,TCSETS,&oldT);							/* Better set the terminal back to normal... :-) */
	exit(0);								/* Buh bye */
}


if (ioperm(LPT1PORT, 3, 1)) {perror("ioperm"); exit(1);}			/* Get access to the ports */

ioctl(0,TCGETS,&oldT); 								/* get current terminal mode */
newT=oldT; 									/* copy it into our new structure */
newT.c_lflag &= ~ECHO;								/* toggle echo */
newT.c_lflag &= ~ICANON;							/* toggle no line delimination */
ioctl(0,TCSETS,`"wT);								/* initialize our new terminal mode */
char i[1];

while(1==1){

	read(0,&i[0],1);							/* read one char from the buffer */
	printf("\nu pressed %c\n", i[0]);
	if (i[0] == '8') { forward(i[0]); }
	if (i[0] == '2') { reverse(i[0]); }
	if (i[0] == '4') { left(i[0]); }
	if (i[0] == '6') { right(i[0]); }
	if (i[0] == '7') { forwardleft(i[0]); }
	if (i[0] == '9') { forwardright(i[0]); }
	if (i[0] == '1') { reverseleft(i[0]); }
	if (i[0] == '3') { reverseright(i[0]); }
	if (i[0] == '5') { stop(i[0]); }
	if (i[0] == 'q') { end(); }

}

}

/* end of rccar.c */

Here are my errors.

Code:
shawn@shawn-desktop:~/Desktop$ sudo gcc -O2 -o rccar rccar.c
[sudo] password for shawn:
rccar.c:47:20: error: asm/io.h: No such file or directory
rccar.c: In function ‘main’:
rccar.c:124: error: stray ‘`’ in program
rccar.c:124:17: warning: missing terminating " character
rccar.c:124: error: missing terminating " character
rccar.c:125: error: expected expression before ‘char’
rccar.c:144: error: expected ‘;’ before ‘}’ token

Thanks for any help you're able to provide.

Shawn
 
Old 10-17-2009, 12:24 AM   #2
smeezekitty
Senior Member
 
Registered: Sep 2009
Location: Washington U.S.
Distribution: M$ Windows / Debian / Ubuntu / DSL / many others
Posts: 2,339

Rep: Reputation: 231Reputation: 231Reputation: 231
change #include <asm/io.h> to #include <io.h>
 
Old 10-17-2009, 12:29 AM   #3
Danteleo
LQ Newbie
 
Registered: Oct 2006
Posts: 28

Original Poster
Rep: Reputation: 16
changed #include <asm/io.h> to #include <io.h> and now get these errors.

Code:
shawn@shawn-desktop:~/Desktop$ sudo gcc -O2 -o rccar rccar.c
[sudo] password for shawn:
rccar.c:47:16: error: io.h: No such file or directory
rccar.c: In function ?main?:
rccar.c:124: error: stray ?`? in program
rccar.c:124:17: warning: missing terminating " character
rccar.c:124: error: missing terminating " character
rccar.c:125: error: expected expression before ?char?
rccar.c:144: error: expected ?;? before ?}? token
Thank You for your help.

Shawn
 
Old 10-17-2009, 12:35 AM   #4
btncix
Member
 
Registered: Aug 2009
Location: USA
Posts: 141

Rep: Reputation: 26
Code:
rccar.c:124: error: stray ‘`’ in program
rccar.c:124:17: warning: missing terminating " character
rccar.c:124: error: missing terminating " character
rccar.c:125: error: expected expression before ‘char’
change
ioctl(0,TCSETS,`"wT); to ioctl(0,TCSETS,"wT");



The <asm/io.h> error seems to be related to whether you have the kernel source package installed.

see http://www.linuxquestions.org/questi...smio.h-595596/
see http://sources.redhat.com/ml/cygwin/.../msg01301.html
 
Old 10-17-2009, 12:39 AM   #5
smeezekitty
Senior Member
 
Registered: Sep 2009
Location: Washington U.S.
Distribution: M$ Windows / Debian / Ubuntu / DSL / many others
Posts: 2,339

Rep: Reputation: 231Reputation: 231Reputation: 231
just comment out #include <io.h>
and do the suggested fix from btncix
 
Old 10-17-2009, 12:43 AM   #6
xeleema
Member
 
Registered: Aug 2005
Location: D.i.t.h.o, Texas
Distribution: Slackware 13.x, rhel3/5, Solaris 8-10(sparc), HP-UX 11.x (pa-risc)
Posts: 987
Blog Entries: 4

Rep: Reputation: 252Reputation: 252Reputation: 252
Check your "Include" Paths

Greetingz!

I'm assuming there's just a "Makefile" file in the source directory, and there's no autoconf "config" script.

If that's the case, you may need to modify the Makefile. However, you first have to knock that io.h problem out of the park.

1. Run the "updatedb" command as root (use "sudo updatedb" if you can).
This command should not return any output, but just give you back your shell prompt when it's done.

2. Run "locate io.h" and take note of every path the "io.h" file is found.

3. Make a quick backup of your "Makefile" ("cp -p Makefile Makefile.bak").

4. Check your "Makefile" for any "-I /path/to/some/directory" statements, correct any non-existing directories.
(NOTE: when you add a path, don't put "io.h" at the end of it.)

If that still doesn't work, let us know! (and be sure to mention what changes you made to the Makefile.

UPDATE: I just pulled down the source. No "Makefile", it's just a .c script. Nevermind!

Last edited by xeleema; 10-17-2009 at 12:45 AM. Reason: I need to RTFS before posting. :)
 
Old 10-17-2009, 12:47 AM   #7
smeezekitty
Senior Member
 
Registered: Sep 2009
Location: Washington U.S.
Distribution: M$ Windows / Debian / Ubuntu / DSL / many others
Posts: 2,339

Rep: Reputation: 231Reputation: 231Reputation: 231
Quote:
Originally Posted by xeleema View Post
Greetingz!

I'm assuming there's just a "Makefile" file in the source directory, and there's no autoconf "config" script.

If that's the case, you may need to modify the Makefile. However, you first have to knock that io.h problem out of the park.

1. Run the "updatedb" command as root (use "sudo updatedb" if you can).
This command should not return any output, but just give you back your shell prompt when it's done.

2. Run "locate io.h" and take note of every path the "io.h" file is found.

3. Make a quick backup of your "Makefile" ("cp -p Makefile Makefile.bak").

4. Check your "Makefile" for any "-I /path/to/some/directory" statements, correct any non-existing directories.
(NOTE: when you add a path, don't put "io.h" at the end of it.)

If that still doesn't work, let us know! (and be sure to mention what changes you made to the Makefile.

UPDATE: I just pulled down the source. No "Makefile", it's just a .c script. Nevermind!
there is no makefile and io.h should not be required on linux
 
Old 10-17-2009, 12:52 AM   #8
Danteleo
LQ Newbie
 
Registered: Oct 2006
Posts: 28

Original Poster
Rep: Reputation: 16
Thanks for all the help.




To make sure I had the Headers I did this.

Code:
shawn@shawn-desktop:~/Desktop$ locate 'asm/io.h'
/usr/src/linux-headers-2.6.28-15/arch/alpha/include/asm/io.h
/usr/src/linux-headers-2.6.28-15/arch/arm/include/asm/io.h
/usr/src/linux-headers-2.6.28-15/arch/avr32/include/asm/io.h
/usr/src/linux-headers-2.6.28-15/arch/blackfin/include/asm/io.h
/usr/src/linux-headers-2.6.28-15/arch/cris/include/asm/io.h
/usr/src/linux-headers-2.6.28-15/arch/h8300/include/asm/io.h
/usr/src/linux-headers-2.6.28-15/arch/ia64/include/asm/io.h
/usr/src/linux-headers-2.6.28-15/arch/m68knommu/include/asm/io.h
/usr/src/linux-headers-2.6.28-15/arch/mips/include/asm/io.h
/usr/src/linux-headers-2.6.28-15/arch/parisc/include/asm/io.h
/usr/src/linux-headers-2.6.28-15/arch/powerpc/include/asm/io.h
/usr/src/linux-headers-2.6.28-15/arch/s390/include/asm/io.h
/usr/src/linux-headers-2.6.28-15/arch/sh/include/asm/io.h
/usr/src/linux-headers-2.6.28-15/arch/sparc/include/asm/io.h
/usr/src/linux-headers-2.6.28-15/arch/um/include/asm/io.h
/usr/src/linux-headers-2.6.28-15/arch/x86/include/asm/io.h
I commented out #include <io.h> and fixed the missing quote and got this.

Code:
shawn@shawn-desktop:~/Desktop$ sudo gcc -O2 -o rccar rccar.c
rccar.c: In function ‘main’:
rccar.c:124: error: stray ‘`’ in program
rccar.c:129: warning: ignoring return value of ‘read’, declared with attribute warn_unused_result
Thx
 
Old 10-17-2009, 01:04 AM   #9
xeleema
Member
 
Registered: Aug 2005
Location: D.i.t.h.o, Texas
Distribution: Slackware 13.x, rhel3/5, Solaris 8-10(sparc), HP-UX 11.x (pa-risc)
Posts: 987
Blog Entries: 4

Rep: Reputation: 252Reputation: 252Reputation: 252
I get something different...strange.

smeezekitty,
I noticed the lack of a Makefile. Updated my post to reflect that almost right after I chased down the sourcecode myself

Danteleo,

I'm getting a different error, and I've made the changes that everyone's mentioned. However, I'm not sure why the author put "must do as root", typically you should be able to compile things as a regular user....
 
Old 10-17-2009, 01:08 AM   #10
xeleema
Member
 
Registered: Aug 2005
Location: D.i.t.h.o, Texas
Distribution: Slackware 13.x, rhel3/5, Solaris 8-10(sparc), HP-UX 11.x (pa-risc)
Posts: 987
Blog Entries: 4

Rep: Reputation: 252Reputation: 252Reputation: 252
Different Errors for Me

I'm getting different errors myself. I've commented-out the Include for asm/io.h and corrected the ioctl line.

Code:
sysop$ gcc -O2 -o rccar rccar.c
rccar.c: In function 'end':
rccar.c:111: warning: incompatible implicit declaration of built-in function 'exit'
rccar.c:113: warning: incompatible implicit declaration of built-in function 'exit'
rccar.c: In function 'main':
rccar.c:117: warning: incompatible implicit declaration of built-in function 'exit'
/tmp/cccwFwJZ.o: In function `main':
rccar.c:(.text+0xd9): undefined reference to `outb'
rccar.c:(.text+0x10b): undefined reference to `outb'
rccar.c:(.text+0x13b): undefined reference to `outb'
rccar.c:(.text+0x16e): undefined reference to `outb'
rccar.c:(.text+0x19b): undefined reference to `outb'
/tmp/cccwFwJZ.o:rccar.c:(.text+0x1ce): more undefined references to `outb' follow
collect2: ld returned 1 exit status
sysop$
I also get the same errors when I try it as root;


Code:
root# gcc -O2 -o rccar rccar.c
rccar.c: In function 'end':
rccar.c:111: warning: incompatible implicit declaration of built-in function 'exit'
rccar.c:113: warning: incompatible implicit declaration of built-in function 'exit'
rccar.c: In function 'main':
rccar.c:117: warning: incompatible implicit declaration of built-in function 'exit'
/tmp/ccIVzpBr.o: In function `main':
rccar.c:(.text+0xd9): undefined reference to `outb'
rccar.c:(.text+0x10b): undefined reference to `outb'
rccar.c:(.text+0x13b): undefined reference to `outb'
rccar.c:(.text+0x16e): undefined reference to `outb'
rccar.c:(.text+0x19b): undefined reference to `outb'
/tmp/ccIVzpBr.o:rccar.c:(.text+0x1ce): more undefined references to `outb' follow
collect2: ld returned 1 exit status

Last edited by xeleema; 10-17-2009 at 01:09 AM.
 
Old 10-17-2009, 01:11 AM   #11
Danteleo
LQ Newbie
 
Registered: Oct 2006
Posts: 28

Original Poster
Rep: Reputation: 16
Here is the current version (edited) that I am using.

Code:
/*
* rccar.c: lpt port control of a radio controlled car
*
* MORE INFO HERE:       http://www.engr.uvic.ca/~sbowman/prog.php
*
* By: 	    Shaun Bowman Sept. 2003, shaun_bowman@hotmail.com 
*
* Notes: This program is unlikely to be ready-2-port because of the ioctl 
method
*	  of changing terminal settings. This program was written so i could
*	  control a tiny 10$ remote control car (and to procrastinate homework).
*	  The lpt port pins (6,7,8,9) are used to control Forward, Reverse, Left
*	  and Right in the controller. In addition to this program, I had to build
*	  a simple circuit to bypass the buttons on the remote control. This is
*	  because even in the low state, the Control and Ground pins still form a
*	  complete circuit.
*
*	  Crude Diagram (1 for each button):
*
*	  GrndPin(18-25)   PinX(5-9)
*		|		|			   T1: NPN transistor, i used 2N222
*		|		|
*		|		L---R1--R2--R3		R1-R3: Resistors, i didn't have
*		|	 T1:		     |	               ones with high enough
*		|--------|\		     |                 resistance, so i had to use
*		|        | ------------------                  3. Total R ~= 100k ohm's
*               |    |---|/(<-collector pin)
*		|    |
*      -ButtnLead  +ButtnLead
*
* Compile with: gcc -O2 -o rccar rccar.c (must be root)
*
* Pin bits (numbered at female end)
*  outb(8, x)   = pin 5      UNUSED
*  outb(16, x)  = pin 6      Forward
*  outb(32, x)  = pin 7      Reverse
*  outb(64, x)  = pin 8      Left
*  outb(128, x) = pin 9      Right
*  outb(80, x)  = pin 6 & 8  FORWARDLEFT
*  outb(144, x) = pin 6 & 9  FORWARDRIGHT
*  outb(96, x)  = pin 7 & 8  REVERSELEFT
*  outb(160, x) = pin 7 & 9  REVERSERIGHT
*/

#include <stdio.h>
#include <unistd.h>
/* #include <io.h> */
#include <string.h>
#include <libio.h>
#include <stdlib.h>

#include <sys/ioctl.h>
#include <termios.h>
#include <unistd.h>

#define LPT1PORT 0x378 								/* lpt1 */

int main()
{

struct termios oldT, newT; 							/* create our termios identifiers, uphere because C++ is retarted*/

void forward( char key ){
	outb(16, LPT1PORT);							/* Set pin 9 to high */
	usleep(10000);								/* Sleep for a while (100 ms) */
}

void reverse( char key ){
	outb(32, LPT1PORT);
	usleep(10000);
}

void left( char key ){
	outb(64, LPT1PORT);
	usleep(10000);
}

void right( char key ){
	outb(128, LPT1PORT);
	usleep(10000);
}

void forwardleft( char key ){
	outb(80, LPT1PORT);
	usleep(10000);
}

void forwardright( char key ){
	outb(144, LPT1PORT);
	usleep(10000);
}

void reverseleft( char key ){
	outb(96, LPT1PORT);
	usleep(10000);
}

void reverseright( char key ){
	outb(160, LPT1PORT);
	usleep(10000);
}


void stop( char key ){
	outb(0, LPT1PORT);							/* Set the data signals (D0-7) of the port to all low (0) */
	usleep(10000);
}

void end () {									/* The Beggining of the end.... */
	outb(0, LPT1PORT);
	usleep(10000);
	if (ioperm(LPT1PORT, 3, 0)) {perror("ioperm"); exit(1);}		/* We don't need the port anymore */
	ioctl(0,TCSETS,&oldT);							/* Better set the terminal back to normal... :-) */
	exit(0);								/* Buh bye */
}


if (ioperm(LPT1PORT, 3, 1)) {perror("ioperm"); exit(1);}			/* Get access to the ports */

ioctl(0,TCGETS,&oldT); 								/* get current terminal mode */
newT=oldT; 									/* copy it into our new structure */
newT.c_lflag &= ~ECHO;								/* toggle echo */
newT.c_lflag &= ~ICANON;							/* toggle no line delimination */
ioctl(0,TCSETS,`"wT");								/* initialize our new terminal mode */
char i[1];

while(1==1){

	read(0,&i[0],1);							/* read one char from the buffer */
	printf("\nu pressed %c\n", i[0]);
	if (i[0] == '8') { forward(i[0]); }
	if (i[0] == '2') { reverse(i[0]); }
	if (i[0] == '4') { left(i[0]); }
	if (i[0] == '6') { right(i[0]); }
	if (i[0] == '7') { forwardleft(i[0]); }
	if (i[0] == '9') { forwardright(i[0]); }
	if (i[0] == '1') { reverseleft(i[0]); }
	if (i[0] == '3') { reverseright(i[0]); }
	if (i[0] == '5') { stop(i[0]); }
	if (i[0] == 'q') { end(); }

}

}

/* end of rccar.c */

and here are the remaining errors that I am getting.

Code:
shawn@shawn-desktop:~/Desktop$ sudo gcc -O2 -o rccar rccar.c
rccar.c: In function ‘main’:
rccar.c:124: error: stray ‘`’ in program
rccar.c:129: warning: ignoring return value of ‘read’, declared with attribute warn_unused_result
Not sure on why being root either, figured it was just in case.
 
Old 10-17-2009, 01:13 AM   #12
Danteleo
LQ Newbie
 
Registered: Oct 2006
Posts: 28

Original Poster
Rep: Reputation: 16
Make sure you add

#include <stdlib.h>


that fixed a couple of problems I had earlier.
 
Old 10-17-2009, 01:14 AM   #13
smeezekitty
Senior Member
 
Registered: Sep 2009
Location: Washington U.S.
Distribution: M$ Windows / Debian / Ubuntu / DSL / many others
Posts: 2,339

Rep: Reputation: 231Reputation: 231Reputation: 231
Quote:
Originally Posted by xeleema View Post
I'm getting different errors myself. I've commented-out the Include for asm/io.h and corrected the ioctl line.

Code:
sysop$ gcc -O2 -o rccar rccar.c
rccar.c: In function 'end':
rccar.c:111: warning: incompatible implicit declaration of built-in function 'exit'
rccar.c:113: warning: incompatible implicit declaration of built-in function 'exit'
rccar.c: In function 'main':
rccar.c:117: warning: incompatible implicit declaration of built-in function 'exit'
/tmp/cccwFwJZ.o: In function `main':
rccar.c:(.text+0xd9): undefined reference to `outb'
rccar.c:(.text+0x10b): undefined reference to `outb'
rccar.c:(.text+0x13b): undefined reference to `outb'
rccar.c:(.text+0x16e): undefined reference to `outb'
rccar.c:(.text+0x19b): undefined reference to `outb'
/tmp/cccwFwJZ.o:rccar.c:(.text+0x1ce): more undefined references to `outb' follow
collect2: ld returned 1 exit status
sysop$
I also get the same errors when I try it as root;


Code:
root# gcc -O2 -o rccar rccar.c
rccar.c: In function 'end':
rccar.c:111: warning: incompatible implicit declaration of built-in function 'exit'
rccar.c:113: warning: incompatible implicit declaration of built-in function 'exit'
rccar.c: In function 'main':
rccar.c:117: warning: incompatible implicit declaration of built-in function 'exit'
/tmp/ccIVzpBr.o: In function `main':
rccar.c:(.text+0xd9): undefined reference to `outb'
rccar.c:(.text+0x10b): undefined reference to `outb'
rccar.c:(.text+0x13b): undefined reference to `outb'
rccar.c:(.text+0x16e): undefined reference to `outb'
rccar.c:(.text+0x19b): undefined reference to `outb'
/tmp/ccIVzpBr.o:rccar.c:(.text+0x1ce): more undefined references to `outb' follow
collect2: ld returned 1 exit status
thats odd i thought outb is a standard library function
@Danteleo
you must not have noticed there
is a junk ` symbol that needs to be removed
ioctl(0,TCSETS,`"wT"); the bold red part needs to be removed
 
Old 10-17-2009, 01:17 AM   #14
smeezekitty
Senior Member
 
Registered: Sep 2009
Location: Washington U.S.
Distribution: M$ Windows / Debian / Ubuntu / DSL / many others
Posts: 2,339

Rep: Reputation: 231Reputation: 231Reputation: 231
try changing ioctl(0,TCSETS,`"wT"); to ioctl(0,TCSETS,"wT");
notice the '`' not there
 
Old 10-17-2009, 01:17 AM   #15
Danteleo
LQ Newbie
 
Registered: Oct 2006
Posts: 28

Original Poster
Rep: Reputation: 16
Missed that one...thx

Now my new list of error...lol

Code:
shawn@shawn-desktop:~/Desktop$ sudo gcc -O2 -o rccar rccar.c
[sudo] password for shawn:
rccar.c: In function ‘main’:
rccar.c:129: warning: ignoring return value of ‘read’, declared with attribute warn_unused_result
/tmp/cc6lYHO9.o: In function `main':
rccar.c:(.text+0x11e): undefined reference to `outb'
rccar.c:(.text+0x150): undefined reference to `outb'
rccar.c:(.text+0x180): undefined reference to `outb'
rccar.c:(.text+0x1b0): undefined reference to `outb'
rccar.c:(.text+0x1e0): undefined reference to `outb'
/tmp/cc6lYHO9.o:rccar.c:(.text+0x210): more undefined references to `outb' follow
collect2: ld returned 1 exit status
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
make: *** [all] Error 2 ? Need Help compiling DOSBOX source code! d3vi4nt Linux - Software 7 01-08-2010 12:41 AM
Getting cannot find symbol error compiling java code using NetBeans 6.5 IDE rstewart Programming 1 02-13-2009 04:43 PM
c++ code compiling error k1ll3r_x Programming 4 10-03-2006 02:41 AM
error in compiling simple code Tinku Programming 6 09-17-2004 01:38 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 06:45 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration