Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com X-Authenticated: #9745355 Message-ID: <4048CE1D.30000@gmx.fr> Date: Fri, 05 Mar 2004 19:59:41 +0100 From: Xavier Dufresne User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.6) Gecko/20040301 MIME-Version: 1.0 To: cygwin AT cygwin DOT com Subject: Undefined references when compiling C++ program Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Hello, when I try to compile this... //zozo.cc #include int main() { std::cout << "Salut" << std::endl; return 0; } ...with... gcc zozo.cc ...gcc give me... /cygdrive/c/DOCUME~1/travonz/LOCALS~1/Temp/ccuTTqP6.o(.text+0x2f):zozo.cc: undefined reference to `std::cout' /cygdrive/c/DOCUME~1/travonz/LOCALS~1/Temp/ccuTTqP6.o(.text+0x34):zozo.cc: undefined reference to `std::basic_ostream >& std::operator<< >(std::basic_ostream >&, char const*)' /cygdrive/c/DOCUME~1/travonz/LOCALS~1/Temp/ccuTTqP6.o(.text+0x3c):zozo.cc: undefined reference to `std::basic_ostream >& std::endl >(std::basic_ostream >&)' /cygdrive/c/DOCUME~1/travonz/LOCALS~1/Temp/ccuTTqP6.o(.text+0x44):zozo.cc: undefined reference to `std::basic_ostream >::operator<<(std::basic_ostream >& (*)(std::basic_ostream >&))' /cygdrive/c/DOCUME~1/travonz/LOCALS~1/Temp/ccuTTqP6.o(.text+0x6d):zozo.cc: undefined reference to `std::ios_base::Init::Init[in-charge]()' /cygdrive/c/DOCUME~1/travonz/LOCALS~1/Temp/ccuTTqP6.o(.text+0x88):zozo.cc: undefined reference to `std::ios_base::Init::~Init [in-charge]()' collect2: ld returned 1 exit status if I compile: int main(){return 0;} it's ok ! Do I have to specifie linking libraries with the -l option ? thanks for your help. Xavier -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/