Author Topic: Codesnippets cannot be linked with C::B under linux  (Read 24511 times)

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: Codesnippets cannot be linked with C::B under linux
« Reply #15 on: July 15, 2008, 01:02:19 am »
"CheckForModifiedFiles" works now (again) .
Tested on Linux 64bit and on w2k (32bit).

The crash on uninstall occurs on Linux and on Windows.
On Linux it's a segfault in the destructor of the "wxBusyCursor" used in "void PluginsConfigurationDlg::OnUninstall(wxCommandEvent& event)".

It might be that uninstalling codesnippets-plugin does something harmfull to the stack.

I don't know if the crash happens in the same piece of code in Windows.
Perhaps I try it ou tomorrow.

Offline Pecan

  • Plugin developer
  • Lives here!
  • ****
  • Posts: 2750
Re: Codesnippets cannot be linked with C::B under linux
« Reply #16 on: July 15, 2008, 01:34:20 am »
I don't know if the crash happens in the same piece of code in Windows.
Perhaps I try it ou tomorrow.

Yes, the crash does happen on XP with gcc345 also. This seems to happen to me when I use a wxEVT_IDLE routine. Usually, I have to disable the plugin first, then restart CB, then the uninstall runs ok.

I've never found the root of the problem.
Code
Program received signal SIGSEGV, Segmentation fault.
0x101b17fb in wxAppBase::SendIdleEvents ()
   from c:\usr\bin\wxmsw28u_gcc_custom.dll
(gdb) bt
#0  0x101b17fb in wxAppBase::SendIdleEvents ()
   from c:\usr\bin\wxmsw28u_gcc_custom.dll
#1  0x101b1828 in wxAppBase::SendIdleEvents ()
   from c:\usr\bin\wxmsw28u_gcc_custom.dll
#2  0x101b16fe in wxAppBase::ProcessIdle ()
   from c:\usr\bin\wxmsw28u_gcc_custom.dll
#3  0x101e253f in wxEventLoopManual::Run ()
   from c:\usr\bin\wxmsw28u_gcc_custom.dll
#4  0x1015b79b in wxDialog::ShowModal ()
   from c:\usr\bin\wxmsw28u_gcc_custom.dll
#5  0x618aaa51 in PluginManager::Configure (this=0x1bacb08)
    at c:/Usr/Proj/cbBeta/trunk/src/sdk/pluginmanager.cpp:1431
#6  0x00446fc5 in MainFrame::OnSettingsPlugins (this=0x14b9bb0,
    event=@0x22f8ec) at c:/Usr/Proj/cbBeta/trunk/src/src/main.cpp:4067
#7  0x100c70d5 in wxEvtHandler::ProcessEventIfMatches ()
   from c:\usr\bin\wxmsw28u_gcc_custom.dll
#8  0x100c742c in wxEventHashTable::HandleEvent ()
   from c:\usr\bin\wxmsw28u_gcc_custom.dll
#9  0x100c83f9 in wxEvtHandler::ProcessEvent ()
   from c:\usr\bin\wxmsw28u_gcc_custom.dll
#10 0x100c8399 in wxEvtHandler::ProcessEvent ()
   from c:\usr\bin\wxmsw28u_gcc_custom.dll
#11 0x100c8399 in wxEvtHandler::ProcessEvent ()
---Type <return> to continue, or q <return> to quit---
   from c:\usr\bin\wxmsw28u_gcc_custom.dll
#12 0x100c8399 in wxEvtHandler::ProcessEvent ()
   from c:\usr\bin\wxmsw28u_gcc_custom.dll
#13 0x100c8399 in wxEvtHandler::ProcessEvent ()
   from c:\usr\bin\wxmsw28u_gcc_custom.dll
#14 0x100c8399 in wxEvtHandler::ProcessEvent ()
   from c:\usr\bin\wxmsw28u_gcc_custom.dll
#15 0x100c8399 in wxEvtHandler::ProcessEvent ()
   from c:\usr\bin\wxmsw28u_gcc_custom.dll
#16 0x100c8399 in wxEvtHandler::ProcessEvent ()
   from c:\usr\bin\wxmsw28u_gcc_custom.dll
#17 0x100c8399 in wxEvtHandler::ProcessEvent ()
   from c:\usr\bin\wxmsw28u_gcc_custom.dll
#18 0x100c8399 in wxEvtHandler::ProcessEvent ()
   from c:\usr\bin\wxmsw28u_gcc_custom.dll
#19 0x100c8399 in wxEvtHandler::ProcessEvent ()
   from c:\usr\bin\wxmsw28u_gcc_custom.dll
#20 0x100c8399 in wxEvtHandler::ProcessEvent ()
   from c:\usr\bin\wxmsw28u_gcc_custom.dll
#21 0x100c8399 in wxEvtHandler::ProcessEvent ()
   from c:\usr\bin\wxmsw28u_gcc_custom.dll
#22 0x100c8399 in wxEvtHandler::ProcessEvent ()
   from c:\usr\bin\wxmsw28u_gcc_custom.dll
