Undefinierte Referenz/ Mehrfachdefinition für den Namespace Extern Variable, C ++ StrukturierungsproblemC++

Programme in C++. Entwicklerforum
Guest
 Undefinierte Referenz/ Mehrfachdefinition für den Namespace Extern Variable, C ++ Strukturierungsproblem

Post by Guest »

Ich mache einen Namespace, um mir zu helfen, ein Programm zu debuggen, aber ich habe ein Problem damit, herauszufinden, wie alles strukturiert und es ohne Probleme erstellen kann. < /p>

Hier ist Mein aktueller Header: < /p>

Code: Select all

#ifndef HELPER_H
#define HELPER_H
#include 
#include 
#include 

namespace Helper
{
enum LOG { ONSCREEN, OFFSCREEN };
extern std::ofstream logfile;
//std::ofstream logfile("log.txt", std::ios_base::out | std::ios_base::app );

void EnableLogging();
void Log(std::string s, LOG type);

template 
std::string ToString(const T& t)
{
std::ostringstream sstr;
sstr 

Hier ist die Helfer -CPP -Datei: < /p>

#include "Helper.h"
#include 

void Helper::EnableLogging()
{
#ifdef WIN32
// To use console on pc
std::ofstream ctt("CON");
freopen("CON", "w", stdout);
freopen("CON", "w", stderr);
#endif
#ifdef GP2X
//To log to text file on the caanoo
logfile.open("log.txt", std::ios_base::out | std::ios_base::app );
#endif

}

void Helper::Log(std::string s, LOG type)
{
if(type == OFFSCREEN)
{
#ifdef GP2X
//log

Quick Reply

Change Text Case: 
   
  • Similar Topics
    Replies
    Views
    Last post