ERLEDIGT
JA
JA
ANTWORTEN
0
0
ZUGRIFFE
879
879
EMPFEHLEN
-
Hallo,
Ich krieg folgende Fehlermeldung wenn ich folgendes kompiliere(n will):
Folgende dateien:Code :1
ERROR: unresolved external 'text::text()' referenced from dateipfad.obj
(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:
text.h: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.cpp: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; };
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:
in der makefile muss natürlichCode :1 2
HalloWelt.exe: HalloWelt.obj text.obj $(CPP) -I$(INCLUDE) -L$(LIB) HalloWelt.obj -o$@
Sein!Code :1 2
HalloWelt.exe: HalloWelt.obj text.obj $(CPP) -I$(INCLUDE) -L$(LIB) HalloWelt.obj [b]text.obj[/b]- o$@
Geändert von Orbit (02.02.08 um 20:23 Uhr)
Ähnliche Themen
-
Unresolved external
Von ComFreek im Forum Borland CBuilder und VCLAntworten: 2Letzter Beitrag: 26.07.09, 10:28 -
Unresolved external
Von derNero im Forum C/C++Antworten: 3Letzter Beitrag: 27.05.08, 10:59 -
error LNK2019: unresolved external
Von Nabi im Forum C/C++Antworten: 2Letzter Beitrag: 28.07.06, 11:21 -
Problem beim kompelieren, error LNK2001: unresolved external symbo
Von qwartz im Forum C/C++Antworten: 8Letzter Beitrag: 10.08.05, 09:51 -
SDL: error LNK2001: unresolved external symbol _IMG_Load
Von powerplayer im Forum C/C++Antworten: 3Letzter Beitrag: 25.05.05, 19:10





Zitieren
Login






