473,398 Members | 2,403 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,398 software developers and data experts.

error LNK2019 problem

Hi,

I have a simple project, with a main application and a static library.
I call a function from one of the classes in the static lib, but during
compile time I get the LNK2019 problem.

Strange thing is that if I call a different function there is no compile
error with that one. Both public, both defined in the header and
implemented in the cpp file.

I have triple checked that my libraries are linked correctly... all
other functions and classes are linked just fine... just this one
function is a problem.

Any suggestions on what it may be?

Thanks
Nov 28 '05 #1
6 4178
Nicros wrote:
Hi,

I have a simple project, with a main application and a static library. I
call a function from one of the classes in the static lib, but during
compile time I get the LNK2019 problem.

Strange thing is that if I call a different function there is no compile
error with that one. Both public, both defined in the header and
implemented in the cpp file.

I have triple checked that my libraries are linked correctly... all
other functions and classes are linked just fine... just this one
function is a problem.

Any suggestions on what it may be?

Thanks


Perhaps you have declared one function in the header and implemented a
different function in the cpp file.

Why not show us the code? Cut and paste it from your cpp file and header
file.

john
Nov 28 '05 #2

"John Harrison" <jo*************@hotmail.com> wrote in message
news:M5*****************@newsfe3-gui.ntli.net...
Nicros wrote:
Hi,

I have a simple project, with a main application and a static library. I
call a function from one of the classes in the static lib, but during
compile time I get the LNK2019 problem.

Strange thing is that if I call a different function there is no compile
error with that one. Both public, both defined in the header and
implemented in the cpp file.

I have triple checked that my libraries are linked correctly... all other
functions and classes are linked just fine... just this one function is a
problem.

Any suggestions on what it may be?

Thanks


Perhaps you have declared one function in the header and implemented a
different function in the cpp file.

Why not show us the code? Cut and paste it from your cpp file and header
file.


You should also include the text of that link error. Error codes like
"LNK2019" are specific to your compiler (and possibly even just that version
of the compiler), and we have no way to know what it means, or to what
functions or files it is referring.

-Howard


Nov 28 '05 #3


You should also include the text of that link error. Error codes like
"LNK2019" are specific to your compiler (and possibly even just that version
of the compiler), and we have no way to know what it means, or to what
functions or files it is referring.

-Howard


Here is the linker error:
AutomatonViewer error LNK2019: unresolved external symbol "public: void
__thiscall CSimulator::StartSimulation(class ATL::CStringT<char,class
StrTraitMFC_DLL<char,class ATL::ChTraitsCRT<char> > > &,class
ATL::CStringT<char,class StrTraitMFC_DLL<char,class
ATL::ChTraitsCRT<char> > > &)"
(?StartSimulation@CSimulator@@QAEXAAV?$CStringT@DV ?$StrTraitMFC_DLL@DV?$ChTraitsCRT@D@ATL@@@@@ATL@@0 @Z)
referenced in function "public: void __thiscall
CAutomatonViewerDoc::OnSimulationRun(void)"
(?OnSimulationRun@CAutomatonViewerDoc@@QAEXXZ)
Here is the function declaration from the header for class CSimulator:
void StartSimulation(CString& cstrPathInit, CString& cstrPathArchive);

And from the cpp file:
void CSimulator::StartSimulation(CString& cstrPathInit, CString&
cstrPathArchive)
{

}

The call:
void CAutomatonViewerDoc::OnSimulationRun()
{
m_simulator.StartSimulation(m_cstrPathInitFile, m_cstrPathArchive);
}
Nov 29 '05 #4
Nicros wrote:


You should also include the text of that link error. Error codes like
"LNK2019" are specific to your compiler (and possibly even just that
version of the compiler), and we have no way to know what it means, or
to what functions or files it is referring.

-Howard


Here is the linker error:
AutomatonViewer error LNK2019: unresolved external symbol "public: void
__thiscall CSimulator::StartSimulation(class ATL::CStringT<char,class
StrTraitMFC_DLL<char,class ATL::ChTraitsCRT<char> > > &,class
ATL::CStringT<char,class StrTraitMFC_DLL<char,class
ATL::ChTraitsCRT<char> > > &)"
(?StartSimulation@CSimulator@@QAEXAAV?$CStringT@DV ?$StrTraitMFC_DLL@DV?$ChTraitsCRT@D@ATL@@@@@ATL@@0 @Z)
referenced in function "public: void __thiscall
CAutomatonViewerDoc::OnSimulationRun(void)"
(?OnSimulationRun@CAutomatonViewerDoc@@QAEXXZ)
Here is the function declaration from the header for class CSimulator:
void StartSimulation(CString& cstrPathInit, CString& cstrPathArchive);

And from the cpp file:
void CSimulator::StartSimulation(CString& cstrPathInit, CString&
cstrPathArchive)
{

}

The call:
void CAutomatonViewerDoc::OnSimulationRun()
{
m_simulator.StartSimulation(m_cstrPathInitFile, m_cstrPathArchive);
}

