Undefined reference
I am getting an error when I try to use the method in this header file:
|
undefined reference to 'SuiteVersions::bProductionBuild()'
|
I included the header and here is how it's defined in that header:
|
extern bool bProductionBuild();
|
and in the c file:
1 2 3 4 5
|
bool bProductionBuild()
{
using namespace CTStringOps;
return startsWith(clGetCVSTag(), _T("tags/"));
}
|
perhaps there is something about 'extern' keyword that I don't understand? Here is how I am trying to refer to it:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
|
#include "GuiSettingsPresenter.h"
#include "Core/PluginInterfaces/SettingsPluginInterface.h"
#include <QtCore/QSettings>
#include <SuiteVersions.h>
namespace BlackWall
{
namespace Ui
{
GuiSettingsPresenter::GuiSettingsPresenter(Core::SettingsPluginInterface* _model)
: m_model(_model)
,m_productionBuild(false)
{
}
bool GuiSettingsPresenter::productionBuild() const
{
return SuiteVersions::bProductionBuild() ? m_productionBuild : !m_productionBuild;
}
}
}
|
The error is on line 18.
Last edited on
I am getting an error when I try to use the method in this header file: |
So what is SuiteVersions referring to?
Why are you using a C file? That function appears to be a C++ function, not a C function.
perhaps there is something about 'extern' keyword that I don't understand? |
Probably, what do you think the extern qualifier is going to accomplish?
Please post the complete header, and the complete implementation file for that function.
Last edited on
"undefined reference" indicates a linker error.
How exactly are you compiling your project?
@dutch Yes that's exactly what it was. I needed to include the lib in the .pro. This has been resolved, thanks guys.
Topic archived. No new replies allowed.