473,386 Members | 1,606 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,386 software developers and data experts.

Problems with LNK2019

Im having several problems with the error LNK2019.

I ve a class that derives from another:
//controller.h

#include MessagesNotifier_Client

class Controller : public MessagesNotifier_Client
{
public:

Controller();
~Controller();

void TempVerification(int a, int b);
};
//controller.cpp

Controller::Controller(){}
Controller::~Controller(){}

void TempVerification(int a, int b)
{
if ( abs(a - b) 23 ){
NotifyWarningMessage("warning");

}

NotifyWarningMessage is a method defined in MessagesNotifier_Client.
Im using Visual Studio .net 2003. and I have a Solution with 2
projects. The controller class is in
the project A, and the MessagesNotifier_Client in project B:

===Solution "BigTest" (2 projects)
== - A
|
------ Controller.h
------ Controller.cpp
== - B
|
------ MessagesNotifier_Client.cpp
------ MessagesNotifier_Client.h

Any ideas where is the problem, or how I should configure VisualStudio?
Thanks for your support.

Aug 8 '06 #1
7 1633

solarin wrote:
Im having several problems with the error LNK2019.

I ve a class that derives from another:
//controller.h

#include MessagesNotifier_Client

class Controller : public MessagesNotifier_Client
{
public:

Controller();
~Controller();

void TempVerification(int a, int b);
};
//controller.cpp

Controller::Controller(){}
Controller::~Controller(){}

void TempVerification(int a, int b)
{
if ( abs(a - b) 23 ){
NotifyWarningMessage("warning");

}

NotifyWarningMessage is a method defined in MessagesNotifier_Client.
Im using Visual Studio .net 2003. and I have a Solution with 2
projects. The controller class is in
the project A, and the MessagesNotifier_Client in project B:

===Solution "BigTest" (2 projects)
== - A
|
------ Controller.h
------ Controller.cpp
== - B
|
------ MessagesNotifier_Client.cpp
------ MessagesNotifier_Client.h

Any ideas where is the problem, or how I should configure VisualStudio?
Thanks for your support.

The line where LNK2019 apears is where NotifyWarningMessage method is
called.

Aug 8 '06 #2
In article <11**********************@i42g2000cwa.googlegroups .com>,
en********@gmail.com says...

[ ... ]
class Controller : public MessagesNotifier_Client
[ ... ]
void TempVerification(int a, int b);
Here you've declared a class member function.
//controller.cpp
[ ... ]
void TempVerification(int a, int b) {
But here you're defining a free function. You almost certainly want this
to be something like:

void Controller::TempVerification(int a, int) {
// ...

--
Later,
Jerry.

The universe is a figment of its own imagination.
Aug 8 '06 #3

Jerry Coffin ha escrito:
You almost certainly want this
to be something like:

void Controller::TempVerification(int a, int) {
// ...
sorry , it was my mistake. The method is implemented as you mentioned:

void Controller::TempVerification(int a, int b)
{
if ( abs(a - b) 23 ){
NotifyWarningMessage("warning"); // LNK2019 error here

}

The error is when i'm calling the method NotifyWarningMessage.

Thanks.

Aug 8 '06 #4
solarin wrote:
Im having several problems with the error LNK2019.
What's one of those? Show the error message, 'LNK2019' means nothing to
someone who doesn't use your tools.
I ve a class that derives from another:

//controller.h

#include MessagesNotifier_Client

class Controller : public MessagesNotifier_Client
{
public:

Controller();
~Controller();

void TempVerification(int a, int b);
};
//controller.cpp

Controller::Controller(){}
Controller::~Controller(){}

void TempVerification(int a, int b)
{
if ( abs(a - b) 23 ){
NotifyWarningMessage("warning");

}

NotifyWarningMessage is a method defined in MessagesNotifier_Client.
You probably haven't linked the two compilation units to form your
executable.

--
Ian Collins.
Aug 8 '06 #5

Ian Collins wrote:
What's one of those? Show the error message, 'LNK2019' means nothing to
someone who doesn't use your tools.
Controller.obj : error LNK2019: símbolo externo "public: void
__thiscall MessagesNotifier_Client::NotifyWarningMessage(char const *)"
(?NotifyWarningMessage@MessagesNotifier_Client@@QA EXPBD@Z) sin resolver
al que se hace referencia en la función "public: void __thiscall
Controller::TempVerification(int,int)"
(?ComprobarPresion@BometController@@QAEXMM@Z)
...\..\..\..\..\Bin\Win32\VC7\Release/GMETEO-GestorMeteorologico.exe :
fatal error LNK1120: 1 externos sin resolver

simbolo externo = External Symbol
sin resolver al que se hace referencia en la funcion = not resolved to
that one refers in the function

externos sin resolver = external not resolved

Aug 8 '06 #6
solarin wrote:
Ian Collins wrote:

>>What's one of those? Show the error message, 'LNK2019' means nothing to
someone who doesn't use your tools.


Controller.obj : error LNK2019: símbolo externo "public: void
__thiscall MessagesNotifier_Client::NotifyWarningMessage(char const *)"
(?NotifyWarningMessage@MessagesNotifier_Client@@QA EXPBD@Z) sin resolver
al que se hace referencia en la función "public: void __thiscall
Controller::TempVerification(int,int)"
(?ComprobarPresion@BometController@@QAEXMM@Z)
..\..\..\..\..\Bin\Win32\VC7\Release/GMETEO-GestorMeteorologico.exe :
fatal error LNK1120: 1 externos sin resolver

simbolo externo = External Symbol
sin resolver al que se hace referencia en la funcion = not resolved to
that one refers in the function

externos sin resolver = external not resolved
Sure looks like you haven't linked the two cpp files you mentioned to
form your executable.

How you do this is off topic here, you'll get more help on a windows
programming group.

--
Ian Collins.
Aug 8 '06 #7
RKS

solarin wrote:
Im having several problems with the error LNK2019.

I ve a class that derives from another:
//controller.h

#include MessagesNotifier_Client

class Controller : public MessagesNotifier_Client
{
public:

Controller();
~Controller();

void TempVerification(int a, int b);
};
//controller.cpp

Controller::Controller(){}
Controller::~Controller(){}

void TempVerification(int a, int b)
{
if ( abs(a - b) 23 ){
NotifyWarningMessage("warning");

}

NotifyWarningMessage is a method defined in MessagesNotifier_Client.
Im using Visual Studio .net 2003. and I have a Solution with 2
projects. The controller class is in
the project A, and the MessagesNotifier_Client in project B:

===Solution "BigTest" (2 projects)
== - A
|
------ Controller.h
------ Controller.cpp
== - B
|
------ MessagesNotifier_Client.cpp
------ MessagesNotifier_Client.h

Any ideas where is the problem, or how I should configure VisualStudio?
Thanks for your support.
Assuming Lnk2019 is a linker error for missing functions, I suggest try
adding your project A (where your functions is declared) as a reference
to project B( where you are using the function).

Aug 9 '06 #8

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

Similar topics

2
by: bobnotbob | last post by:
I have created an application and am trying to call functions from a previously existing dll. I can call some functions fine, but I get a link error an when I try to call any function that takes...
1
by: Oliver White | last post by:
Hi folks, I'm having trouble building a new COM project I created in VC7. The following linking errors occur: nafxcw.lib(thrdcore.obj) : error LNK2019: unresolved external symbol...
6
by: Uli | last post by:
Hello, I'm trying to use a DLL (by static linking) which was compiled with Borland C++Builder (BCB) in Visual C++ (Visual-Studio 2003). All functions are declared with the directive 'extern...
2
by: rangalo | last post by:
Hi All, I have succeeded in compiling a massive project, originally from vc6 to VS .Net 2005. Now, while linking I am having loads of linker errors with the above code. LNK20019 and LNK2001....
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...
8
by: mickey22 | last post by:
Hi all, I am trying to compile a VC++ project and it is win32 console application.When I try to compile it I get a lot of linking problems.I have included all the header files needed for the...
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...
2
by: huzzaa | last post by:
1>Employee main.obj : error LNK2019: unresolved external symbol "public: void __thiscall Employee::nameDisplay(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char>...
1
by: eraserwars | last post by:
I have been googeling every possible solution, but I cannot seem to fix LNK2019. My code is below, but I just cannot understand how anything related to LNK2019 from Microsoft's help center applies...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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,...

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.