DaemonForums  

Go Back   DaemonForums > FreeBSD > FreeBSD General

FreeBSD General Other questions regarding FreeBSD which do not fit in any of the categories below.

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1   (View Single Post)  
Old 19th May 2008
Johnny2Bad Johnny2Bad is offline
Port Guard
 
Join Date: May 2008
Posts: 21
Thanked 0 Times in 0 Posts
Exclamation Why wont this compile?

Hi,
Well over the past few weeks this newbie has been very impressed over FreeBSD and wonders why he wasted years with M$ products. Your support has been wonderfull and the O/S rocks.

However being a programmer at heart I wanted to check out gcc++. So I made a file Hello.cpp

Code:
#include <iostream>

int main()
{
    cout << "Hello World\n";

    return 0;
}
the simplest program I could think of, which when compiled gives me...

Code:
/var/tmp//ccPEm5DG.o(.text+0x1e): In function `std::__verify_grouping(char const*, unsigned int, std::string const&)':
: undefined reference to `std::string::size() const'
/var/tmp//ccPEm5DG.o(.text+0x69): In function `std::__verify_grouping(char const*, unsigned int, std::string const&)':
: undefined reference to `std::string::operator[](unsigned int) const'
/var/tmp//ccPEm5DG.o(.text+0xa7): In function `std::__verify_grouping(char const*, unsigned int, std::string const&)':
: undefined reference to `std::string::operator[](unsigned int) const'
/var/tmp//ccPEm5DG.o(.text+0xef): In function `std::__verify_grouping(char const*, unsigned int, std::string const&)':
: undefined reference to `std::string::operator[](unsigned int) const'
/var/tmp//ccPEm5DG.o(.text+0x13c): In function `main':
: undefined reference to `std::cout'
/var/tmp//ccPEm5DG.o(.text+0x141): In function `main':
: undefined reference to `std::basic_ostream<char, std::char_traits<char> >& std::operator<< <std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char const*)'
/var/tmp//ccPEm5DG.o(.text+0x17d): In function `__static_initialization_and_destruction_0(int, int)':
: undefined reference to `std::ios_base::Init::Init()'
/var/tmp//ccPEm5DG.o(.text+0x1ce): In function `__tcf_0':
: undefined reference to `std::ios_base::Init::~Init()'
/var/tmp//ccPEm5DG.o(.eh_frame+0x11): undefined reference to `__gxx_personality_v0'
$ /var/tmp//ccPEm5DG.o(.text+0x1e): In function `std::__verify_grouping(char const*, unsigned int, std::string const&)':
: undefined reference to `std::string::size() const'
/var/tmp//ccPEm5DG.o(.text+0x69): In function `std::__verify_grouping(char const*, unsigned int, std::string const&)':
: undefined reference to `std::string::operator[](unsigned int) const'
Syntax error: word unexpected (expecting ")")
/var/tmp//ccPEm5DG.o(.text+0xa7): In function `std::__verify_grouping(char const*, unsigned int, std::string const&)':
$ : undefined reference to `std::string::size() const'
/var/tmp//ccPEm5DG.o(.text+0x69): In function `std::__verify_grouping(char const*, unsigned int, std::string const&)':
: undefined reference to `std::string::operator[](unsigned int) const'
/var/tmp//ccPEm5DG.o(.text+0xa7): In function `std::__verify_grouping(char const*, unsigned int, std::string const&)':
: undefined reference to `std::string::operator[](unsigned int) const'
/var/tmp//ccPEm5DG.o(.text+0xef): In function `std::__verify_grouping(char const*, unsigned int, std::string const&)':
> /var/tmp//ccPEm5DG.o(.text+0x69): In function `std::__verify_grouping(char const*, unsigned int, std::string const&)':
Syntax error: "(" unexpected
$ : undefined reference to `std::string::operator[](unsigned int) const'
> /var/tmp//ccPEm5DG.o(.text+0xa7): In function `std::__verify_grouping(char const*, unsigned int, std::string const&)':
Syntax error: word unexpected (expecting ")")
Syntax error: word unexpected (expecting ")")
$ : undefined reference to `std::string::operator[](unsigned int) const'
> /var/tmp//ccPEm5DG.o(.text+0xef): In function `std::__verify_grouping(char const*, unsigned int, std::string const&)':
Syntax error: word unexpected (expecting ")")
Syntax error: word unexpected (expecting ")")
$ : undefined reference to `std::string::operator[](unsigned int) const'
> /var/tmp//ccPEm5DG.o(.text+0x13c): In function `main':
Syntax error: word unexpected (expecting ")")
> : undefined reference to `std::cout'
main:
: undefined reference to `std::cout: not found
$ /var/tmp//ccPEm5DG.o(.text+0x141): In function `main':
Syntax error: word unexpected (expecting ")")
$ : undefined reference to `std::basic_ostream<char, std::char_traits<char> >& std::operator<< <std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char const*)'
> /var/tmp//ccPEm5DG.o(.text+0x17d): In function `__static_initialization_and_destruction_0(int, int)':
Syntax error: redirection unexpected
Syntax error: word unexpected (expecting ")")
$ : undefined reference to `std::ios_base::Init::Init()'
> /var/tmp//ccPEm5DG.o(.text+0x1ce): In function `__tcf_0':
> : undefined reference to `std::ios_base::Init::~Init()'
$ /var/tmp//ccPEm5DG.o(.eh_frame+0x11): undefined reference to `__gxx_personality_v0'
Can anyone explain why this is not working? Perhaps I should be posting this to a programming forum, however it is so simple I thought you guys would pickup where I was going wrong in seconds.

Thanking you in advance,
Jonathan.
Reply With Quote
 

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
pidgin (py25-gtk) wont upgrade mururoa FreeBSD Installation and Upgrading 3 7th September 2009 07:45 PM
Epiphany and Firefox2 wont update delboy FreeBSD Ports and Packages 4 25th August 2009 01:18 PM
Firefox 3 port wont compile : libsoftokn3.so problems padmanabh FreeBSD Ports and Packages 3 8th October 2008 07:13 AM
PF wont open port despite rules... Dain_L OpenBSD Security 3 12th September 2008 01:14 AM
KDE wont start up dctr FreeBSD General 9 11th June 2008 05:59 AM


All times are GMT. The time now is 06:50 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content copyright © 2007-2010, the authors
Daemon image copyright ©1988, Marshall Kirk McKusick