1

I have a Qt C++ application that includes a third-party library (along with its .h header file). However, when I set QMAKE_CCFLAGS += -std=c++11 and CONFIG += c++11, I get undefined reference for function calls to this third-party library.

It compiles without c++11 flags.

Is there a way to resolve this?

This is qmake specific when using c++11 flags in the qmake configuration. The DLL file is linked with qmake LIBS and is compiling without the c++11 qmake configuration flag.

Once I set:

QMAKE_CXXFLAGS += -std=c++11
CONFIG += c++11

compiling gives me unresolved symbol errors.

Marc.2377
  • 7,807
  • 7
  • 51
  • 95
edin-m
  • 3,021
  • 3
  • 17
  • 27
  • possible duplicate of [What is an undefined reference/unresolved external symbol error and how do I fix it?](http://stackoverflow.com/questions/12573816/what-is-an-undefined-reference-unresolved-external-symbol-error-and-how-do-i-fix) – AndyG Jun 10 '15 at 21:23
  • I believe it is not because this is happening when I link third party DLL with header files with C api functions (wrapped in extern C) using qmake, mingw, qt framework **only** with c++11 flags ON. Without them works just fine. – edin-m Jun 10 '15 at 22:09

1 Answers1

0

Tried the solution for this answer and it resulted in a successful compilation.

It works when I add

QMAKE_CXXFLAGS += -std=gnu++11

Qt 5.4.1 MinGW 4.9.1 32bit

Community
  • 1
  • 1
edin-m
  • 3,021
  • 3
  • 17
  • 27