Code::Blocks Forums

User forums => Using Code::Blocks => Topic started by: Tof on February 13, 2006, 03:33:09 am

Title: [SOLVED] sc_wxstring.cpp:300 ... Assertion `r >= 0' failed.
Post by: Tof on February 13, 2006, 03:33:09 am
Hi

I have this error when I start codeblocks :

"codeblocks: ./bindings/sc_wxstring.cpp:300: void Register_wxString(asIScriptEngine*): Assertion `r >= 0' failed.
Aborted"

Any idea?
Title: Re: sc_wxstring.cpp:300 ... Assertion `r >= 0' failed.
Post by: Michael on February 13, 2006, 12:19:56 pm
Hello,

Which version of C::B are you using?

Michael
Title: Re: sc_wxstring.cpp:300 ... Assertion `r >= 0' failed.
Post by: Tof on February 13, 2006, 03:26:19 pm
I try with the latest stable release: 1.0rc2, Oct 25, 2005

I also try with the version from subversion (revision1995) and I have this message :

$ make
....
 g++ -O2 -ffast-math -g -O2 -I/usr/lib64/wx/include/gtk2-ansi-release-2.6 -I/usr/include/wx-2.6 -DGTK_NO_CHECK_CASTS -D__WXGTK__ -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES -D_LARGEFILE_SOURCE=1 -DNO_GCC_PRAGMA -DCB_PRECOMP -Winvalid-pch -fPIC -DPIC -o codeblocks app.o appglobals.o compilersettingsdlg.o dlgabout.o dlgaboutplugin.o environmentsettingsdlg.o main.o prefix.o printdlg.o startherepage.o -pthread -pthread  -L/usr/lib64 -L/usr/X11R6/lib64 -L/home/me/sources/codeblocks/src/src/wxAUI /home/me/sources/codeblocks/src/src/wxAUI/.libs/libwxaui.a -lm -L/usr/x86_64-pc-linux-gnu/bin -L/usr/x86_64-pc-linux-gnu/lib -L/usr/lib/gcc/x86_64-pc-linux-gnu/../../../x86_64-pc-linux-gnu/lib -L/usr/lib/gcc/x86_64-pc-linux-gnu/../../../lib64 -L/lib/../lib64 -L/usr/lib/../lib64 -lgcc_s -lc -L/home/me/sources/codeblocks/src/sdk /usr/lib/libcodeblocks.so /usr/lib/libwxscintilla.so /usr/lib/gcc/x86_64-pc-linux-gnu/3.4.5/libstdc++.so -lpthread -ldl -lwx_gtk2_xrc-2.6 -lwx_gtk2_html-2.6 -lwx_gtk2_adv-2.6 -lwx_gtk2_core-2.6 -lwx_base_xml-2.6 -lwx_base_net-2.6 -lwx_base-2.6
main.o: In function `MainFrame::OnEditHighlightMode(wxCommandEvent&)':
/usr/include/wx-2.6/wx/string.h:224: undefined reference to `EditorColorSet::Apply(wxString, cbStyledTextCtrl*)'
collect2: ld returned 1 exit status
make[3]: *** [codeblocks] Error 1
make[3]: Leaving directory `/home/me/sources/codeblocks/src/src'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/home/me/sources/codeblocks/src/src'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/me/sources/codeblocks/src'
make: *** [all-recursive] Error 1

Tof
Title: Re: sc_wxstring.cpp:300 ... Assertion `r >= 0' failed.
Post by: Michael on February 13, 2006, 03:31:29 pm
Did you use may be a distribution of Linux 64bit?

Did you already have a look at here: http://wiki.codeblocks.org/index.php?title=Compiling_Code::Blocks_in_Linux_%28applies_to_all_distros%29

Best wishes,
Michael
Title: Re: sc_wxstring.cpp:300 ... Assertion `r >= 0' failed.
Post by: takeshimiya on February 13, 2006, 03:49:46 pm
No, currently AngelScript is the problem, it doesn't work with native calls on 64 bits yet.
But you can get C::B working, see my post here: http://forums.codeblocks.org/index.php?topic=2096.0
Title: Re: sc_wxstring.cpp:300 ... Assertion `r >= 0' failed.
Post by: Tof on February 17, 2006, 04:00:53 pm
Thank you for your support

Micheal, Yes I use gentoo with an AMD64

I look at your link and I recompile wxGTK with ansi libraries and without monolitic option because C::B search libwx_gtk2_xrc-2.6.so (ANSI version) not for libwx_gtk2u_xrc-2.6.so (UNICODE version). If I try with monolitic option wxGTK don't generate some libraries need by C::B like libwx_gtk2_xrc-2.6.so.

I also define AS_MAX_PORTABILITY in ./src/sdk/as/source/as_config.h

Now when I build :

$make