---Type <return> to continue, or q <return> to quit---
« Last Edit: July 15, 2008, 01:44:34 am by Pecan »

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: Codesnippets cannot be linked with C::B under linux
« Reply #17 on: July 15, 2008, 11:09:39 am »
...The "codesnippets.exe" stand-alone executable does not work...
Thanks, fixed in svn 5126
I saw the changes and it's working now. ;-)

But... You quote all over the files that C::B is lying when it comes to GetConfigFolder(), but C::B is *not*. This method returns the current path of config files, which really is the one returned. What you are looking for is a special file, named [personality].conf under a special case, in the case of relocation (portable C::B). If you want to retrieve this file then the C::B documentation states what you have to do. You need to do something like:

Code
    PersonalityManager* PersMan = Manager::Get()->GetPersonalityManager();
    wxString personality = PersMan->GetPersonality();
    ConfigManager* CfgMan = Manager::Get()->GetConfigManager(_T("app"));
    wxString current_conf_file = CfgMan->LocateDataFile(personality+_T(".conf"), sdAllKnown);

This way, current_conf_file is retrieved "the right way". Hence the config folder may be different. This is just a special case if ConfigManager::relo is true.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline Pecan

  • Plugin developer
  • Lives here!
  • ****
  • Posts: 2750
Re: Codesnippets cannot be linked with C::B under linux
« Reply #18 on: July 15, 2008, 03:15:19 pm »
...The "codesnippets.exe" stand-alone executable does not work...
Thanks, fixed in svn 5126
I saw the changes and it's working now. ;-)

But... You quote all over the files that C::B is lying when it comes to GetConfigFolder(), but C::B is *not*. This method returns the current path of config files, which really is the one returned. What you are looking for is a special file, named [personality].conf under a special case, in the case of relocation (portable C::B). If you want to retrieve this file then the C::B documentation states what you have to do. You need to do something like:

Code
    PersonalityManager* PersMan = Manager::Get()->GetPersonalityManager();
    wxString personality = PersMan->GetPersonality();
    ConfigManager* CfgMan = Manager::Get()->GetConfigManager(_T("app"));
    wxString current_conf_file = CfgMan->LocateDataFile(personality+_T(".conf"), sdAllKnown);

This way, current_conf_file is retrieved "the right way". Hence the config folder may be different. This is just a special case if ConfigManager::relo is true.


Ok, I give...

I've spent an hour searching Google, the forum, the web site, and the wiki for "::relo",  "documentation", "sdk documentation", "CodeBlocks documentation",etc.

The info mentioned must be under a different search term.

Could you point me to "the C::B documentation" that  "states what you have to do."

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: Codesnippets cannot be linked with C::B under linux
« Reply #19 on: July 15, 2008, 04:15:16 pm »
Could you point me to "the C::B documentation" that  "states what you have to do."
Sure thing: ;-)

Take a look at SDK documentation of the ConfigManager class, especially the description of ConfigManager::LocateDataFile(). The SDK docu which you can d/l from BerliOS should have this included, too (obviously).

Edit: Forgotten to add the link:
http://prdownload.berlios.de/codeblocks/codeblocks_sdk_doc_r5046.chm
« Last Edit: July 15, 2008, 04:25:55 pm by MortenMacFly »
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline PsYhLo

  • Almost regular
  • **
  • Posts: 157
