Home   Artículos   Recursos   Foros   
Artíclos recientes publicados en Latindevelopers:

Visual C++: NSDoubleEdit: Un control para el manejo de números decimales en Visual C++.
Visual C++: Implementando una Calculadora en Visual C++
Visual C++: CCommandLine: Una clase para el uso de la linea de comando
Visual C++: Una clase para el manejo del Registro


error urgente !! desesperado!

Preguntas y respuestas sobre el lenguaje de programacion C/C++

error urgente !! desesperado!

Notapor pelao el Mié Jun 09, 2004 5:40 am

hola amigos !
tengo este codigo:(PMFieldObject.h)


#ifndef PMFIELDOBJECT_H_INCLUDED
#define PMFIELDOBJECT_H_INCLUDED

#include "PMTextObject.h"

class PMFieldObject : public PMTextObject
{
public:

PMFieldObject();
PMFieldObject(HDC t_HDC);
PMFieldObject(HDC t_HDC, const char* txt);
PMFieldObject(HDC t_HDC, const char* txt, float x, float y);
virtual ~PMFieldObject();

void setText(const char* txt);
};
#endif // #define PMFIELDOBJECT_H_INCLUDED


I cuando compilo me pone el error que :

c:\documents and settings\beep\escritorio\puppetmaker\pmfieldobject.h(16) : error C2504: 'PMTextObject' : base class undefined
pelao
Novato
Novato
 
Mensajes: 3
Registrado: Mié Jun 09, 2004 5:38 am

Re: error urgente !! desesperado!

Notapor latindeveloper el Mié Jun 09, 2004 7:38 am

ASegun lo que veo es que no esta definida la clase PMTextObject que seguramente esta en PMTextObject.h, podrías mostrar el contenido de ese archivo para ver lo que sucede?
Avatar de Usuario
latindeveloper
Administrador
Administrador
 
Mensajes: 1061
Registrado: Lun Jun 02, 2003 8:29 pm
Ubicación: Peru

Re: error urgente !! desesperado!

Notapor pelao el Mié Jun 09, 2004 8:15 am

GRacias ,

Aqui hay el PMTextObject.h:

// PMText.h: interface for the PMText class.
//
//////////////////////////////////////////////////////////////////////

#ifndef PMTEXTOBJECT_H_INCLUDED
#define PMTEXTOBJECT_H_INCLUDED

#include <windows.h> // standard Windows app include
#include <stdio.h>
#include <string.h>
#include <gl\glut.h>

#include "PMMenuObject.h"

class PMTextObject : public PMMenuObject
{
public:

PMTextObject();
PMTextObject(HDC t_HDC);
PMTextObject(HDC t_HDC, const char* txt);
PMTextObject(HDC t_HDC, const char* txt, float x, float y);
virtual ~PMTextObject();

void render();
void setText(const char* txt);
const char* text;
private:
unsigned int base;
};

#endif // #define PMTEXT_H_INCLUDED











Aqui hay el codigo del .CPP

/ PMText.cpp: implementation of the PMText class.
//
//////////////////////////////////////////////////////////////////////

#include "PMTextObject.h"


//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////

PMTextObject::PMTextObject() {
}

PMTextObject::PMTextObject(HDC t_HDC){
base = glGenLists(96);

HFONT hFont = CreateFont(12, 0, 0, 0, FW_BOLD, FALSE, FALSE, FALSE, ANSI_CHARSET,
OUT_TT_PRECIS, CLIP_DEFAULT_PRECIS, ANTIALIASED_QUALITY,
FF_DONTCARE | DEFAULT_PITCH, "Arial");

SelectObject(t_HDC, hFont);
wglUseFontBitmaps(t_HDC, 32, 96, base);
text ="";
mox = 0.0;
moy = 0.0;
}

PMTextObject::PMTextObject(HDC t_HDC, const char* txt){
base = glGenLists(96);

HFONT hFont = CreateFont(12, 0, 0, 0, FW_BOLD, FALSE, FALSE, FALSE, ANSI_CHARSET,
OUT_TT_PRECIS, CLIP_DEFAULT_PRECIS, ANTIALIASED_QUALITY,
FF_DONTCARE | DEFAULT_PITCH, "Arial");

SelectObject(t_HDC, hFont);
wglUseFontBitmaps(t_HDC, 32, 96, base);
text = txt;
mox = 0.0;
moy = 0.0;
}

PMTextObject::PMTextObject(HDC t_HDC, const char* txt, float x, float y){
base = glGenLists(96);

HFONT hFont = CreateFont(12, 0, 0, 0, FW_BOLD, FALSE, FALSE, FALSE, ANSI_CHARSET,
OUT_TT_PRECIS, CLIP_DEFAULT_PRECIS, ANTIALIASED_QUALITY,
FF_DONTCARE | DEFAULT_PITCH, "Arial");

SelectObject(t_HDC, hFont);
wglUseFontBitmaps(t_HDC, 32, 96, base);
text = txt;
setPosition(x, y);
}

PMTextObject::~PMTextObject(){
}

void PMTextObject::setText(const char *txt) {
text = txt;
}

void PMTextObject::render() {
glTranslatef(mox, moy, 0.0);
float bdAmbient[4] = {1.0, 1.0, 1.0, 1.0};
float bdDiffuse[4] = {1.0, 1.0, 1.0, 1.0};
glMaterialfv(GL_FRONT, GL_AMBIENT, bdAmbient);
glMaterialfv(GL_FRONT, GL_DIFFUSE, bdDiffuse);
glRasterPos2f(-0.35f, 0.0f);
glPushAttrib(GL_LIST_BIT);
glListBase(base - 32);
glCallLists(strlen(text), GL_UNSIGNED_BYTE, text);
glPopAttrib();
glTranslatef(-mox, -moy, 0.0);
}
pelao
Novato
Novato
 
Mensajes: 3
Registrado: Mié Jun 09, 2004 5:38 am

Aparentemente no hay ningun problema

Notapor latindeveloper el Mié Jun 09, 2004 8:21 am

Por lo que veo estas utilizando Borland C5,

posiblemente tu compilador no este configurado.... pero antes de eso... este error te sale al compilar o al linkear ?
Avatar de Usuario
latindeveloper
Administrador
Administrador
 
Mensajes: 1061
Registrado: Lun Jun 02, 2003 8:29 pm
Ubicación: Peru

Re: Aparentemente no hay ningun problema

Notapor pelao el Mié Jun 09, 2004 9:49 am

me sale al compilar ...
estoy programando con opengl y C++ ...pero hay algun trozo que es de una amigo ...
no se que pasa...porque yo lo veo bien ..
pelao
Novato
Novato
 
Mensajes: 3
Registrado: Mié Jun 09, 2004 5:38 am

Todo esta bien!

Notapor latindeveloper el Mié Jun 09, 2004 10:07 am

Aparentemente todo esta Ok.. mas me parece un problema del entorno IDE que estas utilizando.

Lo que puedes hacer es enviarme el proyeto y yo aqui lo compilaré en mi maquina.
Avatar de Usuario
latindeveloper
Administrador
Administrador
 
Mensajes: 1061
Registrado: Lun Jun 02, 2003 8:29 pm
Ubicación: Peru


Volver a C/C++

¿Quién está conectado?

Usuarios navegando por este Foro: No hay usuarios registrados visitando el Foro y 0 invitados