This is the mail archive of the crossgcc@sourceware.cygnus.com mailing list for the crossgcc project.

See the CrossGCC FAQ for lots more infromation.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Problem with project contained mixed C and C++ sources


Hello,

I have problem with project contained mixed C and C++ sources.
My environment is GCC (based on egcs-1.1.2) for H8/300H CPU.
Some modules of my project are traditional C program modules,
and some is C++. For example, I have simple class for CRC-8
calculating. To using it in another modules I wrote very simple
user interface functions:
void CRC_init(void);
void CRC_byte(byte byt);  and so on.

Problem is: then I compile this module I have function names
like this (in generated ASM listing):

    .global    _CRC_init__Fv
    .global    _CRC_byte__FUc

And, of course, link procedure fails.

How to solve this problem? Thank you.

Jurgis Armanavichius
Firma MEDELKOM, http://www.medelkom.com

----- Original Message -----
From: Kai Ruottu <karuottu@freenet.hut.fi>
To: <crossgcc@cygnus.com>
Sent: 13 августа 1999 г. 4:52
Subject: Re: still having problems w/egcs-1.1.2 linux-to-sunos4 cross


> > After previous failed attepts, it was suggested I copy the target
> > headers and libraries to $prefix/$target/include and lib.  I did this,
> > and it doesn't help.  A coworker and I sat and wondered why this should
> > even be necessary, as the executable compiler we're trying to build is
> > running on Linux, so why should it be built and linked with sunos
> > headers and libraries?
>
>  To produce Linux binaries, you need the native Linux headers and libs.
>  The 'gcc' is the driver program for your native compiler.
>
>  To produce SunOS binaries, you need (= your crosscompiler needs) the
>  SunOS headers and libs. The 'xgcc' is the driver program for your cross-
>  compiler. When it runs, the SunOS headers and libs are needed.
>
> > Anyway, here's what I'm doing.  I moved to a new machine (RH 6.0) and
> > tried again.  I configured binutils-2.9.1 using
> > --program-prefix="sunos4-" and --target="sparc-sun-sunos4", built it and
> > installed it, no problem.  Then I untar the egcs-1.1.2 package, create a
> > separate directory for the build, cd to that separate directory, and
> > configure the egcs cross using the same options as I did with binutils.
> > Then I type 'make cross', and it starts building stuff, but gets to a
> > point where it's trying to use xgcc (from my build directory) to compile
> > egcs-1.1.2/gcc/libgcc2.c.  It is failing because it can't find stdlib.h
> > and unistd.h.  On this system, those headers are in /usr/include,
> > however that directory doesn't seem to be in the include path of xgcc.
> > Should it be?
>
>  No... If the 'configure' options were just what you wrote, it should take
> the SunOS headers from :
>
>    /usr/local/sparc-sun-sunos4/include
>
>  The default prefix is '/usr/local' (please search it at Makefile) and
your
> target is 'sparc-sun-sunos4'. So if you copied the SunOS headers there
> ("$prefix/$target/include"), as you wrote, everything should be just ok
and the
> SunOS headers should be found. You can always check the programs & libs
search
> paths with :
>
>    ./xgcc -print-search-dirs
>
> The 'include' has the same base directory as the 'bin' and 'lib', in the
last
> given search directories for 'programs' and 'libraries'....
>
> Cheers, Kai
> _______________________________________________
> New CrossGCC FAQ: http://www.objsw.com/CrossGCC
> _______________________________________________
> To remove yourself from the crossgcc list, send
> mail to crossgcc-request@cygnus.com with the
> text 'unsubscribe' (without the quotes) in the
> body of the message.
>


------
Want more information?  See the CrossGCC FAQ, http://www.objsw.com/CrossGCC/
Want to unsubscribe? Send a note to crossgcc-unsubscribe@sourceware.cygnus.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]