Re: Codesnippets cannot be linked with C::B under linux
« Reply #20 on: July 16, 2008, 02:19:14 pm »
Code
g++ -DHAVE_CONFIG_H -I. -I../../../../../src/include -I/usr/lib/wx/include/gtk2-unicode-release-2.8 -I/usr/include/wx-2.8 -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES -D__WXGTK__ -pthread -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/freetype2 -I/usr/include/libpng12 -I/usr/include/pixman-1   -I../../../../../src/include -I../../../../../src/include/wxscintilla/include -I../../../../../src/plugins/contrib/codesnippets -I../../../../../src/plugins/contrib/codesnippets/Search -I../../../../../src/plugins/contrib/codesnippets/editor -I../../../../../src/include/wxFlatNotebook/include  -Ulinux -Uunix  -O2 -ffast-math -g -O2 -DCB_PRECOMP -Winvalid-pch -fPIC -DPIC -fexceptions -MT editproperties.o -MD -MP -MF .deps/editproperties.Tpo -c -o editproperties.o `test -f '../editor/editproperties.cpp' || echo './'`../editor/editproperties.cpp
mv -f .deps/editproperties.Tpo .deps/editproperties.Po
make[1]: *** No rule to make target `../prefs.cpp', needed by `prefs.o'.  Stop.
make[1]: Leaving directory `/home/psyhlo/devel/cb-src/src/plugins/contrib/codesnippets/resources'
make: *** [all-recursive] Error 1

latest svn 5129

linux Ubuntu 8.04 gcc ver 4.2.3
« Last Edit: July 16, 2008, 02:30:23 pm by PsYhLo »

Offline Pecan

  • Plugin developer
  • Lives here!
  • ****
  • Posts: 2750
Re: Codesnippets cannot be linked with C::B under linux
« Reply #21 on: July 16, 2008, 03:13:15 pm »
Code
g++ -DHAVE_CONFIG_H -I. -I../../../../../src/include -I/usr/lib/wx/include/gtk2-unicode-release-2.8 -I/usr/include/wx-2.8 -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES -D__WXGTK__ -pthread -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/freetype2 -I/usr/include/libpng12 -I/usr/include/pixman-1   -I../../../../../src/include -I../../../../../src/include/wxscintilla/include -I../../../../../src/plugins/contrib/codesnippets -I../../../../../src/plugins/contrib/codesnippets/Search -I../../../../../src/plugins/contrib/codesnippets/editor -I../../../../../src/include/wxFlatNotebook/include  -Ulinux -Uunix  -O2 -ffast-math -g -O2 -DCB_PRECOMP -Winvalid-pch -fPIC -DPIC -fexceptions -MT editproperties.o -MD -MP -MF .deps/editproperties.Tpo -c -o editproperties.o `test -f '../editor/editproperties.cpp' || echo './'`../editor/editproperties.cpp
mv -f .deps/editproperties.Tpo .deps/editproperties.Po
make[1]: *** No rule to make target `../prefs.cpp', needed by `prefs.o'.  Stop.
make[1]: Leaving directory `/home/psyhlo/devel/cb-src/src/plugins/contrib/codesnippets/resources'
make: *** [all-recursive] Error 1

latest svn 5129

linux Ubuntu 8.04 gcc ver 4.2.3

pref.h is now in the ..\editor directory. Make sure you do a clean.

Offline killerbot

  • Administrator
  • Lives here!
  • *****
  • Posts: 5490
Re: Codesnippets cannot be linked with C::B under linux
« Reply #22 on: July 16, 2008, 05:10:22 pm »
haha, i have the same issue, make clean, even a new ./configure does NOT help

Seems like the only option might be do a fresh svn checkout and delete the existing stuff. Enjoy :-(

Offline Pecan

  • Plugin developer
  • Lives here!
  • ****
  • Posts: 2750
Re: Codesnippets cannot be linked with C::B under linux
« Reply #23 on: July 16, 2008, 05:30:58 pm »
haha, i have the same issue, make clean, even a new ./configure does NOT help

Seems like the only option might be do a fresh svn checkout and delete the existing stuff. Enjoy :-(

Would you clarify that for me?

When I did an svn update on Ubuntu 8.02 it automatically deleted the old editor files for me. Why didn't it do that for you?

I then did a make clean to get rid of old .o files, then ./bootstrap, ./configure ..., make. It worked.

What's different here?
What can I do to make the process smoother?
« Last Edit: July 16, 2008, 05:32:39 pm by Pecan »

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: Codesnippets cannot be linked with C::B under linux
« Reply #24 on: July 16, 2008, 05:45:18 pm »
... , even a new ./configure does NOT help

Did you also run "./bootstrap" ?

I'm not sure, but I guess the directory/file-structure might go into "Makefile.in" and therefore into "Makefile" when doing "./configure".
And if that's right you need to run "./bootstrap" to generate a new "Makefile.in" first.

I cannot test in the moment, because I only have my USB-Stick with very rudimentary build-tools at wok today.

Offline killerbot

  • Administrator
  • Lives here!
  • *****
  • Posts: 5490
Re: Codesnippets cannot be linked with C::B under linux
« Reply #25 on: July 16, 2008, 06:47:19 pm »
I have just tried, the chain starting from ./boostrap  --> no luck
how joly nice, time for a fresh svn checkout

Offline PsYhLo

  • Almost regular
  • **
  • Posts: 157
Re: Codesnippets cannot be linked with C::B under linux
« Reply #26 on: July 16, 2008, 07:33:36 pm »
after the fresh svn it compiles without any problem

Offline killerbot

  • Administrator
  • Lives here!
  • *****
  • Posts: 5490
Re: Codesnippets cannot be linked with C::B under linux
« Reply #27 on: July 16, 2008, 07:48:01 pm »
same for me: fresh svn checkout --> OK

Offline keenblade

  • Multiple posting newcomer
  • *
  • Posts: 36
  • tao
    • keenblade
Re: Codesnippets cannot be linked with C::B under linux
« Reply #28 on: July 17, 2008, 08:02:25 pm »
I have just tried, the chain starting from ./boostrap  --> no luck
how joly nice, time for a fresh svn checkout
svn rev:5133 and C::B still doesn't compile. Isn't it possible without a fresh svn checkout?
This seems a little odd to me why the fresh svn checkout needed for some of us.
Is it a svn bug? I think a git repo would be cool.
Anyway it\'s all the same at the end...

Offline killerbot

  • Administrator
  • Lives here!
  • *****
  • Posts: 5490
Re: Codesnippets cannot be linked with C::B under linux
« Reply #29 on: July 17, 2008, 08:49:36 pm »
note that another build issue got introduced which is solved in rev v5135