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 7829793
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T10:54:55+00:00 2026-06-02T10:54:55+00:00

I developed two classes for running a camera frame grabber in a console app

  • 0

I developed two classes for running a camera frame grabber in a console app (one to grab the images and one to process them) and would now like to implement these classes into an MFC project. The class works fine in the console app. When I attempted to use them in the MFC app I get LNK2019 errors. Here’s some code pieces, the image display class is written in a very similar way:

IMAQ class (for grabing images):
IMAQ.h:

#pragma once
#include <queue>
#include <fstream>
#include "CircularInterface.h"
...  // some more includes

class IMAQ
{
public:
explicit    IMAQ();
virtual     ~IMAQ();

int SetupAcq(pRTCaptureStruc pRTCaptStruc);
... // some more functions

// The image acquisition thread
UINT    ImgAcqThread(LPVOID lpdwParam);

private:
BFU32   BdNum,
    BdInitOptns,
    NumBuffers,
    CircInitOptions;

// image acquisition parameters
BFU32   ImageSize,
    BitDepth,
    Xsize,
    Ysize,
    NumPixels,
    BytesPerPix;
bool    GetFrame;

    ... // some more private members

};  // class IMAQ

IMAQ.cpp:

#include "..\\Include\\IMAQClass.h"


IMAQ::IMAQ()
{
BdNum = 0;
BdInitOptns = CiSysInitialize;
CircInitOptions = BiAqEngJ;
NumBuffers = 4;
FilePath = NULL;
_isClean = true;
}  

IMAQ::~IMAQ()
{
// Empty destructor
}

int IMAQ::SetupAcq(pRTCaptureStruc pRTCaptStruc)
{
...// left out code for brevity
}

... // some more functions, all functions declared in header file are defined.

uOCT MFC AppDlg.h:

#pragma once

#include "ImgDspClass.h"
#include "IMAQClass.h"
#include "afxwin.h"

// CuOCTMFCAppDlg dialog
class CuOCTMFCAppDlg : public CDialogEx
{

public:
HBITMAP hBmpWellA6;
BITMAP  BmpWellA6;
UINT8   *pBitsWellA6;

BITMAPINFOHEADER    bmpInfo;

IMAQ                ImgAcq;
ImgDspClass         ImgDsp;

char    *LUTpath;
char    FileName[FILENAME_MAX];

  ... // more members
};

uOCT MFC AppDlg.cpp:

#include "stdafx.h"
#include "uOCT MFC App.h"
#include "uOCT MFC AppDlg.h"
#include "afxdialogex.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#endif


// CAboutDlg dialog used for App About

class CAboutDlg : public CDialogEx
{
public:
    CAboutDlg();

// Dialog Data
    enum { IDD = IDD_ABOUTBOX };

    protected:
    virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support

// Implementation
protected:
    DECLARE_MESSAGE_MAP()
};

BOOL CuOCTMFCAppDlg::OnInitDialog()
{
CDialogEx::OnInitDialog();

// Add "About..." menu item to system menu.

// IDM_ABOUTBOX must be in the system command range.
ASSERT((IDM_ABOUTBOX & 0xFFF0) == IDM_ABOUTBOX);
ASSERT(IDM_ABOUTBOX < 0xF000);

CMenu* pSysMenu = GetSystemMenu(FALSE);
if (pSysMenu != NULL)
{
    BOOL bNameValid;
    CString strAboutMenu;
    bNameValid = strAboutMenu.LoadString(IDS_ABOUTBOX);
    ASSERT(bNameValid);
    if (!strAboutMenu.IsEmpty())
    {
        pSysMenu->AppendMenu(MF_SEPARATOR);
        pSysMenu->AppendMenu(MF_STRING, IDM_ABOUTBOX, strAboutMenu);
    }
}

// Set the icon for this dialog.  The framework does this automatically
//  when the application's main window is not a dialog
SetIcon(m_hIcon, TRUE);         // Set big icon
SetIcon(m_hIcon, FALSE);        // Set small icon


// Change the file path here to change save location
ImgAcq.SetFilePath("C:\\Users\\uOCT clone\\Documents\\temporary\\test.dat");
ImgDsp.SetReferencePath("C:\\Users\\uOCT clone\\Documents\\temporary\\ref.dat");

return TRUE;  // return TRUE  unless you set the focus to a control
}

In my MFC dialog header file I include the IMAQClass.h header file which is sufficient for the console app to work correctly, yet, as I said above, the MFC app returns unresolved external symbol errors. MFC project seetings additional include directories includes the directory containing IMAQ header file.

