Author Topic: Bootstrap with no wxWidgets packet installed  (Read 19949 times)

Offline BlueHazzard

  • Developer
  • Lives here!
  • *****
  • Posts: 3353
Bootstrap with no wxWidgets packet installed
« on: February 20, 2018, 05:16:45 pm »
Hi,
i try to build codeblocks on linux, without wxWidgets installed, but compiled and installed by myself.

If i run ./bootstrap it can not find the wx-config macro:
Code
configure.ac:141: error: possibly undefined macro: AM_OPTIONS_WXCONFIG
      If this token and others are legitimate, please use m4_pattern_allow.
      See the Autoconf documentation.
Now this seems ok, because i can provide the wx-config path by myself (it is /usr/local/bin/wx-config) but the ./configure command has no option --witch-wx-config and fails because it can not find the AM_CONFIG thing

Code
./configure: line 21384: AM_OPTIONS_WXCONFIG: command not found
./configure: line 21385: syntax error near unexpected token `2.8.12,'
./configure: line 21385: `AM_PATH_WXCONFIG(2.8.12, wxWin=1)'

Is there a easy solution beside installing wxWidgets from repo?

Online stahta01

  • Lives here!
  • ****
  • Posts: 7591
    • My Best Post
Re: Bootstrap with no wxWidgets packet installed
« Reply #1 on: February 20, 2018, 05:19:38 pm »
Are you using an Debian based Linux; because it has an easy fix? I posted it somewhere in the Wiki an way to use alternates with self built wxWidgets.

Edit: Added wiki link http://wiki.codeblocks.org/index.php/Installing_Code::Blocks_from_source_on_Linux#Checking_the_presence_of_libwxGTK_library

Tim S.
« Last Edit: February 20, 2018, 05:21:36 pm by stahta01 »
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline BlueHazzard

  • Developer
  • Lives here!
  • *****
  • Posts: 3353
Re: Bootstrap with no wxWidgets packet installed
« Reply #2 on: February 20, 2018, 05:29:13 pm »
thank you!
i also found this article in the mean time and i have tried this:
Code
export ACLOCAL_FLAGS="-I `wx-config --prefix`/share/aclocal"
with this i was able to go trought bootstrap and it is now compiling. But i would like to know what this does....

Code
$ update-alternatives --install /usr/bin/wx-config wx-config /opt/wx/2.8/bin/wx-config 50
can you explain what this does? Am i asked every time i run wx-config what version i would like to run? How does this go with autotools, or other tools that do not allow user interaction?

Online stahta01

  • Lives here!
  • ****
  • Posts: 7591
    • My Best Post
Re: Bootstrap with no wxWidgets packet installed
« Reply #3 on: February 20, 2018, 05:47:18 pm »
update-alternatives is used to switch an link to various real files.

I believe update-alternatives is an Debian only command.

Tim S.
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: Bootstrap with no wxWidgets packet installed
« Reply #4 on: February 20, 2018, 07:39:19 pm »
I believe update-alternatives is an Debian only command.
No, it isn't.
It's copyrighted by Redhat in 2001 or 2002.

Online stahta01

  • Lives here!
  • ****
  • Posts: 7591
    • My Best Post
Re: Bootstrap with no wxWidgets packet installed
« Reply #5 on: February 20, 2018, 07:45:32 pm »
I believe update-alternatives is an Debian only command.
No, it isn't.
It's copyrighted by Redhat in 2001 or 2002.

So, at least Redhat and Debian Linux Distros should have it.

