tutorials.de Buch-Aktion 05/2012
ERLEDIGT
JA
ANTWORTEN
0
ZUGRIFFE
879
EMPFEHLEN
  • An Twitter übertragen
  • An Facebook übertragen
AUF DIESES THEMA
ANTWORTEN
  1. #1
    Avatar von Orbit
    Orbit Orbit ist offline Mitglied Gold
    Registriert seit
    Aug 2007
    Beiträge
    175
    Hallo,
    Ich krieg folgende Fehlermeldung wenn ich folgendes kompiliere(n will):
    Code :
    1
    
    ERROR: unresolved external 'text::text()'  referenced from dateipfad.obj
    Folgende dateien:
    (Die Namen haben keine Bedeutung...:-D)

    Makefile:
    Code :
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    
    INCLUDE = C:\Borland\BCC55\Include
    LIB = C:\Borland\BCC55\Lib
    CPP = bcc32
     
    HalloWelt.exe: HalloWelt.obj text.obj
        $(CPP) -I$(INCLUDE) -L$(LIB) HalloWelt.obj -o$@
     
    .cpp.obj:
        $(CPP) -I$(INCLUDE) -L$(LIB) -c $<
     
    clean:
        del *.obj del *.exe del *.tds

    HalloWelt.cpp:
    Code :
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    
    #include "text.h"
    #include <iostream.h>
     
    void main(void){
        int p;
        cin>>p;
        int c;
        cin>>c;
        text t;
        cout<<"------------------------"<<endl<<"Das Maximum ist:"<<endl;
        cout<<t.getMax(p,c);
        cout<<"------------------------"<<endl<<"Das Minimum ist:"<<endl;
        cout<<t.getMin(p,c);
        cout<<"------------------------"<<endl<<"Aufgreufen:"<<endl;
        cout<<t.getAnzahl();
    }
    text.h:
    Code :
    1
    2
    3
    4
    5
    6
    7
    8
    9
    
    class text{
    public: 
        text();
        int getMin(unsigned int x, unsigned int y);
        int getMax(unsigned int x, unsigned int y);
        int getAnzahl();
    protected:
        int anzahl;
    };
    text.cpp:
    Code :
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    
    #include "text.h"
        text::text(){
            anzahl=0;
        };
        int text::getMin(unsigned int x, unsigned int y){
            anzahl++;
            int dummy;
            if(x>=y){
                dummy = y;
            } else {
                dummy = x;
            }
            return dummy;
        };
        int text::getMax(unsigned int x, unsigned int y){
            anzahl++;
            int dummy;
            if(x>=y){
                dummy=x;
            } else {
                dummy=y;
            }
            return dummy;
        };
        int text::getAnzahl(){
            return anzahl;
        };

    Ich hab noch echt keinen Plan von c++, heute damit angefangen. Aber bei google findet man unter der fehlermeldung lauter leute mit den Probs aber keine Lösung...
    mfg,
    Orbit


    ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
    Ok, Doofheit tut bekanntlich weh und ich winde mich in Schmerzen.
    Lösung:
    Code :
    1
    2
    
    HalloWelt.exe: HalloWelt.obj text.obj
        $(CPP) -I$(INCLUDE) -L$(LIB) HalloWelt.obj -o$@
    in der makefile muss natürlich
    Code :
    1
    2
    
    HalloWelt.exe: HalloWelt.obj text.obj
        $(CPP) -I$(INCLUDE) -L$(LIB) HalloWelt.obj [b]text.obj[/b]- o$@
    Sein!
    Geändert von Orbit (02.02.08 um 20:23 Uhr)
     

Ähnliche Themen

  1. Unresolved external
    Von ComFreek im Forum Borland CBuilder und VCL
    Antworten: 2
    Letzter Beitrag: 26.07.09, 10:28
  2. Unresolved external
    Von derNero im Forum C/C++
    Antworten: 3
    Letzter Beitrag: 27.05.08, 10:59
  3. error LNK2019: unresolved external
    Von Nabi im Forum C/C++
    Antworten: 2
    Letzter Beitrag: 28.07.06, 11:21
  4. Antworten: 8
    Letzter Beitrag: 10.08.05, 09:51
  5. Antworten: 3
    Letzter Beitrag: 25.05.05, 19:10