0

Hello I have installed wxWidget-3.1.0 s on windows it works fine using it from MSVC++. But On Linux fedora 27 I built it in a sub-directory "wxWidget3.1.0/build-gtk-unicode-release".

These are the comands:

../configure --disable-debug
make
sudo make install
sudo ldconfig

Above it generates for me a release shared library I get around building programs upon it. So I easily use "wx-config --cxxflags --libs". For Ides like Eclipse, Codeblocks, Kdevelop.

The problem is I need some "static version" of the library so I created another sub-directory: "wxWidgets-3.1.0/build-gtk-static-release-unicode" So I issued the commands:

../configure --disable-debug --disable-shared --enable-unicode
make
sudo make install
  • I created a project with Codeblocks and it compiles easily with adding only "wx-config --cxxflags --libs"

  • When it comes to Eclipse CDT I used wx-config --cxxflags for the compiler and wx-config --libs for the linker. But it fails complaining about "Unreferenced defeinition of the APIs".

  • After a long search I Find a tricky workaround:

    Project->Properties->C/C++->GCC C++ Linker->Experts settings:
    
    ${COMMAND} ${FLAGS} ${OUTPUT_FLAG} ${OUTPUT_PREFIX}${OUTPUT} ${INPUTS}
    

So I made the "Flags" at the end to become:

    ${COMMAND} ${OUTPUT_FLAG} ${OUTPUT_PREFIX}${OUTPUT} ${INPUTS} ${FLAGS}

And it works fine.

*** The problem:

I'd like to configure Kdevelop for wxWidgets as a static library keep in mind as a dynamic library I managed to do that. So My Configurations are:

From Kdevelop->Project->Open Configuration->CMake File->CXX_COMPILER_FLAGS I enters:

The result of wx-config --cxxflags in a terminal.

And for the linker:

    CXX_LNKER_FLAGS:

The reult of wx-config --libs

But The code compiles but doesn't build I don't have "expert settings" as in Eclipse CDT.

Can anyone solve how to link to wxWidgets from Kdevelop statically?

Thank you for this boring long story. NB: I Added What problems I faced and what did to get around them to help people who face the same problems. Thank you in advance.

Maestro
  • 2,512
  • 9
  • 24
  • Kdevelop just wraps cmake these days, so your best bet is to see what cmake is doing. Go to your build directory and run `make VERBOSE=1` or `ninja -v` (depending on how your project was configured). – Stephen Newell Apr 14 '18 at 00:17
  • @StephenNewell: I see in the Kdevelop "Verbose=1" by default. – Maestro Apr 14 '18 at 00:23
  • @Maestro, out of curiosity why do you need KDevelop, if you have a working configuration for C::B and Eclipse? People usually have only one IDE they are working with. Also, it is very unusual to set up static linking in *mix world. Why do you need it? – Igor Apr 16 '18 at 16:20
  • @Igor: Thank you! I'll stick to eclipse and codeblocks. And I rebuild my `dynamic` version of the library. – Maestro Apr 17 '18 at 23:50

0 Answers0