comp.lang.ada
 help / color / mirror / Atom feed
* C++ with gcc
@ 2000-03-24  0:00 machrouh Youssef
  2000-03-24  0:00 ` Gisle S�lensminde
  2000-03-24  0:00 ` Robert Dewar
  0 siblings, 2 replies; 3+ messages in thread
From: machrouh Youssef @ 2000-03-24  0:00 UTC (permalink / raw)


I try to compile C++ programs with the gcc version coming with the gnat
compiler (3.12p).

While compilation seems to work well, I got errors during linking.
When I compile the following program:

#include <iostream.h>

void main()
{

  cout<<"Quel est le prix HT ? : ";

}


I obtain the message:

gcc -v exo1.cpp
Reading specs from C:\GNAT\lib\gcc-lib\pentium-mingw32msv\2.8.1\specs
gcc version 2.8.1
 C:\GNAT\lib\gcc-lib\pentium-mingw32msv\2.8.1\cpp.exe -lang-c++ -v
-undef -D__GNUC__=2 -D__GNUG__=2 -D__cplusplus -D__GNUC_MINOR__=8 -Di386
-D_WIN32 -DWIN32 -D__WIN32__ -D__MINGW32__ -DWINNT -D_X86_=1
-D__STDC__=1 -D__stdcall=__attribute__((__stdcall__))
-D__cdecl=__attribute__((__cdecl__)) -D__i386__ -D_WIN32 -D__WIN32__
-D__WIN32__ -D__MINGW32__ -D__WINNT__ -D_X86_=1 -D__STDC__=1
-D__stdcall=__attribute__((__stdcall__))
-D__cdecl=__attribute__((__cdecl__)) -D__i386 -D__WIN32 -D__WINNT
-Asystem(winnt) -Acpu(i386) -Amachine(i386) -D__EXCEPTIONS -remap -Di386
-Di586 -Asystem(unix) -Acpu(i386) -Amachine(i386) -D__i386__ -D__i586__
-Asystem(unix) -Acpu(i386) -Amachine(i386) exo1.cpp C:\TEMP\cca00247.ii
GNU CPP version 2.8.1 (80386, BSD syntax)
#include "..." search starts here:
#include <...> search starts here:
 C:\GNAT\lib\gcc-lib\pentium-mingw32msv\2.8.1\include
 C:\GNAT\mingw32\include
End of search list.
 cc1plus C:\TEMP\cca00247.ii -quiet -dumpbase exo1.cc -version -o
C:\TEMP\cca00247.s
GNU C++ version 2.7.2.1 (80386, BSD syntax) compiled by GNU C version
2.7.2.1.
 as -o C:\TEMP\cca002471.o C:\TEMP\cca00247.s
 ld C:\GNAT\lib\crt2.o -LC:\GNAT\lib\gcc-lib\pentium-mingw32msv\2.8.1
-LC:\GNAT\lib -LC:\GNAT\lib C:\TEMP\cca002471.o -lmingw32 -lgcc
-lmoldname -lmsvcrt -lkernel32 -ladvapi32 -lshell32 -lmingw32 -lgcc
-lmoldname -lmsvcrt
C:\TEMP\cca002471.o(.text+0x28):exo1.cc: undefined reference to `cout'
C:\TEMP\cca002471.o(.text+0x2d):exo1.cc: undefined reference to
`ostream::operator<<(char const *)'

Compilation exited abnormally with code 1 at Fri Mar 24 15:02:49


I suspect that some library is not referenced correctly.

Could someone help me.








^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: C++ with gcc
  2000-03-24  0:00 C++ with gcc machrouh Youssef
  2000-03-24  0:00 ` Gisle S�lensminde
@ 2000-03-24  0:00 ` Robert Dewar
  1 sibling, 0 replies; 3+ messages in thread
From: Robert Dewar @ 2000-03-24  0:00 UTC (permalink / raw)


In article <38DB7762.90530BAE@limsi.fr>,
  machrouh Youssef <machrouh@limsi.fr> wrote:
> I try to compile C++ programs with the gcc version coming with
> the gnat compiler (3.12p).

GNAT as distributed will not support g++. Any attempt to build
a combined version that handles both GNAT and g++ will fail
in one manner or another, since the two compilers currently
require different versions of gcc (in particular GNAT requires
a patched version of gcc 2.8.1 that has never been tested with
g++, and in fact it is known that g++ cannot be built with this
version of gcc).

We are working hard to merge the two versions of gcc, so this
is a problem which will disappear in the future (if you watch
the gcc mailing list, you will be very aware of the activity
in this area!)

Robert Dewar
Ada Core Technologies


Sent via Deja.com http://www.deja.com/
Before you buy.




^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: C++ with gcc
  2000-03-24  0:00 C++ with gcc machrouh Youssef
@ 2000-03-24  0:00 ` Gisle S�lensminde
  2000-03-24  0:00 ` Robert Dewar
  1 sibling, 0 replies; 3+ messages in thread
From: Gisle S�lensminde @ 2000-03-24  0:00 UTC (permalink / raw)


In article <38DB7762.90530BAE@limsi.fr>, machrouh Youssef wrote:
>I try to compile C++ programs with the gcc version coming with the gnat
>compiler (3.12p).
>
>While compilation seems to work well, I got errors during linking.
>When I compile the following program:
>
>#include <iostream.h>
>
>void main()
>{
>
>  cout<<"Quel est le prix HT ? : ";
>
>}

Since GNAT patches the gcc backend, and the impact on the c++ frontend
is untested, so it's recomended to have seperate installations of 
Ada and C++. Another reason to have two install two compilers, is that
GNAT is based on gcc 2.8.1 backend, but the latest version of g++ 
is based on gcc 2.95. The newer versions of g++ is much closer to the
standard than the C++ frontend of gcc 2.8.1. 

Besides from that it looks like you not have compiled the standard c++
library, or put it in the wrong place. I see you use mingwin on the
windows platform, and I have no experience in compiling gcc on windows,
so I can't help you there. 



--
Gisle S�lensminde ( gisle@ii.uib.no )   

ln -s /dev/null ~/.netscape/cookies




^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2000-03-24  0:00 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-03-24  0:00 C++ with gcc machrouh Youssef
2000-03-24  0:00 ` Gisle S�lensminde
2000-03-24  0:00 ` Robert Dewar

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox