|
|
Home » U++ Library support » U++ Library : Other (not classified elsewhere) » am ashamed to ask for help on this but...
am ashamed to ask for help on this but... [message #8469] |
Mon, 12 March 2007 22:13  |
nixnixnix
Messages: 415 Registered: February 2007 Location: Kelowna, British Columbia
|
Senior Member |
|
|
am scratching my head - its probably my poor knowledge of C++ but am sitting here with Jamsa's Bible and can't see what am doing wrong. Also, I've had my faith in the U++ IDE shaken a little since I realised there is "hidden" code that sometimes gets messed up and all you can do is delete your project and start again (e.g. I had to do this because an "empty" .iml file was in somehow corrupted. I deleted the project, copied all the code across and hey presto, my new imageclass worked just fine. I had used all the clean commands I could find but something is hidden)
Anyway, I get this error
Linking...
(option '-O 2' ignored)
___main: duplicate
-> used: libmingw32.a:gccmain.o:1
-> discarded: libgcc.a:__main.o:1
1 undefined symbol(s):
vtable for Layer(referenced from c:\upp\out\openwind\mingw.debug_full.gui.main.mt\layer.o:1; Layer::Layer(void); Layer::Layer(); Layer::Layer(void); Layer::Layer(); Layer::~Layer(void); Layer::~Layer(); ...)
linking aborted due to fatal errors
collect2: ld returned 1 exit status
There were errors. (0:12.45)
but I can't for the life of me see why. My header is as follows:-
############################################################ #
// contains layer base class plus image and raster classes and vector support
#ifndef __LAYER_H__
#define __LAYER_H__
#include <CtrlLib/CtrlLib.h>
using namespace Upp;
class Layer
{
public:
typedef Layer CLASSNAME;
Layer();
~Layer(void);
virtual void DrawLayer(Draw& w, void* pView);
// virtual void Read(String& path);
bool m_bVisible;
bool m_bSelected;
bool m_bIsValid;
Rect GetRect();
protected:
Rect m_rc; // maximum extent of this layer
String m_sPath;
String m_sFilename;
};
class ImageLayer : public Layer
{
public:
typedef ImageLayer CLASSNAME;
ImageLayer();
ImageLayer(String& path);
~ImageLayer();
Image m_img;
void Read(String& path);
void DrawLayer(Draw& w, void* pView);
protected:
int m_nRes;
};
#endif
############################################################ ##
and my cpp file just implements the functions in the simplest way imaginable. Please explain to me either the extent of my ignorance or the way in which it is possible to unconfuse the IDE if I am not at fault.
I am so ashamed (and only posting here because of the previous voodoo with the .iml file)
Nick
edit: I split the two classes into two separate sets of files and I still get the same error although sometimes it says something like
; .text$_ZN5LayerD2Ev)
at the end. This looks like the strangeness I had with the .iml file and makes me believe that there is hidden information in the IDE which I do not have access to. I would be just pathetically grateful to anyone who can tell me what I am missing. I've tried renaming my classes, using implied constructors. I don't know what to do. There must be a way to tell the IDE to just scrap everything and start from the code I have as it is written - surely.
[Updated on: Mon, 12 March 2007 23:50] Report message to a moderator
|
|
|
follow up question [message #8471 is a reply to message #8469] |
Tue, 13 March 2007 02:45   |
nixnixnix
Messages: 415 Registered: February 2007 Location: Kelowna, British Columbia
|
Senior Member |
|
|
ok here's a thing - didn't change the code at all but sometimes I get the error above and other times I get this error
Linking...
(option '-O 2' ignored)
___main: duplicate
-> used: libmingw32.a:gccmain.o:1
-> discarded: libgcc.a:__main.o:1
1 undefined symbol(s):
vtable for Layer(referenced from c:\upp\out\openwind\mingw.debug_full.gui.main.mt\$blitz.o:1; CUtils::CUtils(void); CUtils::CUtils(); CUti
ls::CUtils(void); CUtils::CUtils(); CUtils::~CUtils(void); CUtils::~CUtils(); ...)
linking aborted due to fatal errors
collect2: ld returned 1 exit status
There were errors. (1:00.15)
Its utterly bizarre
Why does it ask for the same thing over and over again please?
[Updated on: Tue, 13 March 2007 02:46] Report message to a moderator
|
|
|
|
|
|
Goto Forum:
Current Time: Tue Apr 29 12:23:43 CEST 2025
Total time taken to generate the page: 0.00655 seconds
|
|
|