Witam. Nie mogę zmusić kompilatora do skompilowania takiego projektu:
//main.cpp
#include <windows.h>
#include <string>
#include <iostream>
#include "sock_class.h"
#include "nvt.h"
#include "telnet.h"
#include "station.h"
#pragma comment(lib, "wsock32.lib")
using namespace std;
int main()
{
//sock_class.h
#pragma once
#ifndef sock_class_h
#define sock_class_h
class polaczenie
{
public:
//nvt.h
#pragma once
#ifndef nvt_h
#define nvt_h
class nvt : public polaczenie
{
public:
//telnet.h
#ifndef telnet_h
#define telnet_h
class telnet : public nvt
{
public:
//station.h
#pragma once
#ifndef station_h
#define station_h
/*#include <windows.h>
#include <string>
#include <iostream>
#include "sock_class.h"
#include "nvt.h"
#include "telnet.h"
#include "station.h"*/
class station : public telnet
{
public:
char * cfg_debug;
void station_cfg();
};
#endif
Jak nie komentuję te includy to obiekt s tworzony w pliku station.cpp widzi odziedziczone metody jednak kompilator pluje o metodach które już zostały zdefiniowane. Jeśli są komentowane to obiekt s nie widzi odziedziczonych metod oraz typów.
//station.cpp
#include "station.h"
void station_cfg()
{
station s;
s.wyslij("costam_kiedys\r\n");
s.cfg_debug = s.odbierzchar();
std::cout << "cfg_debug: " << s.cfg_debug << std::endl;
};
ps. nie wiem czemu to tak brzydko wygląda, chyba nie rozumiem tagów.