Hello, and welcome...

I have a small question about class functions.

Before anythig to understand my problem, when I have this file "test.h" which contains:

#ifndef TEST_H
#define TEST_H
class aFile
{
private:
char *src;
char *dst;
public:
void Copy(char *src, char *dst);
};
#endif//TEST_H

Also I've another file undername "test.cpp" contains:

#include <stdio.h>
#include "test.h"
void aFile::Copy(char *src, char *dst)
{int writer;
FILE *FILE_in,
     *FILE_out;
FILE_in  =  fopen(src,"rb");
FILE_out =  fopen(dst,"wb");
while(1){
writer=getc(FILE_in);
if(writer!=EOF)fprintf(FILE_out,"%c",writer);
else break;
}
fclose(FILE_in);
fclose(FILE_out);
}

Finally, main file to executes last files with name "main.cpp" contains:

#include "test.h"
void main(void)
{
aFile File;
File.Copy("c:\\Document.txt","d:\\Document.ini");
}

when I "Compile" or "Make all" all these files there's
prolem message says:

Info :Linking D:\main.exe
Error: Error: Unresolved external 'aFile::Copy(char*,char*) __stdcall' referenced from D:\MAIN.OBJ

My question is, what's a problem?

William Hemsworth commented: Dumbass.. :icon_exclaim: -1

Recommended Answers

All 3 Replies

One problem, is that you didn't create your own thread.... using someone else's thread to post your question is a sure way to get flamed and not get the answer you desire. It also helps to use code tags.... we see code, all ugly and without colors or indentation, and quite frankly, makes us not want to read it or help.

So, step one to solving your issue, start a new thread and use code tags.

commented: Many thx: I hate thread hijack +4

Ok, Comatose I'm happy with your frankly and I will change that soon,
your speach was good comment,
but this is not the case and, at the end beautiful design will be done when I understand that.
I'm still floating without answers,
if you know where wrong is or anyway to make my Code runs true, show me?

:icon_smile:Nowaday I'm happy:icon_smile:

:-/ Ok, what about this?:-/
I have a small question about class functions.

Before anythig to understand my problem, :X when I have this file "test.h" which contains:

#ifndef TEST_H  //Start TEST_H
#define TEST_H
class aFile  // Class Name
{
private:
char *src;
char *dst;
public:
void Copy(char *src, char *dst);  //Declared Function
};
#endif//End TEST_H

Also I've another file undername "test.cpp" contains:

#include <stdio.h> // STANDARD LIBRARY
#include "test.h"   // My OWN HEADER FILE
void aFile::Copy(char *src, char *dst) //The Complete source OF CopyFile Function
{int writer;
FILE *FILE_in, //Files stream
*FILE_out;
FILE_in = fopen(src,"rb");
FILE_out = fopen(dst,"wb");
while(1){ // Copy Loop
writer=getc(FILE_in);
if(writer!=EOF)fprintf(FILE_out,"%c",writer);
else break;
}
fclose(FILE_in);  // Close all
fclose(FILE_out);
}

Finally, :twisted: main file to executes last files with name "main.cpp" contains:

#include "test.h"// Starting Main.cpp
void main(void)
{
aFile File;   
File.Copy("c:\\Document.txt","d:\\Document.ini");// Call Function(using)
}

when I "Compile" or "Make all" all these files by "Borland 5.06" there's still a problem message says:

ERROR MESSAGE
Info :Linking D:\main.exe
Error: Error: Unresolved external 'aFile::Copy(char*,char*) __stdcall' referenced from D:\MAIN.OBJ

:?:My question is, what's a problem?:?:

:)Peace to anyone knew the truth:)

commented: Read the forum rules AND don't try to hijack threads -1
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.