Lion King
Lion King

Reputation: 33813

Is it possible to setup the wxWidgets library in Qt creator IDE?

Is it possible to setup the wxWidgets library in Qt Creator? And what are the steps to do that? I know the steps in Visual Studio, but Qt creator no, because it is no easy.

I have tried to write the following in .pro file.

INCLUDEPATH += "C:/wxWidgets302/include"
INCLUDEPATH += "C:/wxWidgets302/lib/gcc_lib/mswu"
LIBS += -L"C:/wxWidgets302/lib/gcc_lib" -lwxbase30u -lwxmsw30u_core -lwxpng -lwxzlib -lwxregexu -lwxexpat

but still does not linked, and the following errors appeared.

  1. undefined reference to IID_IShellLinkW
  2. undefined reference to _imp__CoCreateInstance@20
  3. undefined reference to IID_IPersistFile
  4. undefined reference to _imp__OleUninitialize@0
  5. undefined reference to _imp__OleUninitialize@0
  6. C:/wxWidgets302/lib/gcc_lib\libwxbase30u.a(baselib_filename.o): bad reloc address 0xa in section .text$_ZN8wxString4LastEv[__ZN8wxString4LastEv]
  7. error: ld returned 1 exit status

I'm using qtcreator v3.1.2 + mingw v4.8.2 32Bit + wxWidgets v3.0.2.

Upvotes: 0

Views: 2290

Answers (1)

Piwaldo
Piwaldo

Reputation: 21

Using the following code in your pro file:

wxCXXFLAGS = $$system(wx-config --cxxflags --unicode=yes --debug=no)
wxLinkOptions = $$system(wx-config --debug=no --libs --unicode=yes)
LIBS += $$wxLinkOptions
QMAKE_CXXFLAGS_RELEASE += $$wxCXXFLAGS
QMAKE_CXXFLAGS_DEBUG += $$wxCXXFLAGS

Upvotes: 1

Related Questions