E
Ed Dana
I'm trying to create a dynamic two dimensional array. My code looks like
this:
======================================================================
#define DEF_FrameBuffer_H
class FrameBuffer {
public:
FrameBuffer(int prmWidth, int prmHeight, unsigned long prmPen);
FrameBuffer(int prmWidth, int prmHeight);
private:
int clsHeight, clsWidth, clsCurrX, clsCurrY;
unsigned long **clsBuffer, clsPen;
};
======================================================================
#include <cstdlib>
#include <iostream>
#include <string>
// Declarations...
#ifndef DEF_FrameBuffer_H
#include "FrameBuffer.h"
#endif
// Constructors...
FrameBuffer::FrameBuffer( int prmWidth,
int prmHeight,
unsigned long prmPen
) {
int x, y;
clsWidth = prmWidth;
clsHeight = prmHeight;
clsBuffer = new unsigned long *[prmWidth];
if (clsBuffer) {
for (x = 0; x < prmHeight; x++) {
clsBuffer[x] = new unsigned long [prmHeight];
clsBuffer[x][y] = prmPen;
}
}
}
FrameBuffer::FrameBuffer(int prmWidth, int prmHeight) {
FrameBuffer::FrameBuffer(prmWidth, prmHeight, 0);
}
======================================================================
The program compiles fine, but the linker gives me the error: [Linker
error] undefined reference to `___builtin_vec_new'
I have no clue what this means except I suspect it has something to do
with the "new" keyword. As far as I can tell, this should work. This is
being compiled using Bloodshed's Dev-C++.
Any and all clues greatly appreciated.
Ed.
this:
======================================================================
#define DEF_FrameBuffer_H
class FrameBuffer {
public:
FrameBuffer(int prmWidth, int prmHeight, unsigned long prmPen);
FrameBuffer(int prmWidth, int prmHeight);
private:
int clsHeight, clsWidth, clsCurrX, clsCurrY;
unsigned long **clsBuffer, clsPen;
};
======================================================================
#include <cstdlib>
#include <iostream>
#include <string>
// Declarations...
#ifndef DEF_FrameBuffer_H
#include "FrameBuffer.h"
#endif
// Constructors...
FrameBuffer::FrameBuffer( int prmWidth,
int prmHeight,
unsigned long prmPen
) {
int x, y;
clsWidth = prmWidth;
clsHeight = prmHeight;
clsBuffer = new unsigned long *[prmWidth];
if (clsBuffer) {
for (x = 0; x < prmHeight; x++) {
clsBuffer[x] = new unsigned long [prmHeight];
clsBuffer[x][y] = prmPen;
}
}
}
FrameBuffer::FrameBuffer(int prmWidth, int prmHeight) {
FrameBuffer::FrameBuffer(prmWidth, prmHeight, 0);
}
======================================================================
The program compiles fine, but the linker gives me the error: [Linker
error] undefined reference to `___builtin_vec_new'
I have no clue what this means except I suspect it has something to do
with the "new" keyword. As far as I can tell, this should work. This is
being compiled using Bloodshed's Dev-C++.
Any and all clues greatly appreciated.
Ed.