CodeLite on Kubuntu 20.04 VM

General questions regarding the usage of CodeLite
Netzschleicher
CodeLite Enthusiast
Posts: 33
Joined: Fri Aug 13, 2010 10:45 pm
Genuine User: Yes
IDE Question: C++
Contact:

CodeLite on Kubuntu 20.04 VM

Post by Netzschleicher »

Hello together,

i set up a new VM with KUbuntu 20.04 LTS.
wxWidgets are kompiled with following Script:

Code: Select all

#!/bin/bash
cd /usr/share/wxWidgets-3.1.5/
mkdir gtk-build
cd gtk-build
../configure --enable-debug --disable-shared --enable-mediactrl --with-opengl
make install
ldconfig
make clean
../configure --disable-debug --disable-shared --enable-mediactrl --with-opengl
make install
ldconfig
make clean
../configure --enable-debug --enable-shared --enable-mediactrl --with-opengl
make install
ldconfig
make clean
../configure --disable-debug --enable-shared --enable-mediactrl --with-opengl
make install
ldconfig
make clean
cd ..
rm -rf gtk-build
cd /home/uwe

Now, when i compile an Application i Points to /usr/lib/x86_64-linux-gnu/wx but it should point to /usr/local/lib/wx !
Is there an Environment-Variable like 'WXCFG' to use?

Thanks very much
Netzschleicher

User avatar
eranif
CodeLite Plugin
Posts: 6367
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: CodeLite on Kubuntu 20.04 VM

Post by eranif »

On Linux, wxWidgets uses the wx-config script.
If you get the wrong paths, it means that the wrong wx-config tool was used.

If I had to guess, I would say that you have 2 wx-config (at least) installed

  • /usr/bin/wx-config
  • /usr/local/bin/wx-config

Local builds will install under /usr/local/

What is the output of /usr/local/bin/wx-config --libs ? does it produce the output you want?
If it does, than its just a matter of setting up your PATH environment variable in your ~/.bashrc (assuming you are using bash) to include:

Code: Select all

export PATH=/usr/local/bin:$PATH

If you are build from within CodeLite, than you have 2 options:

  • In the project settings, modify the $(shell wx-config --libs) and $(shell wx-config --cflags) (from the project settings -> compiler and project settings -> linker) to use full path (i.e. use /usr/local/bin/wx-config)
  • Go to settings -> environment variables and add this line: PATH=/usr/local/bin:$PATH

HTH
Eran

Make sure you have read the HOW TO POST thread
Netzschleicher
CodeLite Enthusiast
Posts: 33
Joined: Fri Aug 13, 2010 10:45 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: CodeLite on Kubuntu 20.04 VM

Post by Netzschleicher »

Code: Select all

wx-config --libs

shows me the right libs.

But setting PATH=/usr/local/bin:$PATH in Bash and/or in CodeLite Environment changes nothing.
CodeLite says

/bin/make -e -f Makefile
----------Building project:[ SystemInfo - GTK-Debug ]----------
make[1]: Entering directory '/home/uwe/Dokumente/SystemInfo/SystemInfo'

Code: Select all

      Warning: No config found to match: /bin/wx-config --libs --unicode=yes --static=yes
               in /usr/lib/x86_64-linux-gnu/wx/config
      If you require this configuration, please install the desired
      library build.  If this is part of an automated configuration
      test and no other errors occur, you may safely ignore it.
      You may use wx-config --list to see all configs available in
      the default prefix.

      Warning: No config found to match: /bin/wx-config --cxxflags --unicode=yes --static=yes
               in /usr/lib/x86_64-linux-gnu/wx/config
      If you require this configuration, please install the desired
      library build.  If this is part of an automated configuration
      test and no other errors occur, you may safely ignore it.
      You may use wx-config --list to see all configs available in
      the default prefix.

      Warning: No config found to match: /bin/wx-config --cxxflags --unicode=yes --static=yes
               in /usr/lib/x86_64-linux-gnu/wx/config
      If you require this configuration, please install the desired
      library build.  If this is part of an automated configuration
      test and no other errors occur, you may safely ignore it.
      You may use wx-config --list to see all configs available in
      the default prefix.

