ERLEDIGT
JA
JA
ANTWORTEN
3
3
ZUGRIFFE
519
519
EMPFEHLEN
-
Hallo,
ich hab in mein Programm eine Klasse (ftp) eingebunden und es funktioniert soweit alles super.
Ich kann alle public methoden benutzen nur wenn ich eine bestimmte methode aufrufen will bringt der compiler/linker folgenden Fehler:
Error: Unresolved external 'ftp:
oShellCommand(char *)' referenced from C:\PROGRAM FILES\BORLAND\BCC55\BIN\CSV2CMX1.2.OBJ
Programm:
Code :1 2 3 4 5 6
void ftptransfer(string host, string user, string pass, string partfile){ ftp theFtpConnection; theFtpConnection.DoOpen("xxxxxxx"); theFtpConnection.DoLogin("xxxxxxx"); theFtpConnection.DoShellCommand("!dir"); }
Header der Klasse:
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 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106
#ifndef __ftp__ #define __ftp__ #include <io.h> #define DEFAULT_PORT_NUM 21 #define PASSWORD_LENGTH 256 #define EINTR WSAEINTR #define bzero(x,y) memset(x,0,y) #define bcopy(x,y,z) memcpy(y,x,z) #define closeS closesocket enum { LS = 0, BINARY, ASCII, PWD, CD, OPEN, CLOSE, QUIT, LCD, LLS, LDIR, USER, SHELL, IGNORE_COMMAND, GET, PUT, HELP, RHELP, FTP_COMPLETE=1, /* these will be used later */ FTP_CONTINUE, FTP_ERROR }; class ftp { public: ftp(); ~ftp(); void DoOpen(char *); void DoList(char *); void DoCD(char *); void DoLogin(char *); void DoClose(void); void DoLCD( char *); void DoPut( char *); void DoGet( char *); void DoLLS(char * ); void DoShellCommand(char *); void DoBinary(); void DoRhelp( char *); void DoAscii(); void DoPWD(); int CheckFds(char *); private: char szBuffer[1025]; /* buffer used to read/write */ char szUser[20]; /* stores username */ char szPass[256]; /* stores user password */ int Connected; /* flag for connect status */ int hListenSocket; int hControlSocket; int hDataSocket; int bSendPort; int ReadCommand; int bMode; int GetReply(); int GetLine(); void CleanUp(); int SendControlMsg(char *, int); int SendDataMsg( char *szBuffer, int len); int ConnectToServer(char *name, char *port); int GetListenSocket(); int InitWinsock(); int AcceptConnection(); void CloseControlConnection( void ); void CloseDataConnection( int hDataSocket ); void CloseListenSocket(); int ReadDataMsg( char *szBuffer, int len); void GetPassword( char *szPass ); int GetUnixInput(char *command); int GetWin32Input( char *command); void GetFile( char *fname); void PutFile( char *fname); int ReadControlMsg( char *szBuffer, int len); int CheckControlMsg( char *szPtr, int len); int CheckInput(); }; #endif
Codeausschnitt der Klasse
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 28 29
#include <ftp.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <ctype.h> #include <time.h> #include <winsock.h> #include <direct.h> #include <wincon.h> #include <signal.h> #include <conio.h> * function to pass commands to the system, ie: dir. * this function gets called when '!' is encountered */ void DoShellCommand( char *command ) { command++; /* ignore '!' */ #if ( !defined(_WIN32) || !defined(WIN32) ) system(command); #else if( !command || !*command) system("cmd"); /* have to fix this for win95 */ else /* maybe i should use 'start' */ system(command); /* programatically determine which */ #endif /* system we are on, then make the */ /* appropriate call */ }
Wie gesagt ich bekomm nur Unresolved external bei der Methode DoShellCommand(*char)
vielen Dank für euere Hilfe
-
22.05.08 09:51 #2
- Registriert seit
- Jun 2005
- Beiträge
- 8.168
Hi.
Die DoShellCommand Methode hast du ja auch nicht implementiert. Du hast eine Funktion DoShellCommand definiert, die mit der ftp Klasse nichts zu tun hat.
Die Definition müßte so aussehen:
GrußCode cpp:1 2 3
void ftp::DoShellCommand( char *command ) { ... }
Geändert von deepthroat (22.05.08 um 09:54 Uhr)
If at first you don't succeed, try again. Then quit. No use being a damn fool about it.
-
Ich glaub er hat die Klasse nicht selbst geschrieben
Sollte zu dem Unfug von Borland gehören.
-

Super Danke.
Nein die Klasse hab ich aus dem Netz. Wär mir nie aufgefallen das da ein ftp:: fehlt
Ähnliche Themen
-
Unresolved external
Von ComFreek im Forum Borland CBuilder und VCLAntworten: 2Letzter Beitrag: 26.07.09, 10:28 -
ERROR: unresolved external .. referenced by datei
Von Orbit im Forum C/C++Antworten: 0Letzter Beitrag: 02.02.08, 18:01 -
linker fehler unresolved external
Von woppa im Forum C/C++Antworten: 1Letzter Beitrag: 30.08.06, 08:42 -
error LNK2019: unresolved external
Von Nabi im Forum C/C++Antworten: 2Letzter Beitrag: 28.07.06, 11:21 -
[Linker Fehler] Unresolved external
Von Supa im Forum C/C++Antworten: 5Letzter Beitrag: 07.07.05, 12:23





Zitieren
Login






