Ask Your Question
0

not able to compile c program with header #include<reg51.h>

asked 2013-04-18 09:29:20 -0500

vinayk gravatar image
#include <reg51.h>
#defind LED P2;
void main(void)
{
    P1=00;
    LED=0;
    for(;;)
    {
    P1++;
    LED++;
    }
}

will you please help me to compile the program?
where i have to put header file reg51.h in my fedora os. so that i can compile it easy
and how can i simulate that program on my fedora os?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2013-04-18 15:37:15 -0500

mether gravatar image

updated 2013-04-18 15:40:08 -0500

You can use repoquery to figure out which package provides that file.

repoquery --whatprovides '*reg51.h'
sdcc-0:3.2.0-0.fc18.x86_64

Then you can use yum to install it. Once installed, your program should be able to pick up the header from the system path automatically. You use the appropriate binary that is part of the package to compile the program. For a list of binaries, you can run the following command

rpm -ql sdcc | grep /usr/bin
edit flag offensive delete link more

Question Tools

Stats

Asked: 2013-04-18 09:29:20 -0500

Seen: 1,261 times

Last updated: Apr 18 '13