/bin/x86_64-linux-gnu-g++ -c "/home/uwe/Dokumente/SystemInfo/SystemInfo/main.cpp" -g -O0 -Wall -o ../build-GTK-Debug/SystemInfo/main.cpp.o -I.
/home/uwe/Dokumente/SystemInfo/SystemInfo/main.cpp:22:10: fatal error: wx/wx.h: No such file or directory
22 | #include <wx/wx.h>
| ~~~~~
compilation terminated.
make[1]: *** [SystemInfo.mk:96: ../build-GTK-Debug/SystemInfo/main.cpp.o] Error 1
make[1]: Leaving directory '/home/uwe/Dokumente/SystemInfo/SystemInfo'
make: *** [Makefile:5: All] Error 2
====1 errors, 0 warnings====

Netzschleicher
CodeLite Enthusiast
Posts: 33
Joined: Fri Aug 13, 2010 10:45 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: CodeLite on Kubuntu 20.04 VM

Post by Netzschleicher »

some hint: 'wx-config --libs' on bash uwe@vm-linux-prog:~$ gives:

Code: Select all

-L/usr/local/lib -pthread   -lwx_gtk3u_xrc-3.1 -lwx_gtk3u_html-3.1 -lwx_gtk3u_qa-3.1 -lwx_gtk3u_core-3.1 -lwx_baseu_xml-3.1 -lwx_baseu_net-3.1 -lwx_baseu-3.1

but in CodeLite it refers to /usr/bin

Netzschleicher
CodeLite Enthusiast
Posts: 33
Joined: Fri Aug 13, 2010 10:45 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: CodeLite on Kubuntu 20.04 VM

Post by Netzschleicher »

When i compile with CMake as Build System, all good. It compiles without errors.
But with CodeLite Makefile Generator it cannot find my compiled wxWidgets.

DavidGH
CodeLite Plugin
Posts: 819
Joined: Wed Sep 03, 2008 7:26 pm
Contact:

Re: CodeLite on Kubuntu 20.04 VM

Post by DavidGH »

Hi,

Warning: No config found to match: /bin/wx-config --libs --unicode=yes --static=yes
in /usr/lib/x86_64-linux-gnu/wx/config

You have a normal, dynamic-linking wx build, not a static-linking one (which is rarely used/needed on Linux). However, somewhere in your workspace configuration (probably the Linker section) you have added --disable-shared or similar. Remove that, do a clean build and it should work.

Regards,

David

Netzschleicher
CodeLite Enthusiast
Posts: 33
Joined: Fri Aug 13, 2010 10:45 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: CodeLite on Kubuntu 20.04 VM

Post by Netzschleicher »

You are right. I have a static an a dynamic build to switch between them. When compiling with CMake all work find and i can compile a dynamic and also a static Application.
With Codelite makefile Generator no of them compiles.
Also the Codelite makefile Generator uses /bin/wx-config which refers to System preinstalled wx3.0.
CMake refers to /usr/local/bin/wx-config which is my compiled wx3.1.

DavidGH
CodeLite Plugin
Posts: 819
Joined: Wed Sep 03, 2008 7:26 pm
Contact:

Re: CodeLite on Kubuntu 20.04 VM

Post by DavidGH »

Also the Codelite makefile Generator uses /bin/wx-config which refers to System preinstalled wx3.0.

Then you need to tell it not to. The easiest way is to use the full path in the Compiler and Linker settings:

Code: Select all

-g;-O0;-Wall;$(shell /usr/local/bin/wx-config --cflags)
and
$(shell /usr/local/bin/wx-config --libs)
Netzschleicher
CodeLite Enthusiast
Posts: 33
Joined: Fri Aug 13, 2010 10:45 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: CodeLite on Kubuntu 20.04 VM

Post by Netzschleicher »

Thank s a lot for the Tipps.

I setup my Projects with CMake and all works fine on Linux and Windows.

Post Reply