Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8809763
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T02:57:29+00:00 2026-06-14T02:57:29+00:00

Such quite small program drives me crazy. I always get the following error messages:

  • 0

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
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T02:57:30+00:00Added an answer on June 14, 2026 at 2:57 am

    You have to

    #include "ErstesPraktikum.h"
    

    in ErstesPrakticum.cpp. Then, you need to use ErstesPrakticum:: in the implementations.

    String ErstesPraktikum::createNameString( .... ) { .... }
    

    and so on.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following small program: ages=[23,23,43,54,34,22,43,23] histogram={} for age in ages: if not
I am quite comfortable with generics and such, but in this special case I
Quite simply: is there a place such as DeviantArt, but purely for the purpose
Perl has quite a few special variables such as @F , $! , %!
I've got quite a few SQL statements like such: SELECT foo FROM things WHERE
First I want to apologize for such a silly question but I'm quite new
Symbols such as: ♫ http://www.chatsmileysemoticons.com/music-symbol-twitter/ So that I can do something like: $tweet =
I am quite new to django, and I have built a small page using
At first, small program: #include <mysql++.h> using namespace mysqlpp; void mainuu () { Connection
Quite often, Git and Ruby on Rails looks like magic... such as in the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.