"Undefined reference to"
-
Hi !!
I got a problem on one of my code :)
I use this line :m_module.insert(std::pair<QString, AbstractGUIModule*>("Source Video", new VideoModule(DLTCommSetup::DEFAULT_DLT_ADDRESS_GND, QString().number(DLTCommSetup::DEFAULT_RTSP_PORT), DLTCommSetup::DEFAULT_RTSP_MEDIA, VERBOSE8MODULES, parent())));
I got the error : "Undefined reference to 'DLTCommSetup::DEFAULT_DLT_ADDRESS_GND' "
in my header DLTCommSetup :
static constexpr char DEFAULT_ADDRESS_GND[13]="192.168.x.xx"
So it is well defined here, if needed here is my VideoModule constructor :
VideoModule::VideoModule(QString ip, QString port, QString media, bool verbose, QObject* interface_qml) : AbstractGUIModule("Source Video", verbose, interface_qml), m_video_state(VideoState::OFF), m_current_mode(Mode::GROUND), m_video_packet_flag(false), m_media_player("VideoPlayer")
I dont understand where the "undefined reference" comes from :/
Thanks for help :D -
Hi
Make sure you don't have cyclic includes.
That can also give undefined errors. -
Hi,
Did you declare
DEFAULT_ADDRESS_GND
as part of your class or is it floating in the header file ? -
I got the error : "Undefined reference to 'DLTCommSetup::DEFAULT_DLT_ADDRESS_GND' "
static constexpr char DEFAULT_ADDRESS_GND[13]="192.168.x.xx"
Maybe it's just me not understanding, but how is
DEFAULT_ADDRESS_GND
"So it is well defined here" supposed to relate to/help/avoid the undefined reference onDLTCommSetup::DEFAULT_DLT_ADDRESS_GND
? -
Well that's the point ^^
I change it thank you... but still the same error (I made a copy/paste sooo we're sure it is the same name now). But the problem still here with the same error message :/ (I cleaned up the project and ran qmake before builded it again