1. unresolved external symbol __endthreadex and unresolved external symbol __beginthreadex
I just don't get it. I punch in the code JUST as it is written and it doesn't work:
//***************************
//
// Hello.h
//
//***************************
class CMyApp : public CWinApp
{
public:
virtual BOOL InitInstance();
};
class CMainWindow : public CFrameWnd
{
public:
CMainWindow();
protected:
afx_msg void OnPaint();
DECLARE_MESSAGE_MAP()
};
//**************************
//
// hello.cpp
//
//**************************
#include <afxwin.h>
#include "hello.h"
CMyApp myApp;
////////////////////////////
// CMyApp member functions
BOOL CMyApp::InitInstance()
{
m_pMainWnd = new CMainWindow;
m_pMainWnd->ShowWindow(m_nCmdShow);
m_pMainWnd->UpdateWindow();
return TRUE;
}
////////////////////////////
// CMainWindow message map and member functions
BEGIN_MESSAGE_MAP(CMainWindow, CFrameWnd)
ON_WM_PAINT()
END_MESSAGE_MAP()
CMainWindow::CMainWindow()
{
Create(NULL, "The Hello Application");
}
void CMainWindow::OnPaint()
{
CPaintDC dc(this);
CRect rect;
GetClientRect(&rect);
dc.DrawText("Hello, MFC", -1, &rect,
DT_SINGLELINE | DT_CENTER | DT_VCENTER);
}
--------------------Configuration: hello95 - Win32 Debug--------------------
Compiling...
hello.cpp
Linking...
nafxcwd.lib(thrdcore.obj) : error LNK2001: unresolved external symbol __endthreadex
nafxcwd.lib(thrdcore.obj) : error LNK2001: unresolved external symbol __beginthreadex
Debug/hello95.exe : fatal error LNK1120: 2 unresolved externals
Error executing link.exe.
The project was a Win32 Application. What have I done wrong? There is no indication that anything else is necessary but to me it looks like there are some includes not included or some libs not libed that should be included and\or libed.
--
George Hester
__________________________________
2. Link error LNK2019: unresolved external symbol
3. unresolved external symbol when link with exp lib
Hi, I am using VS.NET 2003 with MFC7 and I have a link error: I use a library dll built with VC60 and mfc4.2, I have the export lib and include file for that library. The dll implements a Document class (CMyDoc). In the program when I use RUNTIME_CLASS(CMyDoc) to call CreateObject I got a link error unresolved external symbol: "public: static struct CRuntimeClass * __stdcall CMyDoc::GetThisClass(void)" (?GetThisClass@CMyDoc@@SGPAUCRuntimeClass@@XZ). I can't call CMyDoc::_GetBaseClass() instead, because it is declared protected. I changed the program to use _RUNTIME_CLASS(CMyDoc) instead, and I have a different unresolved external symbol: "public: static struct CRuntimeClass const CMyDoc::classCMyDoc" (?classCMyDoc@CMyDoc@@2UCRuntimeClass@@B) I know that CMyDoc::classCMyDoc is an export in my dll. The MFC it's getting worst and worst!
4. ATL and MFC causing link error - LNK2019: unresolved external symb
5. ATL and MFC causing link error - LNK2019: unresolved external
I'm saying that one of my projects that is using "MFC" and not using "ATL" compiles and links my CPP/.H file fine. Another project project that is using "MFC" and "ATL" (as project configuration settings) results in the unresolved extenral symbol. both projects have classes derived from CSingletonObj. "Brian Muth" wrote: > > >> > >> error LNK2019: unresolved external symbol "protected: __thiscall > >> CSingletonObj::CSingletonObj(void)" (??0CSingletonObj@@IAE@XZ) referenced in > >> function "private: __thiscall CMyClass::CMyClass(void)" (??0CMyClass@@AAE@XZ) > > That certainly looks like a reference to an object that you defined. Are you saying that when you look at the code for CMyClass that > you can't find any reference to CSingletonObj? > > Brian > >
6. Linking errors. - VC++ - Unresolved external Symbol
7. linking 2 projects together - getting 'unresolved external symbol' error
Hi I am hoping someone can help me.
I have set up a VC++ 2005 solution containing three project folders:
myFunction, myMain1 and myMain2.
myFunction contains a set of functions that I would like to utilise in my
other projects, namely myMain1 and myMain2.
myMain1 and myMain2 simply try and instantiate the object contained in
myFunction, so as to utilise the functions within myFunction. myFunction
builds ok. The problem is that I get an error LNK2019: unresolved external
symbol error when I try and build myMain1 and myMain2.
Here is the reduced content of the above projects:
1) myFunction project contains:
-----------------------------------
// ttest.h ----begin
#ifndef TTEST_H
#define TTEST_H
class TTEST
{
public:
TTEST();
void TTEST :: out( void );
};
#endif
// test.h -----end
------------------------------------
// ttest.cpp ----begin
#include <iostream>
#include "ttest.h"
TTEST :: TTEST()
{}
void TTEST::out(void)
{
std::cout << "hi";
}
// ttest.cpp -----end
------------------------------------
// ttestmain.cpp ----begin
#include <iostream>
#include "ttest.h"
int main(int argc, char** argv)
{
TTEST myt = TTEST();
myt.out();
int n;
std::cin >> n;
return 0;
}
// testmain.cpp ----end
------------------------------------
2) myMain1 project contains:
-----------------------------------
// realmain.cpp ----begin
#include <iostream>
#include "ttest.h"
int main(int argc, char** argv)
{
TTEST myt = TTEST();
myt.out();
int n;
std::cin >> n;
return 0;
}
// realmain.cpp ----end
---------------------------------
Within the myMain project I have gone to properties > C++ > Additional
include Directories, and placed the path to the directory containing
testmain.h
Note that when I build myFunction, it works ok and the function outputs "hi"
to the screen. I want to execute that same function from myMain1's
realmain.cpp.
This does work if I include all the above files within a 'single' project
folder within the VC++ solution. however if i have two separate project
folders as constructted above, it doesnt link and complains of unresolved
external symbol:
myMain1.obj : error LNK2019: unresolved external symbol "public: void
__thiscall TTEST::out(void)" (?out@TTEST@@QAEXXZ) referenced in function
_main
myMain1.obj : error LNK2019: unresolved external symbol "public: __thiscall
TTEST::TTEST(void)" (??0TTEST@@QAE@XZ) referenced in function _main
F:\Tools\Microsoft\Visual Studio Projects\test\MSVC\Debug\test.exe : fatal
error LNK1120: 2 unresolved externals
Can anyone tell me what I need to do to gett he above configuration working?
Many thanks.
Peter