Why am I receiving unresolved externals?
Thanks

Error message as requested:

 1>uOCT MFC App.obj : error LNK2019: unresolved external symbol "public: virtual __thiscall IMAQ::~IMAQ(void)" (??1IMAQ@@UAE@XZ) referenced in function "public: virtual __thiscall CuOCTMFCAppDlg::~CuOCTMFCAppDlg(void)" (??1CuOCTMFCAppDlg@@UAE@XZ)
 1>uOCT MFC AppDlg.obj : error LNK2001: unresolved external symbol "public: virtual __thiscall IMAQ::~IMAQ(void)" (??1IMAQ@@UAE@XZ)
 1>uOCT MFC App.obj : error LNK2019: unresolved external symbol "public: virtual __thiscall ImgDspClass::~ImgDspClass(void)" (??1ImgDspClass@@UAE@XZ) referenced in function "public: virtual __thiscall CuOCTMFCAppDlg::~CuOCTMFCAppDlg(void)" (??1CuOCTMFCAppDlg@@UAE@XZ)
 1>uOCT MFC AppDlg.obj : error LNK2001: unresolved external symbol "public: virtual __thiscall ImgDspClass::~ImgDspClass(void)" (??1ImgDspClass@@UAE@XZ)
 1>uOCT MFC AppDlg.obj : error LNK2019: unresolved external symbol "public: __thiscall ImgDspClass::ImgDspClass(void)" (??0ImgDspClass@@QAE@XZ) referenced in function "public: __thiscall CuOCTMFCAppDlg::CuOCTMFCAppDlg(class CWnd *)" (??0CuOCTMFCAppDlg@@QAE@PAVCWnd@@@Z)
 1>uOCT MFC AppDlg.obj : error LNK2019: unresolved external symbol "public: __thiscall IMAQ::IMAQ(void)" (??0IMAQ@@QAE@XZ) referenced in function "public: __thiscall CuOCTMFCAppDlg::CuOCTMFCAppDlg(class CWnd *)" (??0CuOCTMFCAppDlg@@QAE@PAVCWnd@@@Z)
 1>uOCT MFC AppDlg.obj : error LNK2019: unresolved external symbol "public: int __thiscall ImgDspClass::SetReferencePath(char * const)" (?SetReferencePath@ImgDspClass@@QAEHQAD@Z) referenced in function "protected: virtual int __thiscall CuOCTMFCAppDlg::OnInitDialog(void)" (?OnInitDialog@CuOCTMFCAppDlg@@MAEHXZ)
 1>uOCT MFC AppDlg.obj : error LNK2019: unresolved external symbol "public: int __thiscall IMAQ::SetFilePath(char * const)" (?SetFilePath@IMAQ@@QAEHQAD@Z) referenced in function "protected: virtual int __thiscall CuOCTMFCAppDlg::OnInitDialog(void)" (?OnInitDialog@CuOCTMFCAppDlg@@MAEHXZ)

EDIT: Problem solved, but I guess I don’t really understand why.

So the comments posted said that I needed to link to the library file. The two classes I was having a problem with do not generate .dll nor .lib files, just .obj. But on a whim I went back and included the .obj file to the link dependencies.

So now my question is: .obj files need to be linked like libraries if they are not generated along with the executable?

  • 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-02T10:54:56+00:00Added an answer on June 2, 2026 at 10:54 am

    You haven’t given us enough detail to help you. You have told us that you are getting a linker error, but you need to tell us the exact error message, i.e., which symbols are undefined?

    Here is my guess; you have included an additional header file. This header file is part of a library, but you have not linked in the library itself, only included the header. So you got the first part right, now you need to open up your linker settings page, add the additional library directory (i.e., where the .lib, .obj, .whatever implementation file resides), and then add the name of the library to the “Additional Dependencies” section.

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

Sidebar

Related Questions

I am very new to iPhone. I have developed two version of an application
I have two android applications that I have developed. I need to compare the
Say you have two main-line branches that have been developed separately for a long
I have two questions. In my webpage (developed by me), I use the GET
I've always wondered how an actively developed common library used in two or more
I've got two classes : Unit and User. a Unit class has a User
I've developed an application (for example's sake, let's say it's a membership card app),
Let's say I have two Entity classes: SocialApp and SocialAppType In SocialApp I have
I work on two related web applications, developed in PHP, that started independently. Over
I've got an app that I've developed for the iPhone, but now want to

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.