One posssible explaination, check that the StartSimulation function is
declared in the public part of the CSimulator class.

Failing that, I suggest physically deleteing all the object and library
files and rebuilding your entire project.

And failing that post the entire code, or put it on a web site and post
the link.

john
Nov 29 '05 #5

"John Harrison" <jo*************@hotmail.com> wrote in message
news:f9******************@newsfe4-gui.ntli.net...
Nicros wrote:


You should also include the text of that link error. Error codes like
"LNK2019" are specific to your compiler (and possibly even just that
version of the compiler), and we have no way to know what it means, or
to what functions or files it is referring.

-Howard


Here is the linker error:
AutomatonViewer error LNK2019: unresolved external symbol "public: void
__thiscall CSimulator::StartSimulation(class ATL::CStringT<char,class
StrTraitMFC_DLL<char,class ATL::ChTraitsCRT<char> > > &,class
ATL::CStringT<char,class StrTraitMFC_DLL<char,class
ATL::ChTraitsCRT<char> > > &)"
(?StartSimulation@CSimulator@@QAEXAAV?$CStringT@DV ?$StrTraitMFC_DLL@DV?$ChTraitsCRT@D@ATL@@@@@ATL@@0 @Z)
referenced in function "public: void __thiscall
CAutomatonViewerDoc::OnSimulationRun(void)"
(?OnSimulationRun@CAutomatonViewerDoc@@QAEXXZ)
Here is the function declaration from the header for class CSimulator:
void StartSimulation(CString& cstrPathInit, CString& cstrPathArchive);

And from the cpp file:
void CSimulator::StartSimulation(CString& cstrPathInit, CString&
cstrPathArchive)
{

}

The call:
void CAutomatonViewerDoc::OnSimulationRun()
{
m_simulator.StartSimulation(m_cstrPathInitFile, m_cstrPathArchive);
}

One posssible explaination, check that the StartSimulation function is
declared in the public part of the CSimulator class.


Declaring that as private or protected wouldn't result in a linker error.
It would result in a compile error.

A better place to ask might be an MFC newsgroup. It's some project setup
issue, not anything related to the C++ code itself. There's certainly
nothing in that code that will tell us for sure what the problem is.
(Perhaps something related to linking with that ATL namespace?)

-Howard

Nov 29 '05 #6
>>
One posssible explaination, check that the StartSimulation function is
declared in the public part of the CSimulator class.

Declaring that as private or protected wouldn't result in a linker error.
It would result in a compile error.


Not if CAutomatonViewerDoc was declared a friend of CSimulator. It was
the best I could think of.

john
Nov 29 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Vishal Saxena | last post by:
Hi, I am new to this news group, hope to get prompt solution from you, gurus of VC. Well i had a project developed in VC++ 6.0, it uses Adobe Plugin Development SDK, I am trying to upgrade my...
3
by: YAN KANG / SU | last post by:
Hi, All I am migrating to Studio .NET 2003 from Studio 6.0 and Studio .NET 2002. When I compiled my code, which is compilable both in VC++ 6.0 and Studio .NET 2002, I have an error LNK2019 as the...
4
by: Jun | last post by:
anyone know how this error shows? how can i solve this? LINK : error LNK2020: unresolved token (0A0000EA) _AtlBaseModule LINK : error LNK2020: unresolved token (0A0000EC) atlTraceGeneral LINK :...
2
by: hazizpour | last post by:
Hello I hope I am in the correct newsgroup, if not please let me know. I am trying to build a sample for using a certain library ( IFC mapping to C++ classes, see www.cstb.fr) with MS Visual...
0
by: Usman | last post by:
Hi I've a COM compiled in visual studio 6 that is internally using zlib library (an opensource library for compression). I've no problem compiling that code. But when I moved to visual...
1
by: developer | last post by:
Hi All I have made a .NET project. the files included are borland c++ files that i am migrate to VC++ .NET I am using Microsoft Visual C++ .NET 2003. the compilation goes through properly,...
2
by: f rom | last post by:
----- Forwarded Message ---- From: Josiah Carlson <jcarlson@uci.edu> To: f rom <etaoinbe@yahoo.com>; wxpython-users@lists.wxwidgets.org Sent: Monday, December 4, 2006 10:03:28 PM Subject: Re: ...
1
by: girays | last post by:
I have a template class which name is EntityRepository and when I compile this class I get no error. But when I use this class in a main method I get LNK2019 linking error. std::map object is used...
4
by: jk2l | last post by:
Error 10 error LNK2019: unresolved external symbol __imp__glBindTexture@8 referenced in function "public: void __thiscall GLTexture::Use(void)" (?Use@GLTexture@@QAEXXZ) GLTexture.obj Error 11 error...
1
by: Jonas Schneider | last post by:
Heya, donīt know if you know BOINC: itīs a system for distributed computing, therefore distributing work to many computers and creating a little super-computer, see also their homepage:...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.