C++: multiple definition...?

Hallo, ich habe in C++ einen Header erstellt, aber bei der Complierung kommt immer diese Fehlermeldung:

C:\Users\Admin\AppData\Local\Temp\ccdaLGOT.o:lexer.cpp:(.text+0x111): undefined reference to `Token::content[abi:cxx11]() const'
...(Zu lang zum abschicken)
collect2.exe: error: ld returned 1 exit status

Kann mir jemand sagen was der Fehler ist und wie ich ihn behebe?

token.hpp:

#ifndef TOKEN_HPP_
#define TOKEN_HPP_

#include <string>

class Token {
public:
    enum class Type {
        STRING,
        NUMBER,
        BOOLEAN,
        IDENTIFIER,
        EQUAL,
        PLUS,
        MINUS,
        TIMES,
        DIVIDE,
        LESS_THAN,
        GREATER_THAN,
        COMMENT,
        DOT,
        COMMA,
        SEMICOLON,
        CURLY_BRACKET_RIGHT,
        CURLY_BRACKET_LEFT,
        APOSTROPHE,
        COLON,
        UNEXPECTED
    };

    Token                (Type type)              noexcept;

    Type type            ()                       const noexcept;

    bool is                (Type type)               const noexcept;

    bool is_not            (Type type)               const noexcept;

    std::string content ()                       const noexcept;

    void change_content (std::string content)  const noexcept;

    void add_to_content (std::string content)  const noexcept;

    void clear_content  ()                       const noexcept;

    void change_type    (Type type)            const noexcept;

private:
    Type m_type;
    std::string m_content;
};

#endif

token.cpp:

#include "token.hpp"

#include <string>

Token::Token(Type type) noexcept : m_type{type} {};

Token::Type Token::type() const noexcept {
    return m_type;
}

bool Token::is(Type type) const noexcept {
    return m_type == type;
}

bool Token::is_not(Type type) const noexcept {
    return m_type != type;
}

std::string Token::content() const noexcept {
    return m_content;
}

void Token::change_content(std::string content) const noexcept {
    m_content = content;
}

void Token::add_to_content(std::string content) const noexcept {
    m_content = m_content + content;
}

void Token::clear_content() const noexcept {
    m_content.clear(); //Die clear Funktion geht auch nicht
}

void Token::change_type(Type type) const noexcept {
    m_type = type;
}

Ich hoffe jemand kann mir dabei helfen!

LG

PC, Computer, Software, programmieren, compiler, Cplusplus, CPP, development, Informatik, Informatiker, Programmiersprache, C (Programmiersprache), Cpp Programierung
C++ funktion() should have been declared inside namespace?

Hallo, ich arbeite gerade an einer Header Datei in C++. Aber ich kann nun nicht mehr weitermachen weil ständig ein Fehler auftaucht:

meinHeader.h:21:38: error: 'void meinNamespace::draw(int, int)' should have been declared inside 'meinNamespace'

Ich kann im Internet nichts hilfreiches finden und weiß nicht warum der Fehler auftaucht. Hier die betroffenen Codeabschnitte:

#include <Windows.h>
#include <WinUser.h>
#include <string>
#include <stdio.h>
#include <stdlib.h>

#include "meinHeader.h"

#define PI 3.14

enum meinNamespace::color {
    DARKBLUE = 1, 
    DARKGREEN, 
    DARKTEAL, 
    DARKRED,
    DARKPINK,
    DARKYELLOW,
    GRAY, 
    DARKGRAY, 
    BLUE, GREEN, 
    TEAL, 
    RED, 
    PINK, 
    YELLOW, 
    WHITE
};

struct meinNamespace::setColor {
    color _c;
    HANDLE _console_handle;
    setcolor(color c, HANDLE console_handle)
        : _c(c), _console_handle(0)
    { 
        _console_handle = console_handle;
    }
};


void meinNamespace::draw(int x, int y) {
    HWND myconsole = GetConsoleWindow();
    HDC mydc = GetDC(myconsole);

    int pixel =0;

    COLORREF COLOR= RGB(255,255,255); 


    for(double i = 0; i < PI * 4; i += 0.05) {
        SetPixel(mydc,pixel,(int)(50+25*cos(i)),COLOR);
        pixel+=1;
    }
    ReleaseDC(myconsole, mydc);
}

void meinNamespace::drawSquare(int aa, int ab, int ba, int bb) {
    draw(aa,bb);
}

Header:

#ifndef MEINHEADER_H
#define MEINHEADER_H

namespace meinNamespace {
    enum color {
        DARKBLUE=1,DARKGREEN,
        DARKTEAL,DARKRED,
        DARKPINK,DARKYELLOW,
        GRAY, DARKGRAY,
        BLUE,GREEN,
        TEAL,RED,
        PINK,YELLOW,
        WHITE
    };
    struct setcolor;
    void meinNamespace::draw(int x, int y);
    void meinNamespace::draw(int a, int b);
}

#endif

Die Funktionen sollen in ein Konsolenfenster Pixel schreiben, ob sie funktionieren weiß ich noch nicht und sie sind auch noch nicht fertig. Ich weiß nicht wo der Fehler verursacht wird. Ich hoffe jemand kann mir da helfen

LG

Software, IT, programmieren, CPP, development, Informatik, cpp lernen, Cpp Programierung