EmbeddedRelated.com
Forums
Memfault Beyond the Launch

'inbyte' was not declared in this scope

Started by Greg December 3, 2007
Hello

I am using the Xilinx Platform Studio to program a Xilinx FPGA and I
am trying to use C++.  When I switch the compiler form gcc to g++ I
immediately get an error telling me that

mfs_filesys_util.c: In function 'int mfs_copy_stdin_to_file(char*)':
mfs_filesys_util.c:146: error: 'inbyte' was not declared in this scope

If anyone knows what the solution to this problem is I would be really
appreciative.  Thanks.

Greg
Greg wrote:
> > I am using the Xilinx Platform Studio to program a Xilinx FPGA and I > am trying to use C++. When I switch the compiler form gcc to g++ I > immediately get an error telling me that > > mfs_filesys_util.c: In function 'int mfs_copy_stdin_to_file(char*)': > mfs_filesys_util.c:146: error: 'inbyte' was not declared in this scope > > If anyone knows what the solution to this problem is I would be really > appreciative. Thanks.
g++ compiles C++ programs. Not C. The languages and system linkages are different. If the source file is of type .c that will create further confusion. -- Chuck F (cbfalconer at maineline dot net) <http://cbfalconer.home.att.net> Try the download section. -- Posted via a free Usenet account from http://www.teranews.com
Greg <shireyg@gmail.com> wrote:

>I am using the Xilinx Platform Studio to program a Xilinx FPGA and I >am trying to use C++. When I switch the compiler form gcc to g++ I >immediately get an error telling me that > >mfs_filesys_util.c: In function 'int mfs_copy_stdin_to_file(char*)': >mfs_filesys_util.c:146: error: 'inbyte' was not declared in this scope
That probably means that the code uses a function inbyte() that was not declared. In general, (depends on the compiler and compilation options used,) you can use undeclared functions in C. A C compiler will assume an undeclared function returns int and accepts an unspecified number parameters, as if it was declared: int inbyte(); C++ on the other hand requires all functions to be explicitly declared before use. Roberto Waltman [ Please reply to the group, return address is invalid ]
On Dec 3, 7:34 pm, CBFalconer <cbfalco...@yahoo.com> wrote:
> Greg wrote: > > > I am using the Xilinx Platform Studio to program a Xilinx FPGA and I > > am trying to use C++. When I switch the compiler form gcc to g++ I > > immediately get an error telling me that > > > mfs_filesys_util.c: In function 'int mfs_copy_stdin_to_file(char*)': > > mfs_filesys_util.c:146: error: 'inbyte' was not declared in this scope > > > If anyone knows what the solution to this problem is I would be really > > appreciative. Thanks. > > g++ compiles C++ programs. Not C. The languages and system > linkages are different. If the source file is of type .c that will > create further confusion. > > -- > Chuck F (cbfalconer at maineline dot net) > <http://cbfalconer.home.att.net> > Try the download section. > > -- > Posted via a free Usenet account fromhttp://www.teranews.com
Alright this is also the conclusion that I came to. I knew I had to use extern "C" to mix and match C and C++ but the files that it fails on are not made by me or included by me. They are driver files that get compiled by the system automatically. I am unsure as to how to still use them and get them to work. Fortunantly it turns out we don't need that particular driver so we just took out the option that includes that driver. However, it would be nice to know how to fix this in the future.

Memfault Beyond the Launch