Re: gcc project, Xcode builds it, terminal doesn't
Re: gcc project, Xcode builds it, terminal doesn't
- Subject: Re: gcc project, Xcode builds it, terminal doesn't
- From: gennady wexler <email@hidden>
- Date: Fri, 27 Feb 2004 09:44:36 -0800
gcc from command line wont include STL headers or reference STL libraries
for you, while in Xcode environment build process properties are preset.
you need to write a makefile file with same properties for building as in
Xcode for this to work.
then in command prompt you will use "make" command to build, which will call
gcc where needed with right parameters.
On 2/27/04 8:56 AM, "Maximino Salazar-Lechuga" <email@hidden>
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.
>
> Max.
> _______________________________________________
> 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.
_______________________________________________
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.