RE: Strange C++ Compilation Error

  • From: "Delaunay Christophe" <christophe.delaunay@xxxxxxxxxxx>
  • To: <programmingblind@xxxxxxxxxxxxx>
  • Date: Mon, 21 Sep 2009 10:59:43 +0200

Hi Jared,

Your code seems ok but after this code, you wrote:

[JR]
>The error received is:
>gcc helloworld.cpp -o helloworld
>Undefined                       first referenced
>  symbol                             in file
>std::basic_string<char, std::char_traits<char>, std::allocator<char> 
> >::operator
>[](unsigned int) const/var/tmp//ccSOACjU.o
>std::basic_ostream<char, std::char_traits<char> [...]

[ChD]
These are linker errors due to the fact that you are attempting to
compile your C++ code with the GNU C compiling front-en rather than with
the GNU C++ compiling front-end.

Please try the following and let us know if you still have these linker
errors:

g++ helloworld.cpp -o helloworld

In other words, this command is nearly the same as yours except than
instead of typing a g followed by a double c, I type a g followed by a
double plus sign.

HTH, Have a nice day. Chris D
__________
View the list's information and change your settings at
//www.freelists.org/list/programmingblind

Other related posts: