Author Topic: problems with wxWidgets app in C::B.  (Read 427 times)

Offline alys666

  • Multiple posting newcomer
  • *
  • Posts: 11
problems with wxWidgets app in C::B.
« on: June 17, 2017, 05:59:48 pm »
I took fresh sources of wxWidgets (3.0.3) and has it built, as they recommend it. everything if fine, their examples work..etc.
also i made "make install". and installed this lib to usr/local/.
then i tried to attach this version of wxWidgets to my wxWidgets based old code(kinda editor).

i created new project in C::B as console application, and added my files there, deleted generated 'main' file, and took my old.
i added `wx-config --cxxflags' as compiler's 'another options'. and started the build. and got a lot of errors.

and reason of it is the fact, that C::B gets strange command string from this  `wx-config --cxxflags'.
it somehow calls wx-config of wxWidgets 2.8, which i also have on my computer.

***
g++ -Wall -fexceptions -g -v -I/usr/lib/x86_64-linux-gnu/wx/include/base-unicode-release-2.8 -I/usr/include/wx-2.8 -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES -DwxUSE_GUI=0 -pthread -Wnon-virtual-dtor -Wshadow -Winit-self -Wredundant-decls -Wcast-align -Wundef -Wfloat-equal -Winline -Wmissing-declarations -Wmissing-include-dirs -Wextra -std=c++11 -m64 -I/usr/local/include/wx-3.0 -I/usr/local/lib/wx/include/gtk2-unicode-3.0 -c /home/alys/HOBBY/CodeEditor/Editor1/ed_common.cpp -o obj/Debug/Editor1/ed_common.o
***

but if i invoke `wx-config --cxxflags' from command line - it says -
-I/usr/local/lib/wx/include/gtk2-unicode-3.0 -I/usr/local/include/wx-3.0 -D_FILE_OFFSET_BITS=64 -DWXUSINGDLL -D__WXGTK__ -pthread

in command line "wx-config --version" says - 3.0.3.

so the problem: from command line wx-config shows wxWidgets version - 3.0.3, but if it is invoked by C::B to make compiler call - it has version 2.8 and include dirs are wrong.

system  - Ubuntu 14.04, C::B 16.01.

Thanks.
Ubuntu 14.04, CodeBlocks 16.01

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 10118
Re: problems with wxWidgets app in C::B.
« Reply #1 on: June 17, 2017, 06:08:47 pm »
What is the value of the PATH variable. It seems that C::B sees a value that is different to the one seen in your shell.
What happens if you start C::B from the same shell where wx-version returns what you've expected?
<debugger plugin maintainer>
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline alys666

  • Multiple posting newcomer
  • *
  • Posts: 11
Re: problems with wxWidgets app in C::B.
« Reply #2 on: June 17, 2017, 06:35:35 pm »
echo $PATH
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games
Ubuntu 14.04, CodeBlocks 16.01

Offline alys666

  • Multiple posting newcomer
  • *
  • Posts: 11
Re: problems with wxWidgets app in C::B.
« Reply #3 on: June 17, 2017, 06:40:22 pm »
yeees! it works. if i started Codeblocks from terminal - things are good!

before - started, as usual, from icon of Unity launcher.
Ubuntu 14.04, CodeBlocks 16.01

Offline alys666

  • Multiple posting newcomer
  • *
  • Posts: 11
Re: problems with wxWidgets app in C::B.
« Reply #4 on: June 17, 2017, 11:23:08 pm »
interesting that after C::B invocation from console, start from Unity launcher bar begins to work normally also. :)
Ubuntu 14.04, CodeBlocks 16.01

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 10118
Re: problems with wxWidgets app in C::B.
« Reply #5 on: June 18, 2017, 12:48:18 pm »
Have you changed the PATH variable after you've started codeblocks?
<debugger plugin maintainer>
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline alys666

  • Multiple posting newcomer
  • *
  • Posts: 11
Re: problems with wxWidgets app in C::B.
« Reply #6 on: June 18, 2017, 01:53:53 pm »
No, i changed nothing. i just started C::B from command line(as You adviced)... and later i tried to start from launcher, and then it worked from launcher too. Now i checked start from launcher again, and rebuild works fine.
Ubuntu 14.04, CodeBlocks 16.01