I have a routine in my MainWindow, and I declared public this routine:
In MainWindow.cpp
void MainWindow::Read_Ambiente()
{
}
void MainWindow::Read_Ambiente()
{
}
To copy to clipboard, switch view to plain text mode
In MainWindow.h
public:
void Read_Ambiente();
public:
void Read_Ambiente();
To copy to clipboard, switch view to plain text mode
In another form I want to use this routine:
In Diagnostica.cpp
#include "mainwindow.h"
extern void Read_Ambiente();
#include "mainwindow.h"
extern void Read_Ambiente();
To copy to clipboard, switch view to plain text mode
If I don't use this routine "Read_Ambiente" in the second form, there are no errors.
When I use the routine, I have this error from the linker:
diagnostica.obj:-1: error: LNK2019: unresolved external symbol "void __cdecl Read_Ambiente(void)" (?Read_Ambiente@@YAXXZ) referenced in function "private: virtual bool __thiscall Diagnostica::eventFilter(class QObject *,class QEvent *)" (?eventFilter@Diagnostica@@EAE_NPAVQObject@@PAVQEv ent@@@Z)
Bookmarks