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.
Reply by Roberto Waltman●December 4, 20072007-12-04
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 ]
Reply by CBFalconer●December 3, 20072007-12-03
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
Reply by Greg●December 3, 20072007-12-03
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