Tim S.
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Bootstrap with no wxWidgets packet installed
« Reply #6 on: February 20, 2018, 08:14:12 pm »
There is an issue about this on the tickets page. The proposed solution there is to copy the file in out m4 folder.
(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 ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5916
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: Bootstrap with no wxWidgets packet installed
« Reply #7 on: August 08, 2018, 04:26:07 am »
OK, I think I hit the same issue here.
I'm on a ubuntu 14.04, I build wx3.1.1 library myself, with such command:
Code
sudo apt-get install libgtk-3-dev
cd wxWidgets-3.1.1/
mkdir gtk-build
cd gtk-build
../configure --enable-unicode --prefix=/home/zyh/code/wx3install/ --enable-monolithic
Then,
Code
make
make install
I can build a simple wx program like:
Code
zyh@zyh:~/code/wxWidgets-3.1.1/gtk-build/samples/minimal$ make
zyh@zyh:~/code/wxWidgets-3.1.1/gtk-build/samples/minimal$ ./minimal

Now, I have cloned the C::B source:
Code
git clone https://github.com/obfuscated/codeblocks_sf.git
Then I run bootstrap, I get failed
Code
zyh@zyh:~/code/codeblocks-git/codeblocks_sf$ ./bootstrap Using 'git log --graph' to get the revision
Found revision: '11442' '2018-08-07 07:14:29'
libtoolize: putting auxiliary files in `.'.
libtoolize: copying file `./ltmain.sh'
libtoolize: putting macros in AC_CONFIG_MACRO_DIR, `m4'.
libtoolize: copying file `m4/libtool.m4'
libtoolize: copying file `m4/ltoptions.m4'
libtoolize: copying file `m4/ltsugar.m4'
libtoolize: copying file `m4/ltversion.m4'
libtoolize: copying file `m4/lt~obsolete.m4'
configure.ac:141: warning: macro 'AM_OPTIONS_WXCONFIG' not found in library
configure.ac:142: warning: macro 'AM_PATH_WXCONFIG' not found in library
configure.ac:141: error: possibly undefined macro: AM_OPTIONS_WXCONFIG
      If this token and others are legitimate, please use m4_pattern_allow.
      See the Autoconf documentation.
configure.ac:142: error: possibly undefined macro: AM_PATH_WXCONFIG

Since I have no previous wx library installed on my system, I run such command: (I follow this wiki page: Page)
Code
zyh@zyh:~/code/codeblocks-git/codeblocks_sf$ update-alternatives --install /usr/bin/wx-config wx-config /home/zyh/code/wx3install/bin/wx-config 50
But I still get the same bootstrap.

So, any ideas how to step further?
Thanks.
« Last Edit: August 15, 2018, 03:12:23 am by ollydbg »
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5916
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: Bootstrap with no wxWidgets packet installed
« Reply #8 on: August 08, 2018, 06:40:57 am »
OK, bootstrap runs OK now.
Some reference link: Re: Error while building codeblocks in unix-style and 4 Code::Blocks installation


Code
zyh@zyh:~/code/codeblocks-git/codeblocks_sf$ export ACLOCAL_FLAGS="-I `wx-config --prefix` -I /home/zyh/code/wx3install/share/aclocal"
zyh@zyh:~/code/codeblocks-git/codeblocks_sf$ ./bootstrap Using 'git log --graph' to get the revision
Found revision: '11442' '2018-08-07 07:14:29'
libtoolize: putting auxiliary files in `.'.
libtoolize: copying file `./ltmain.sh'
libtoolize: putting macros in AC_CONFIG_MACRO_DIR, `m4'.
libtoolize: copying file `m4/libtool.m4'
libtoolize: copying file `m4/ltoptions.m4'
libtoolize: copying file `m4/ltsugar.m4'
libtoolize: copying file `m4/ltversion.m4'
libtoolize: copying file `m4/lt~obsolete.m4'
zyh@zyh:~/code/codeblocks-git/codeblocks_sf$

zyh@zyh:~/code/codeblocks-git/codeblocks_sf$ echo $ACLOCAL_FLAGS -I /home/zyh/code/wx3install -I /home/zyh/code/wx3install/share/aclocal


EDIT:
As suggested by blauzahn, the correct command is:

Code
zyh@zyh:~/code/codeblocks-git/codeblocks_sf$ export ACLOCAL_FLAGS="-I `wx-config --prefix`/share/aclocal"

also, those library need to be installed:
Code
zyh@zyh:~/code/codeblocks-git/codeblocks_sf$ mkdir build
zyh@zyh:~/code/codeblocks-git/codeblocks_sf$ cd build
zyh@zyh:~/code/codeblocks-git/codeblocks_sf/build$ sudo apt-get install libhunspell-dev
zyh@zyh:~/code/codeblocks-git/codeblocks_sf/build$ sudo apt-get install libgamin-dev
zyh@zyh:~/code/codeblocks-git/codeblocks_sf/build$ ../configure --prefix=/home/zyh/code/cbinstall/ --with-contrib-plugins=all,-NassiShneiderman

If you need to build NassiShneiderman, some extra library need to be installed.


« Last Edit: August 08, 2018, 08:47:50 am by ollydbg »
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

Offline blauzahn

  • Almost regular
  • **
  • Posts: 161
Re: Bootstrap with no wxWidgets packet installed
« Reply #9 on: August 08, 2018, 07:50:55 am »

Yes that works. This is the way, I always use it in conjunction with wxWidgets trunk
on Ubuntu 16.04 (x86_64), antergos 18.07 (x86_64) and raspbian. During the last week I tried all of
them with current trunks of cb and wxWidgets.

I have a Makefile in a directory above cb trunk. In order to bootstrap and
configure for an out of tree build I use these 2 PHONY Makefile targets:

Code
SRCDIR=trunk
BUILDDIR=build

bootstrap:
(cd $(SRCDIR) && ACLOCAL_FLAGS="-I `wx-config --prefix`/share/aclocal" ./bootstrap )

config:
@mkdir -p $(BUILDDIR)
(cd $(BUILDDIR) && ../$(SRCDIR)/configure --prefix=$(PREFIX) --with-contrib-plugins=all,-NassiShneiderman)

For the record: Your clone command is missing the last letter, ending with .gi instead of .git.

Have a nice day.

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5916
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: Bootstrap with no wxWidgets packet installed
« Reply #10 on: August 08, 2018, 08:01:59 am »
For the record: Your clone command is missing the last letter, ending with .gi instead of .git.
Oh, a copy paste error, I have fixed it in the post.

Thanks for your makefile, I also do not want to build the NassiShneiderman plugin, because it needs some extra boost related header files.  ;)