app.o: In function `cbMessageBox':
./globals.h:186: undefined reference to `PlaceWindow(wxWindow*, cbPlaceDialogMode, bool)'
./globals.h:186: undefined reference to `PlaceWindow(wxWindow*, cbPlaceDialogMode, bool)'
./globals.h:186: undefined reference to `PlaceWindow(wxWindow*, cbPlaceDialogMode, bool)'
./globals.h:186: undefined reference to `PlaceWindow(wxWindow*, cbPlaceDialogMode, bool)'
app.o: In function `CodeBlocksApp::BatchJob()':
/home/me/sources/codeblocks/src/src/app.cpp:519: undefined reference to `PlaceWindow(wxWindow*, cbPlaceDialogMode, bool)'
app.o:./globals.h:186: more undefined references to `PlaceWindow(wxWindow*, cbPlaceDialogMode, bool)' follow
compilersettingsdlg.o: In function `CompilerSettingsDlg::UpdateListbookImages()':
/usr/include/wx-2.6/wx/listbook.h:94: undefined reference to `GetSettingsIconsStyle(wxListCtrl*)'
compilersettingsdlg.o: In function `CompilerSettingsDlg':
/usr/include/wx-2.6/wx/listbook.h:94: undefined reference to `SetSettingsIconsStyle(wxListCtrl*, SettingsIconsStyle)'
/usr/include/wx-2.6/wx/listbook.h:94: undefined reference to `SetSettingsIconsStyle(wxListCtrl*, SettingsIconsStyle)'
environmentsettingsdlg.o: In function `EnvironmentSettingsDlg::UpdateListbookImages()':
/usr/include/wx-2.6/wx/listbook.h:94: undefined reference to `GetSettingsIconsStyle(wxListCtrl*)'
environmentsettingsdlg.o: In function `EnvironmentSettingsDlg':
/usr/include/wx-2.6/wx/listbook.h:94: undefined reference to `SetSettingsIconsStyle(wxListCtrl*, SettingsIconsStyle)'
/usr/include/wx-2.6/wx/listbook.h:94: undefined reference to `SetSettingsIconsStyle(wxListCtrl*, SettingsIconsStyle)'
environmentsettingsdlg.o: In function `cbMessageBox':
./globals.h:186: undefined reference to `PlaceWindow(wxWindow*, cbPlaceDialogMode, bool)'
environmentsettingsdlg.o: In function `EnvironmentSettingsDlg::OnChooseColor(wxCommandEvent&)':
/home/me/sources/codeblocks/src/src/environmentsettingsdlg.cpp:267: undefined reference to `PlaceWindow(wxWindow*, cbPlaceDialogMode, bool)'
environmentsettingsdlg.o: In function `EnvironmentSettingsDlg::OnHeadCheck(wxCommandEvent&)':
/usr/include/wx-2.6/wx/event.h:561: undefined reference to `PlaceWindow(wxWindow*, cbPlaceDialogMode, bool)'
environmentsettingsdlg.o: In function `EnvironmentSettingsDlg::OnSettingsIconsSize(wxCommandEvent&)':
/usr/include/wx-2.6/wx/listbook.h:94: undefined reference to `SetSettingsIconsStyle(wxListCtrl*, SettingsIconsStyle)'
main.o: In function `MainFrame::ShowOpenFileDialog(wxString const&, wxString const&)':
/home/me/sources/codeblocks/src/src/main.cpp:1076: undefined reference to `PlaceWindow(wxWindow*, cbPlaceDialogMode, bool)'
main.o: In function `cbMessageBox':
./globals.h:186: undefined reference to `PlaceWindow(wxWindow*, cbPlaceDialogMode, bool)'
./globals.h:186: undefined reference to `PlaceWindow(wxWindow*, cbPlaceDialogMode, bool)'
main.o: In function `MainFrame::OnProjectOpen(wxCommandEvent&)':
/home/me/sources/codeblocks/src/src/main.cpp:2459: undefined reference to `PlaceWindow(wxWindow*, cbPlaceDialogMode, bool)'
main.o: In function `MainFrame::OnHelpPluginMenu(wxCommandEvent&)':
/home/me/sources/codeblocks/src/src/main.cpp:1645: undefined reference to `PlaceWindow(wxWindow*, cbPlaceDialogMode, bool)'
main.o:./globals.h:186: more undefined references to `PlaceWindow(wxWindow*, cbPlaceDialogMode, bool)' follow
main.o: In function `MainFrame::OnEditHighlightMode(wxCommandEvent&)':
/usr/include/wx-2.6/wx/string.h:224: undefined reference to `EditorColorSet::Apply(wxString, cbStyledTextCtrl*)'
main.o: In function `cbMessageBox':
./globals.h:186: undefined reference to `PlaceWindow(wxWindow*, cbPlaceDialogMode, bool)'
./globals.h:186: undefined reference to `PlaceWindow(wxWindow*, cbPlaceDialogMode, bool)'
./globals.h:186: undefined reference to `PlaceWindow(wxWindow*, cbPlaceDialogMode, bool)'
main.o: In function `MainFrame::OnHelpAbout(wxCommandEvent&)':
/home/me/sources/codeblocks/src/src/main.cpp:2548: undefined reference to `PlaceWindow(wxWindow*, cbPlaceDialogMode, bool)'
main.o: In function `MainFrame::OnSettingsEnvironment(wxCommandEvent&)':
/home/me/sources/codeblocks/src/src/main.cpp:2911: undefined reference to `PlaceWindow(wxWindow*, cbPlaceDialogMode, bool)'
main.o:./globals.h:186: more undefined references to `PlaceWindow(wxWindow*, cbPlaceDialogMode, bool)' follow

I don't know  who is define PlaceWindow. Is it wxGTK's function ?

Tof
Title: Re: sc_wxstring.cpp:300 ... Assertion `r >= 0' failed.
Post by: Michael on February 17, 2006, 04:15:55 pm
I don't know  who is define PlaceWindow. Is it wxGTK's function ?

