error minhmata meta apo compile evos arxeiou.c

Pavlos Parissis surfking at ath.forthnet.gr
Mon Jan 11 15:06:53 EET 1999


Geia sas,
Epeidi h enasxolisi mou me to Linux sinexizete akathexti fisiko einai na
exo kai kapia provlimata.

Loipon piga na kano compile ena erxeio giana setaro thn karta ixou mou,
to arxeio einai attach.
Evosa gcc -o OPTo82C931 OPTo82C931.c  kai pira ta parakato:

/tmp/cca003341.o: In function `init':

/tmp/cca003341.o(.text+0x3b): undefined reference to `__outbc'

/tmp/cca003341.o(.text+0x4f): undefined reference to `__outb'

/tmp/cca003341.o(.text+0x63): undefined reference to `__outbc'

/tmp/cca003341.o(.text+0x77): undefined reference to `__outb'

/tmp/cca003341.o: In function `read_OPTi_mc':

/tmp/cca003341.o(.text+0x93): undefined reference to `__outbc'

/tmp/cca003341.o(.text+0xa7): undefined reference to `__outb'

/tmp/cca003341.o(.text+0xb6): undefined reference to `__inbc'

/tmp/cca003341.o(.text+0xca): undefined reference to `__inb'

/tmp/cca003341.o: In function `write_OPTi_mc':

/tmp/cca003341.o(.text+0xf7): undefined reference to `__outbc'

/tmp/cca003341.o(.text+0x10b): undefined reference to `__outb'

/tmp/cca003341.o(.text+0x11f): undefined reference to `__outbc'

/tmp/cca003341.o(.text+0x133): undefined reference to `__outb'

epeidi den gnorizo kai polla apo compile mipos kanenas exei thn idea to
ti ekana lathos kai exei diathesi na mou to pei;

Sas xereto kai elpizo na lithei to provlima dioti h apoliti siopi pou
epikrati sto linux mou espase ta nevra.



--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
I love having the feeling of being in control
while i have the sensation of speed

The surfer of life
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

-------------- next part --------------
/* A simple debugger for the OPTi 82C931 sound chip. D.M.Burns. 5-11-97.
 *
 * To compile this program use:-
 *
 *	gcc -O3 OPTi82C931.c -o OPTi82C931
 *
 * The -O3 option ensures you don't get linking failures looking for _outb
 *
 * Revision History
 *
 * Will now handle multiple arguments.			DMB 13-11-97
 * Compile & run info added to this comment.		DMB 11-12-97
 *
 */

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

#define OPTi_PASSWORD	0x00E4
#define OPTi_MCBASE	0x0F8D
#define OPTi_MCINDEX	0x0E0E
#define OPTi_MCDATA	0x0E0F

/* #define PWP */

void init(void)
{
	if(iopl(3) < 0) {
		perror("Unable to get io permission - this must be run as root");
		exit(1);
	}
	outb(OPTi_PASSWORD, OPTi_MCBASE);
#ifdef PWP
	outb(0x00, OPTi_MCBASE);
#else
	outb(0x80, OPTi_MCBASE);
#endif
}
                       

unsigned int read_OPTi_mc(unsigned int reg)
{
#ifdef	PWP
	outb(OPTi_PASSWORD, OPTi_MCBASE);
#endif
	outb(reg, OPTi_MCINDEX);
#ifdef	PWP
	outb(OPTi_PASSWORD, OPTi_MCBASE);
#endif
	return inb(OPTi_MCDATA);
}

unsigned int write_OPTi_mc(unsigned int dat, unsigned int reg)
{
#ifdef	PWP
	outb(OPTi_PASSWORD, OPTi_MCBASE);
#endif
	outb(reg, OPTi_MCINDEX);
#ifdef	PWP
	outb(OPTi_PASSWORD, OPTi_MCBASE);
#endif
	outb(dat, OPTi_MCDATA);
}

main(int argc, char *argv[])
{	unsigned int r, d;

	init();

	if (argc == 1) {
		printf("01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26\n");
		for (r=1; r<=26; ++r)
			printf("%2.2X ", read_OPTi_mc(r));
		printf("\n");
	}
	else if (argc%2 == 1) {
		while (argc > 1) {
			r = atoi(argv[1]);
			sscanf(argv[2], "%i", &d);
			printf("MCR%d <- %02X\n", r, d);
			write_OPTi_mc(d, r);
			argc -= 2;
			argv += 2;
		}
	}
	else {
		printf("usage: OPTi82C931                       - dump registers\n");
		printf("       OPTi82C931 reg val [reg val ...] - program MCR register\n");
		printf("                  reg is decimal, value is hex (0x..) or decimal\n");
		printf("       A good bet might be:-\n");
		printf("       OPTi82C931 0 0x07  1 0x01  3 0x0D  4 0x14  5 0x3E  6 0x92\n");
		exit(1);
	}
}



More information about the Linux-greek-users mailing list