Thread View: gnu.gcc.help
1 messages
1 total messages
Started by Bill Wied
Wed, 04 Nov 1992 20:53
(none)
Author: Bill Wied
Date: Wed, 04 Nov 1992 20:53
Date: Wed, 04 Nov 1992 20:53
64 lines
1623 bytes
1623 bytes
Hello,
I am using GCC 2.2.2 to compile some test C++ code and I get a loading
error from ld.
Here is the code I am trying to compile:
#include <stdio.h>
class Cube
{
private:
int length, width, height;
public:
Cube(int,int,int);
~Cube(void);
volume();
};
Cube::Cube(int l, int w, int h)
{
length=l;
width=w;
height=h;
}
int Cube::volume()
{
return(length*width*height);
}
main()
{
Cube testcube(2,3,4);
printf("The volume of this cube is :%d\n",testcube.volume());
}
And I get the following result when I try and compile it:
% gcc a.C
a.C: In function `int main ()':
a.C:31: warning: implicit declaration of function `printf'
ld: Undefined symbol
__$_4Cube
collect: /usr/bin/ld returned 2 exit status
%
Do you have any idea why it is not compiling correctly I don't seem to have
any problem compiling regular C code. I would appreciate any help you could
give me.
Thanks,
Bill Wied
wied@animal.sps.mot.com
602-897-4266
Network Applications Group
Semiconductor Products Sector
Motorola Inc.
p.s. If you would like you could send me an email message and I could call
you back regarding this problem. Thanks again.
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads