the falta struct antes de hola en el cpp o poner <br>typedef struct {<br>int a;<br>} Hola;<br>en el punto h.<br><br><div class="gmail_quote">El 13 de mayo de 2009 6:57, Victor <span dir="ltr"><<a href="mailto:teny_84@hotmail.com">teny_84@hotmail.com</a>></span> escribió:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Hola,<br>
Me gustaria que me echaran una mano con un problema relativo a la inclusion de un atributo struct dentro de una clase cpp. La estructura esta definida en un archivo .h con el siguiente contenido:<br>
<br>
#ifndef TENY_H<br>
#define TENY_H<br>
<br>
struct Hola<br>
{<br>
    int a;<br>
};<br>
<br>
#endif<br>
<br>
En el archivo de la clase que he definido incluyo el archivo teny.h y defino un atributo privado del tipo Hola como sigue:<br>
<br>
#ifndef CONSOLE_H<br>
#define CONSOLE_H<br>
<br>
#include <vector><br>
#include <string><br>
#include <stdio.h><br>
#include <string.h><br>
#include <memory.h><br>
#include <unistd.h><br>
#include <sys/socket.h><br>
#include <netinet/in.h><br>
#include <netdb.h><br>
#include <signal.h><br>
#include <math.h><br>
#include <malloc.h><br>
#include <ctype.h><br>
#include <fcntl.h><br>
#include <stdlib.h><br>
#include <sys/time.h><br>
#include <sys/stat.h><br>
#include <sys/errno.h><br>
#include <sys/types.h><br>
#include <sys/time.h><br>
#include <sys/un.h><br>
#include <arpa/inet.h><br>
#include <time.h><br>
<br>
#include <ipt/ipt.h><br>
#include <ipt/message.h><br>
#include <ipt/connection.h><br>
#include <gt_simulation.h><br>
<br>
#include <gt_ipt_msg_def.h><br>
<br>
#include <FSA_status.h><br>
#include <lineutils.h><br>
#include <lmadjust.h><br>
#include <pthread.h><br>
<br>
#include "teny.h"<br>
<br>
const double COMMUNICATOR_SLEEPTIME_SEC = 0.1;<br>
<br>
class Console<br>
{<br>
<br>
private:<br>
    char hostname[100];<br>
    char console_ipt_port[100];<br>
    char ipt_home[512];<br>
    char *suggested_ipt_home;<br>
    void *status;<br>
<br>
    Hola hol;<br>
<br>
    IPCommunicator* communicator;<br>
    IPConnection*  com_link;<br>
    //Default birth = false<br>
    bool birth;<br>
    pthread_t thread1;<br>
    int debug;<br>
    Vector position;<br>
    float heading;<br>
    float velX, velY;<br>
    char * DefaultConsoleName;<br>
<br>
<br>
public:<br>
<br>
    Console();<br>
<br>
<br>
<br>
};<br>
<br>
#endif // CONSOLE_H<br>
<br>
A la hora de compilar obtengo el siguiente error que no logro corregir:<br>
<br>
'Hola' no nombra a un tipo.<br>
<br>
He intentado en vez de poner directametne Hola hol, especificar struct Hola hol y el nuevo error que me da es:<br>
<br>
console.h:53: error: el campo ‘hol’ tiene tipo de dato incompleto<br>
<br>
No entiendo muy bien porque no puedo hacer esta definicion. Agradeceria cualquier sugerencia, ayuda de como poder solventarlo.<br>
<br>
gracias.<br>
_______________________________________________<br>
Lista de correo Cconclase <a href="mailto:Cconclase@listas.conclase.net">Cconclase@listas.conclase.net</a><br>
<a href="http://listas.conclase.net/mailman/listinfo/cconclase_listas.conclase.net" target="_blank">http://listas.conclase.net/mailman/listinfo/cconclase_listas.conclase.net</a><br>
Bajas: <a href="http://listas.conclase.net/index.php?gid=2&mnu=FAQ" target="_blank">http://listas.conclase.net/index.php?gid=2&mnu=FAQ</a></blockquote></div><br><br clear="all"><br>-- <br> (\__/) <br>(='.'=)This is Bunny. Copy and paste bunny into your <br>
(")_(")signature to help him gain world domination. <br><br>