Such quite small program drives me crazy. I always get the following error messages:
Error   1   error LNK2019: unresolved external symbol "public: class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > __thiscall ErstesPraktikum::createNameString(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,int)" (?createNameString@ErstesPraktikum@@QAE?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V23@00H@Z) referenced in function _main    Praktikum_gra.obj   GRA
Error   2   fatal error LNK1120: 1 unresolved externals C:\Users\xxx\Documents\Visual Studio 2008\Projects\GRA\Debug\GRA.exe    GRA
Here is me program, which contains the classes ErstesPraktikum and Praktikum_gra plus the corresponding header files.
I just want to use the Praktikum_gra Class to call methods of the ErstesPraktikum Class. I spent hours in resolving this error, but without success. Is that a programming mistake or a configuration problem ? My last hope is that someone of you can give me a hint...
Note: String is just a wrapper for std::string of openCV.
ErstesPraktikum.h
#include <opencv2\core\core.hpp>
using namespace std;
using namespace cv;
class ErstesPraktikum
{
    private:
        String convertInteger(int);
    public:
        String createNameString(String, String, String, int);
        void readImage(String, Mat *);
        void extractObjects(int, Mat *, Mat *);
};
ErstesPraktikum.cpp
#include <opencv2\core\core.hpp>
#include <opencv2\highgui\highgui.hpp>
#include <opencv2\imgproc\imgproc.hpp>
#include <fstream>
using namespace std;
using namespace cv;
String convertInteger(int value) 
{
    stringstream ss;
    ss << value;
    return ss.str();
}
String createNameString(String path, String fileName, String fileExtension, int buildNumber)
{
    String pathString = path.append(fileName);
    pathString = pathString.append(".");
    pathString = pathString.append(convertInteger(buildNumber));
    pathString = pathString.append(".");
    pathString = pathString.append(fileExtension);
    return pathString;
}
void readImage(String nameString, Mat * image) 
{
   double mn = 0, mx = 0;
   image = &cv::Mat(cv::Size(512, 512), IPL_DEPTH_8U, 1);
   unsigned short *data;
   data = (unsigned short *)image->data;
   FILE *file;
   file = fopen(nameString.c_str(), "rb");
   fseek(file, 1340, SEEK_SET);
   fread(data, sizeof(unsigned short)*512*512, 1, file);
   fclose(file);
   //cv::cvSmooth(Image,Image);
   //cv::minMaxLoc(image, &mn, &mx, NULL, NULL, 0);
   //cv::convertScaleAbs(image, *target, 255/mx, -mn*255/mx);
}
void extractObjects(int threshold, Mat * img, Mat * binImg) 
{
}
Praktikum_gra.h
class Praktikum_gra
{
    public:
        int main(void);
}
Praktikum_gra.cpp
#include "ErstesPraktikum.h"
using namespace std;
using namespace cv;
    int main(void)
    { 
        String path("C:\\Users\\xxx\\xxx\\xxx\\GRA P1\\Head_M\\");
        String fileName("vhm");
        String fileExtension("dcm");
        ErstesPraktikum prak;
        for(int i = 1001; i <= 1245; i++) 
        {
            String nameString = prak.createNameString(path, fileName, fileExtension, i); // this line is the cause of the error message, but why ?
        }
        return 0;
    }
I already tried to add a class prefix to all methods like:
String ErstesPraktikum::createNameString(String path, String fileName, String fileExtension, int buildNumber)
{
    // [...]
}
But this throws another error message:
Error   1   error C2653: 'ErstesPraktikum' : is not a class or namespace name   c:\users\xxx\documents\visual studio 2008\projects\gra\gra_u1\erstespraktikum.cpp   17  GRA
 
     
    