C++Talk.NET Forum Index C++Talk.NET
C++ language newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Constructor Oddities

 
Post new topic   Reply to topic    C++Talk.NET Forum Index -> C++ Language (Moderated)
View previous topic :: View next topic  
Author Message
Christopher Key
Guest





PostPosted: Sun Mar 07, 2004 1:54 am    Post subject: Constructor Oddities Reply with quote



Hello all,

I'm working a relatively simply c++ project for a university project, and
have run into a very strange problem.

My codes is dived up into a set of files for each class, or logical group of
classes I'm using, i.e.:

Cxya.h - Containing class definition, with function prototypes
Cxyz.cc - Containing the actual code relating to the class

These are all compiled to object code, then archived to libidp.a

I then have a couple of executables, which depend upon these various of
these classes. The code for these, '#include's the relevant .h files
mentioned above. They are compiled, and linked with libidp.a, and another
standard library, librobot.a, that is provided for us.

Everything was fine, until I added a constructor to one of my classes, at
which point I suddenly started getting linker errors. The code for libidp.a
compile fine, with no warnings. The problems however arise when I try to
compile and link any of the executables. It complains about 4 unsatisfied
symbols. One of which is the constructor for the class in question, the
other three relating to a class defined in librobot.a.

The strange thing about the problem is that it is sorted simply placing the
code for the problematic constructor in the classes's definition, in the
header file.

I've played with the code, and am unable to generate this problem anywhere
else, so am at a loss as to quite what is going on. I thought it may be to
do with something not being included somewhere, but I've checked all the
include statements thoroughly, with no luck.

Any advice on what may be causing this would be very much appreciated.

Many thanks,

Christopher Key


PS, I get exactly the same behaviour on different machines, using both aCC,
and g++ to do the compiling.




[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]
Back to top
Display posts from previous:   
Post new topic   Reply to topic    C++Talk.NET Forum Index -> C++ Language (Moderated) All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.