Mail Archives: djgpp/1998/05/11/05:47:35
When I try to compile a project, I get the following errors:
test.o(.text+0x7f):test.cpp: undefined reference to `__eh_pc'
test.o(.text+0x88):test.cpp: undefined reference to `__throw'
test.o(.text+0x95):test.cpp: undefined reference to `terminate(void)'
Any idea what I am doing wrong? Am I using the wrong commands? Here is
what I use...
gpp -c palette.cpp
gpp -c test.cpp
gpp -o test.exe test.o palette.o
The first two produce their object files with no errors or warnings. The
third command gives the warnings above. Am I missing a file or something?
Is something missing from my path statement? For those of you who are
familiar with it, the Allegro library compiled with no problems, so I think
my setup is okay. Here are the three files I am using...
/* palette.h */
#ifndef DCPALETTETYPE
#define DCPALETTETYPE
struct DCColor
{
unsigned char red;
unsigned char green;
unsigned char blue;
};
class DCPaletteType
{
private:
char * filename;
DCColor paletteArray[256];
public:
DCPaletteType();
~DCPaletteType();
int Load(char * path, char * filename);
int Save(char * path, char * filename);
int Import(char * path, char * filename, int format);
int Export(char * path, char * filename, int format);
};
#endif
/* palette.cpp */
#include <stdio.h>
#include <alloc.h>
#include <process.h>
#include <string.h>
#include "palette.h"
DCPaletteType::DCPaletteType()
{
/* code removed */
}
DCPaletteType::~DCPaletteType()
{
/* code removed */
}
int DCPaletteType::Load(char * path, char * filename)
{
/* code removed */
return 0;
}
int DCPaletteType::Save(char * path, char * filename)
{
/* code removed */
return 0;
}
int DCPaletteType::Import(char * path, char * filename, int format)
{
/* code removed */
return 0;
}
int DCPaletteType::Export(char * path, char * filename, int format)
{
/* code removed */
return 0;
}
/* test.cpp */
#include <stdio.h>
#include <alloc.h>
#include <process.h>
#include <string.h>
#include "palette.h"
int main()
{
DCPaletteType testPalette;
testPalette.Load("c:/dcg/", "dcpalet.dat");
return 0;
}
Can someone give me some advice on how to fix this problem?
Thanks!
- Raw text -