AFAIK no, it is not a wxGTK's function. Have a look at the SVN sources (sdk\global.h and sdk\global.cpp) where it is declarer/defined.

Anyway, I am not sure that C::B could be compiled with a 64bit CPU (at least not now).

Best wishes,
Michael
Title: Re: sc_wxstring.cpp:300 ... Assertion `r >= 0' failed.
Post by: takeshimiya on February 17, 2006, 04:33:27 pm
Yes, it can, but there are regressions from RC2 to now ("new features means new bugs", in this case, AngelScript).

Probably the errors of PlaceWindow() is because it uses GTK? It was recently added so I've not tested on linux.
Title: Re: sc_wxstring.cpp:300 ... Assertion `r >= 0' failed.
Post by: thomas on February 17, 2006, 05:18:15 pm
Very likely, your problem comes from not doing a clean rebuild.

PlaceWindow() is a SDK function, i.e. it is inside libcodeblocks.so. All your errors originate from the application target, but the application links against that library, so if there are missing references, then obviously your libcodeblocks.so must be out of date (otherwise, the symbol would be there).
Title: Re: sc_wxstring.cpp:300 ... Assertion `r >= 0' failed.
Post by: Tof on February 18, 2006, 05:06:30 am
Thanks Tomas,  I check and I found an hold version of libcodeblocks.so in /usr/lib64 without PlaceWindow function.

Ok now I can build C::B

For wxGTK :
 1 - Rebuild with unicode and monolitic options
 
Code
myconf="--enable-xrc --enable-monolithic --enable-unicode" emerge wxGTK

For C::B
 1 - Clean previous installation
Code
$ make uninstall

 2 - Clean files
 
Code
$ make clean
3 - Define  AS_MAX_PORTABILITY in ./src/sdk/as/source/as_config.h
 4 - Generate a new configure.ac (see attach)
 5 - Regenerate Makefiles
Code
aclocal && autoconf && autoheader && automake --include-deps --add-missing --foreign --copy && ./configure --prefix=/usr --enable-debug=no && make

In this step some thing strange :
 For each source g++ use "-O2 -ffast-math -g -O2" ?
 With "-g -O2"  the sources are compile in debug or in release mode?
 I guess it's define by acinclude.m4 but I not an expert with m4.

Code
....
make[3]: Nothing to be done for `all-am'.
make[3]: Leaving directory `/home/me/sources/codeblocks/src'
make[2]: Leaving directory `/home/me/sources/codeblocks/src'
make[2]: Entering directory `/home/me/sources/codeblocks'
make[2]: Leaving directory `/home/me/sources/codeblocks'
make[1]: Leaving directory `/home/me/sources/codeblocks'
/home/me/sources/codeblocks # echo $?
0

Fine!

6 - Install C::B

Code
/home/me/sources/codeblocks # make install
...
***
* Updating MIME database in /usr/share/mime...
***
...
make[1]: Leaving directory `/home/me/sources/codeblocks/src'
make: *** [install-recursive] Error 1

What's means?

Tof

[attachment deleted by admin]
Title: Re: sc_wxstring.cpp:300 ... Assertion `r >= 0' failed.
Post by: Tof on February 18, 2006, 06:54:30 pm
I found why "make install" it's not working

1 - Replace AC_INIT in configure.ac by "AC_INIT([codeblocks], [1.0-RC2])"
2 - Install the last version of desktop-file-utils
Up (http://www.freedesktop.org/Software/desktop-file-utils)
update-desktop-database was missing in my configuration
3 - Re-compile and install C::B
Code
aclocal && autoconf && autoheader && automake --include-deps --add-missing --foreign --copy && ./configure --prefix=/usr --enable-debug=no && make && make install

Now when I execute C::B I return to my first error :
Code
codeblocks: ./bindings/sc_wxstring.cpp:300: void Register_wxString(asIScriptEngine*): Assertion `r >= 0' failed.
Aborted

Next step, now I can look at
No, currently AngelScript is the problem, it doesn't work with native calls on 64 bits yet.
But you can get C::B working, see my post here: http://forums.codeblocks.org/index.php?topic=2096.0
Title: Re: sc_wxstring.cpp:300 ... Assertion `r >= 0' failed.
Post by: mandrav on February 18, 2006, 08:13:16 pm
Fixed all issues regarding 64bit. Revision 2033 should build just fine.