From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4798 invoked by alias); 27 Nov 2004 05:14:38 -0000 Mailing-List: contact gcc-help-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-help-owner@gcc.gnu.org Received: (qmail 4674 invoked from network); 27 Nov 2004 05:14:28 -0000 Received: from unknown (HELO pickering.cc.nd.edu) (129.74.250.225) by sourceware.org with SMTP; 27 Nov 2004 05:14:28 -0000 Received: from localhost (localhost [127.0.0.1]) by pickering.cc.nd.edu (Switch-3.1.7/Switch-3.1.7) with ESMTP id iAR5ERJQ021144 for ; Sat, 27 Nov 2004 00:14:27 -0500 (EST) Received: from ganti.resnet.nd.edu (ganti.resnet.nd.edu [66.254.232.51]) by webmail.nd.edu (IMP) with HTTP for ; Sat, 27 Nov 2004 00:14:27 -0500 Message-ID: <1101532467.41a80d3386514@webmail.nd.edu> Date: Sat, 27 Nov 2004 05:14:00 -0000 From: rganti@nd.edu To: gcc-help@gcc.gnu.org Subject: help regarding linking MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit User-Agent: Internet Messaging Program (IMP) 3.2.6 X-Originating-IP: 66.254.232.51 X-ND-MTA-Date: Sat, 27 Nov 2004 00:14:28 -0500 (EST) X-ND-Virus-Scan: engine v4.3.20; dat v4410 X-SW-Source: 2004-11/txt/msg00192.txt.bz2 Hi, I am a newbie at using gcc. I wanted to write functions and the main file in different files I am using the following to compile gcc -c file1.c gcc -c file2.c gcc file1.o file2.o a.out 2.00000 1.90000 I am not able to understand why that is the output. But if write the function to_print in file1.c and compile, it works normally. If I replace all floats in both files by double it works What is happening? Am I compiling them wrong. /*----------- file1.c-------------*/ #include #include int main() { float a,b; a=1.2; b=1.3; to_print(a,b); return 0; } ---------------file2.c------------- #include void to_print(float a, float b) { printf("%f , %f \n", a,b); } -regards Radha Krishna Ganti -- Radha Krishna Ganti EE-Grad Student Univ. Of Notre Dame