By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
439,971 Members | 1,451 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 439,971 IT Pros & Developers. It's quick & easy.

Problems with LNK2019

P: n/a
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
Share this Question
Share on Google+
7 Replies


P: n/a

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

P: n/a
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

P: n/a

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

P: n/a
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

P: n/a

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

P: n/a
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

P: n/a
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 discussion thread is closed

Replies have been disabled for this discussion.