• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: gcc project, Xcode builds it, terminal doesn't
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: gcc project, Xcode builds it, terminal doesn't


  • Subject: Re: gcc project, Xcode builds it, terminal doesn't
  • From: Daniel Nielsen <email@hidden>
  • Date: Fri, 27 Feb 2004 20:26:22 +0100

On Feb 27, 2004, at 17:56, Maximino Salazar-Lechuga wrote:

I have a little C/C++ application that I developed in linux. I'm improving it now in Xcode, but I will like to keep the portability and simplicity of the application, the structure of the application is the following:

main.cpp
header1.h
header2.h
...

All the files are contained in a folder ~/application. When I build it in Xcode, it gives me the binary file in ~/application/build, which gives no errors and runs OK.

My question is: Why when I try to compile it in a terminal? I get something like:

~/application $ gcc main.cpp
ld: Undefined symbols:
std::basic_ostream<char, std::char_traits<char> >::operator<<(std::basic_ostream<char, std::char_traits<char> >& (*)(std::basic_ostream<char, std::char_traits<char> >&))
std::basic_ostream<char, std::char_traits<char> >::operator<<(double)
std::basic_ostream<char, std::char_traits<char> >::operator<<(unsigned)
std::ios_base::Init::Init[in-charge]()
std::ios_base::Init::~Init [in-charge]()
std::cout
std::basic_ostream<char, std::char_traits<char> >& std::endl<char, std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&)
std::basic_ostream<char, std::char_traits<char> >& std::operator<< <std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char const*)
operator delete[](void*)
operator delete(void*)
operator new[](unsigned long)
___gxx_personality_v0


I've checked, and Xcode is using the same compiler as the terminal, which is gcc-3.3. What I'm missing here?

Any help is appreciate it.


If the project is not too complicated, then just try using g++ instead of gcc, as it will include the STL libraries and headers.


/Daniel
--
There are no great men, only great challenges that ordinary men are
forced by circumstances to meet.
                -- Admiral William Halsey
_______________________________________________
xcode-users mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/xcode-users
Do not post admin requests to the list. They will be ignored.


References: 
 >gcc project, Xcode builds it, terminal doesn't (From: Maximino Salazar-Lechuga <email@hidden>)

  • Prev by Date: Re: Breakpoints not working
  • Next by Date: Re: file types for syntax highlighting
  • Previous by thread: Re: gcc project, Xcode builds it, terminal doesn't
  • Next by thread: Indexing of a library project turned off again?
  • Index(es):
    • Date
    • Thread