Code
ACLOCAL_FLAGS="-I `wx-config --prefix`/share/aclocal"
I just see this is a string concatenation, in my previous post, I added two "-I", which I think is wrong, thanks.



If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5916
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: Bootstrap with no wxWidgets packet installed
« Reply #11 on: August 09, 2018, 01:08:20 pm »
I meet an issue that the new build C::B can not run the debugger. I create a simple console project, when I hit the run bottom, it correctly shows the hello world in the xterm, while I hit the debug botton, C::B just hangs. Do you see the same issue, since I can't copy the debugger plugin log.
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Bootstrap with no wxWidgets packet installed
« Reply #12 on: August 09, 2018, 03:34:23 pm »
Which revision? Can you build an older revision to see if it works? Can you attach gdb to see what is going on?
(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 ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5916
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: Bootstrap with no wxWidgets packet installed
« Reply #13 on: August 09, 2018, 03:38:04 pm »
Which revision?
Found revision: '11442' '2018-08-07 07:14:29', I clone it from your github repo.

Quote
Can you build an older revision to see if it works? Can you attach gdb to see what is going on?
I will try it as soon as I can.
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5916
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: Bootstrap with no wxWidgets packet installed
« Reply #14 on: August 10, 2018, 02:29:36 am »
Quote
Can you build an older revision to see if it works? Can you attach gdb to see what is going on?
I will try it as soon as I can.
OK, things becomes more strange, that is: debugger plugin works OK if I run C::B under GDB, while debugger plugin(the whole C::B) just hangs if I start C::B directly from command line. :(
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5916
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: Bootstrap with no wxWidgets packet installed
« Reply #15 on: August 10, 2018, 02:55:32 am »
OK, I use GDB to attach to the hanging C::B, and here is the bt:

Code
(gdb) bt 30
#0  0x00007fe35da69ed7 in wxMBConv::ToWChar(wchar_t*, unsigned long, char const*, unsigned long) const ()
   from /home/zyh/code/wx3install/lib/libwx_gtk3u-3.1.so.1
#1  0x00007fe35daa2214 in wxTextInputStream::GetChar() ()
   from /home/zyh/code/wx3install/lib/libwx_gtk3u-3.1.so.1
#2  0x00007fe35daa23c0 in wxTextInputStream::ReadLine() ()
   from /home/zyh/code/wx3install/lib/libwx_gtk3u-3.1.so.1
#3  0x00007fe35db36912 in ReadAll(wxInputStream*, wxArrayString&) ()
   from /home/zyh/code/wx3install/lib/libwx_gtk3u-3.1.so.1
#4  0x00007fe35db36a82 in wxDoExecuteWithCapture(wxString const&, wxArrayString&, wxArrayString*, int, wxExecuteEnv const*) ()
   from /home/zyh/code/wx3install/lib/libwx_gtk3u-3.1.so.1
#5  0x00007fe35ebd433f in cbDebuggerPlugin::RunNixConsole(wxString&) ()
   from /home/zyh/code/cbinstall/lib/libcodeblocks.so.0
#6  0x00007fe31ce0ce0a in DebuggerGDB::DoDebug(bool) ()
   from /home/zyh/code/cbinstall/lib/codeblocks/plugins/libdebugger.so
#7  0x00007fe31ce0da5e in DebuggerGDB::Debug(bool) ()
   from /home/zyh/code/cbinstall/lib/codeblocks/plugins/libdebugger.so
#8  0x0000000000473b85 in DebuggerMenuHandler::OnStart(wxCommandEvent&) ()
#9  0x00007fe35d9a45fe in wxAppConsoleBase::CallEventHandler(wxEvtHandler*, wxEventFunctor&, wxEvent&) const ()
   from /home/zyh/code/wx3install/lib/libwx_gtk3u-3.1.so.1
#10 0x00007fe35db2ab32 in wxEvtHandler::ProcessEventIfMatchesId(wxEventTableEntryBase const&, wxEvtHandler*, wxEvent&) ()
   from /home/zyh/code/wx3install/lib/libwx_gtk3u-3.1.so.1
#11 0x00007fe35db2abe3 in wxEventHashTable::HandleEvent(wxEvent&, wxEvtHandler*) () from /home/zyh/code/wx3install/lib/libwx_gtk3u-3.1.so.1
#12 0x00007fe35db2b32a in wxEvtHandler::TryHereOnly(wxEvent&) ()
   from /home/zyh/code/wx3install/lib/libwx_gtk3u-3.1.so.1
#13 0x00007fe35db2ad73 in wxEvtHandler::DoTryChain(wxEvent&) ()
   from /home/zyh/code/wx3install/lib/libwx_gtk3u-3.1.so.1
#14 0x00007fe35db2b405 in wxEvtHandler::ProcessEvent(wxEvent&) ()
   from /home/zyh/code/wx3install/lib/libwx_gtk3u-3.1.so.1
#15 0x00007fe35dd7d268 in wxWindowBase::TryAfter(wxEvent&) ()
   from /home/zyh/code/wx3install/lib/libwx_gtk3u-3.1.so.1
#16 0x00007fe35db2cb97 in wxEvtHandler::SafelyProcessEvent(wxEvent&) ()
   from /home/zyh/code/wx3install/lib/libwx_gtk3u-3.1.so.1
#17 0x00007fe35dd59e64 in wxToolBarBase::OnLeftClick(int, bool) ()
   from /home/zyh/code/wx3install/lib/libwx_gtk3u-3.1.so.1
#18 0x00007fe35a46e5e7 in ?? ()
---Type <return> to continue, or q <return> to quit---
   from /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0
#19 0x00007fe35a487088 in g_signal_emit_valist ()
   from /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0
#20 0x00007fe35a488212 in g_signal_emit_by_name ()
   from /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0
#21 0x00007fe35a46e5e7 in ?? ()
   from /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0
#22 0x00007fe35a487088 in g_signal_emit_valist ()
   from /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0
#23 0x00007fe35a487ce2 in g_signal_emit ()
   from /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0
#24 0x00007fe35b7267e8 in ?? () from /usr/lib/x86_64-linux-gnu/libgtk-3.so.0
#25 0x00007fe35a46e3b8 in g_closure_invoke ()
   from /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0
#26 0x00007fe35a47f557 in ?? ()
   from /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0
#27 0x00007fe35a487a29 in g_signal_emit_valist ()
   from /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0
#28 0x00007fe35a487ce2 in g_signal_emit ()
   from /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0
#29 0x00007fe35b7256a1 in ?? () from /usr/lib/x86_64-linux-gnu/libgtk-3.so.0
(More stack frames follow...)
(gdb)


So, it looks like the debugger plugin goes to an endless loop?
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

Offline blauzahn

  • Almost regular
  • **
  • Posts: 161
Re: Bootstrap with no wxWidgets packet installed
« Reply #16 on: August 10, 2018, 06:44:31 am »
Code
in wxMBConv::ToWChar

Over the last months I have seen cb hanging there reproducibly several times.
And that was from other call-sites -- more than one. If memory serves me, it was e.g. splash-screen
during startup. Right now the latter seems to work. I did not try to analyse it though.

Offline blauzahn

  • Almost regular
  • **
  • Posts: 161
Re: Bootstrap with no wxWidgets packet installed
« Reply #17 on: August 10, 2018, 06:51:21 am »
Quote
works OK if I run C::B under GDB,

My first thought: Does the debugger set an otherwise uninitialized variable to zero or another
"helpful" value -- maybe just by stack-reuse?

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Bootstrap with no wxWidgets packet installed
« Reply #18 on: August 10, 2018, 08:05:46 am »
@ollydbg: You're most probably hitting a race condition in wxExecute. Search wxwidgets' trac to see if someone has already reported this. I've not seen these for a long time. In the past those happened during compilation.

Also can you try to revert the two recent commits related to the environment in the debugger have anything to do with this?
Can you build wx with symbols so we can see where exactly in their code stops?
(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 ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5916
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: Bootstrap with no wxWidgets packet installed
« Reply #19 on: August 10, 2018, 08:17:43 am »
Also can you try to revert the two recent commits related to the environment in the debugger have anything to do with this?
You mean I just need to revert the svn r11442 and r11441?

Or, the revisions in the debugger plugin? Which revision?
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5916
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: Bootstrap with no wxWidgets packet installed
« Reply #20 on: August 10, 2018, 09:14:13 am »
Here is the log when I run C::B under GDB, and start the GDB under C::B, it works OK:
Code
Active debugger config: GDB/CDB debugger:Default
Selecting target:
Debug
Adding source dir: /home/zyh/code/test/console1/
Adding source dir: /home/zyh/code/test/console1/
Adding file: /home/zyh/code/test/console1/bin/Debug/console1
Changing directory to: /home/zyh/code/test/console1/.
Set variable: LD_LIBRARY_PATH=.::/home/zyh/code/wx3install/lib/

[debug]Command-line: /usr/bin/gdb -nx -fullname -quiet  -args /home/zyh/code/test/console1/bin/Debug/console1
[debug]Working dir : /home/zyh/code/test/console1

Starting debugger: /usr/bin/gdb -nx -fullname -quiet  -args /home/zyh/code/test/console1/bin/Debug/console1
Setting SHELL to '/bin/sh'
done

[debug]Reading symbols from /home/zyh/code/test/console1/bin/Debug/console1...
[debug]done.
[debug](gdb)
[debug]> set prompt >>>>>>cb_gdb:

Setting breakpoints

[debug]Using sleep command's PID as console PID 8483, TTY /dev/pts/22
[debug]Queued:[tty /dev/pts/22]
[debug]>>>>>>cb_gdb:
[debug]> show version
[debug]GNU gdb (Ubuntu 7.7.1-0ubuntu5~14.04.3) 7.7.1
[debug]Copyright (C) 2014 Free Software Foundation, Inc.
[debug]License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
[debug]This is free software: you are free to change and redistribute it.
[debug]There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
[debug]and "show warranty" for details.
[debug]This GDB was configured as "x86_64-linux-gnu".
[debug]Type "show configuration" for configuration details.
[debug]For bug reporting instructions, please see:
[debug]<http://www.gnu.org/software/gdb/bugs/>.
[debug]Find the GDB manual and other documentation resources online at:
[debug]<http://www.gnu.org/software/gdb/documentation/>.
[debug]For help, type "help".
[debug]Type "apropos word" to search for commands related to "word".
[debug]>>>>>>cb_gdb:
[debug]> set confirm off

Debugger name and version: GNU gdb (Ubuntu 7.7.1-0ubuntu5~14.04.3) 7.7.1

[debug]>>>>>>cb_gdb:
[debug]> set width 0
[debug]>>>>>>cb_gdb:
[debug]> set height 0
[debug]>>>>>>cb_gdb:
[debug]> set breakpoint pending on
[debug]>>>>>>cb_gdb:
[debug]> set print asm-demangle on
[debug]>>>>>>cb_gdb:
[debug]> set unwindonsignal on
[debug]>>>>>>cb_gdb:
[debug]> set print elements 200
[debug]>>>>>>cb_gdb:
[debug]> set disassembly-flavor intel
[debug]>>>>>>cb_gdb:
[debug]> catch throw
[debug]Catchpoint 1 (throw)
[debug]>>>>>>cb_gdb:
[debug]> directory /home/zyh/code/test/console1/
[debug]Source directories searched: /home/zyh/code/test/console1:$cdir:$cwd
[debug]>>>>>>cb_gdb:
[debug]> break "/home/zyh/code/test/console1/main.cpp:7"
[debug]Breakpoint 2 at 0x400861: file /home/zyh/code/test/console1/main.cpp, line 7.
[debug]>>>>>>cb_gdb:
[debug]> tty /dev/pts/22
[debug]>>>>>>cb_gdb:
[debug]> run
[debug]Starting program: /home/zyh/code/test/console1/bin/Debug/console1
[debug]Breakpoint 2, main () at /home/zyh/code/test/console1/main.cpp:7
[debug]/home/zyh/code/test/console1/main.cpp:7:56:beg:0x400861
[debug]>>>>>>cb_gdb:

At /home/zyh/code/test/console1/main.cpp:7


While, I see when I start C::B from command line, and start GDB from C::B just hangs, the debug log shows nothing after the line "Setting breakpoints", it sounds like GDB is already started?
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Bootstrap with no wxWidgets packet installed
« Reply #21 on: August 10, 2018, 10:21:32 am »
11415 and 11402
(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 ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5916
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: Bootstrap with no wxWidgets packet installed
« Reply #22 on: August 10, 2018, 11:56:45 am »
11415 and 11402
OK, I will revert those two commits next week when I'm on Ubuntu.
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5916
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: Bootstrap with no wxWidgets packet installed
« Reply #23 on: August 15, 2018, 02:44:02 am »
11415 and 11402
OK, I will revert those two commits next week when I'm on Ubuntu.
I just revert those two commits, and I see the hang bug still exists.  :(
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5916
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: Bootstrap with no wxWidgets packet installed
« Reply #24 on: August 15, 2018, 03:39:02 am »
Can you build wx with symbols so we can see where exactly in their code stops?
I just build a wx library with symbols:
Code
mkdir gtk-build-debug
cd gtk-build-debug
../configure --enable-unicode --prefix=/home/zyh/code/wx3install-debug/ --enable-monolithic --enable-debug
make -j4
make install

Then open a terminal, and run such command to let C::B use the new wx library
Code
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/zyh/code/wx3install-debug/lib/
./codeblocks --multiply-instance --no-ipc &

Now, I can use C::B to debug. So, this looks like a GCC optimization bug?  ;)
Since I don't rebuild C::B against debug version of wx library.
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Bootstrap with no wxWidgets packet installed
« Reply #25 on: August 15, 2018, 07:28:09 am »
Now, I can use C::B to debug. So, this looks like a GCC optimization bug?  ;)
Hehe, it is so easy to blame the compiler for hard to explain bugs.
GCC is rarely to blame when there are race conditions or other threading bugs...
(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 oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Bootstrap with no wxWidgets packet installed
« Reply #26 on: August 15, 2018, 07:30:50 am »
Can you try to build wx from the wx_3_0_branch and see if the problem reproduces?
(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 oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Bootstrap with no wxWidgets packet installed
« Reply #27 on: August 15, 2018, 07:53:31 am »
I've just tried to reproduce your setup and debugging works fine when starting cb from terminal.
(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 ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5916
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: Bootstrap with no wxWidgets packet installed
« Reply #28 on: August 15, 2018, 07:55:19 am »
Can you try to build wx from the wx_3_0_branch and see if the problem reproduces?
OK, I will do this soon.
Do I only need to build the wx_3_0_branch library, and use the previous built C::B? I mean I can use the
Code
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/somewhere/wx/library/installed
./codeblocks --multiply-instance --no-ipc &
to let C::B pick the wx library.


I have a question, if I have several wx library, such as:
Code
/home/zyh/code/wx3install                      release version of wx 3.1.1 library
/home/zyh/code/wx3install-debug            debug version of wx 3.1.1 library
/home/zyh/code/wx30install                   release version of wx 3.0 branch library

How do I adjust the wx-config?
In my previous post, I have to run the command:
Code
update-alternatives --install /usr/bin/wx-config wx-config /home/zyh/code/wx3install/bin/wx-config 50
which point the wx-config to the wx library before I run the bootstrap command.

I mean, I have to run the update-alternatives command before I build a new C::B?

If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Bootstrap with no wxWidgets packet installed
« Reply #29 on: August 15, 2018, 08:16:30 am »
It is better to rebuild the whole codeblocks.

For the wx-config check the help of the cb's configure script. There is an option which allows you to select the exact binary you want to use.
(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 ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5916
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: Bootstrap with no wxWidgets packet installed
« Reply #30 on: August 15, 2018, 08:52:43 am »
It is better to rebuild the whole codeblocks.

For the wx-config check the help of the cb's configure script. There is an option which allows you to select the exact binary you want to use.
Thanks for the help! Yes, there is an option to set the wx-config path.

I now build a release version of wx 3.0 branch, then I build C::B against this wx library.
Now, the result C::B can debug, so the hang issue does not happens in this combination;)
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Bootstrap with no wxWidgets packet installed
« Reply #31 on: August 15, 2018, 01:59:57 pm »
Probably you could do a bisect on the wx's master branch to see where the issue started to happen and post a bug report.
(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 ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5916
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: Bootstrap with no wxWidgets packet installed
« Reply #32 on: August 17, 2018, 02:44:28 am »
Probably you could do a bisect on the wx's master branch to see where the issue started to happen and post a bug report.
This is a huge task for me, so I won't plane to do this.  ;)
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5916
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: Bootstrap with no wxWidgets packet installed
« Reply #33 on: August 17, 2018, 02:55:54 am »
BTW, under my ubuntu 14, I see that the dialog background is black, and text is gray, see the image blew, quite ugly.
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5916
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: Bootstrap with no wxWidgets packet installed
« Reply #34 on: October 26, 2018, 10:00:48 am »
Question: what is the way to "build" the C::B if the source code get updated?

Today, I have run the "git pull --rebase" to update the C::B's source code to the latest revision under Ubuntu 14.
But when I switch to the build dir, and run the "make" command, I see some error message:

Code
zyh@zyh:~/code/codeblocks-git/codeblocks_sf/build-wx30$ make -f Makefile
/bin/bash ./config.status --recheck
running CONFIG_SHELL=/bin/bash /bin/bash ../configure --prefix=/home/zyh/code/cb-wx30-install/ --with-wx-config=/home/zyh/code/wx30branchinstall/bin/wx-config --no-create --no-recursion
configure: WARNING: unrecognized options: --with-wx-config
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking target system type... x86_64-unknown-linux-gnu
checking whether configure should try to set CFLAGS/CXXFLAGS/CPPFLAGS/LDFLAGS... yes
checking whether to enable debugging... no
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... no
...
...
...
checking whether to build the foreign projects importer plugin... yes
checking whether to build the scripted wizard plugin... yes
checking whether to build the to-do plugin... yes
checking whether to build the abbreviations plugin... yes
checking whether to keep prebuild windows dll's in dist-tarball... yes
checking whether to integrate fortran-plugin in dist-tarball... yes
checking whether to use gtk-notebook as default notebook... yes
checking which (if any) contrib plugins to build... none
checking if the compiler supports precompiled headers... yes
../configure: line 20785: AM_OPTIONS_WXCONFIG: command not found
../configure: line 20786: syntax error near unexpected token `2.8.12,'
../configure: line 20786: `AM_PATH_WXCONFIG(2.8.12, wxWin=1)'
make: *** [config.status] Error 2
zyh@zyh:~/code/codeblocks-git/codeblocks_sf/build-wx30$

I have such environment variable:
Code
zyh@zyh:~/code/codeblocks-git/codeblocks_sf/build-wx30$ wx-config --list

    Default config is gtk3-unicode-3.0

  Default config will be used for output

zyh@zyh:~/code/codeblocks-git/codeblocks_sf/build-wx30$ update-alternatives --config wx-config
There is only one alternative in link group wx-config (providing /usr/bin/wx-config): /home/zyh/code/wx30branchinstall/bin/wx-config
Nothing to configure.
zyh@zyh:~/code/codeblocks-git/codeblocks_sf/build-wx30$ echo $ACLOCAL_FLAGS
-I /home/zyh/code/wx30branchinstall/share/aclocal
zyh@zyh:~/code/codeblocks-git/codeblocks_sf/build-wx30$

So, do I have do a clean rebuild? (for a clean rebuild, I mean I have to run bootstap, then configure, then make)
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

Offline kipade

  • Multiple posting newcomer
  • *
  • Posts: 50
Re: Bootstrap with no wxWidgets packet installed
« Reply #35 on: November 12, 2018, 01:14:18 pm »
I think you specify the env variable ACLOCAL_PATH to where you located the wxwin.m4, your configuration would be ok.

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5916
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: Bootstrap with no wxWidgets packet installed
« Reply #36 on: December 05, 2018, 01:23:13 am »
I think you specify the env variable ACLOCAL_PATH to where you located the wxwin.m4, your configuration would be ok.
Hi, thanks for the reply.

I just add my local wxwin.m4 path, which is /home/zyh/code/wx30branchinstall/share/aclocal  in the ACLOCAL_PATH variable, with this command:

Code
zyh@zyh:~/code/codeblocks-git/codeblocks_sf/build-wx30$ export ACLOCAL_PATH=/home/zyh/code/wx30branchinstall/share/aclocal:$ACLOCAL_PATH

After that, I type the make command, but the error message is the same as my previous post. :(
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

Offline kipade

  • Multiple posting newcomer
  • *
  • Posts: 50
Re: Bootstrap with no wxWidgets packet installed
« Reply #37 on: December 13, 2018, 06:26:54 am »
after that, you should reconfigure it via the "configure" shell