Author Topic: Two issues with C::B 13.12 SVN with wxWidgets 3.1 on OSX 10.10  (Read 8676 times)

Offline warpino

  • Multiple posting newcomer
  • *
  • Posts: 30
Hi all,

I managed to compile both Code::Blocks and the FortranProject plugin successfully on OSX 10.10 Yosemite. So far I have two main issues:

1) The area in the FSymobl tab where the list of symbols appears cannot be stretched horizontally. It is stuck at the far left of the window with limited width, one has to scroll horizontally to read (almost letter by letter) the name of subroutines and functions. Resizing the panel does not make that area expand, as is the case for the Project or the Symbols tab, instead.

2)Any kind of Search makes the program crash, complaining of assert failing in src/osx/cocoa/combobox.mm in wxWidgets distribution, namely:

      wxASSERT_MSG( item >= 0 && item < [m_comboBox numberOfItems],
                      "Inavlid item index." );

Thank you so much for any help,

w.

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Two issues with C::B 13.12 SVN with wxWidgets 3.1 on OSX 10.10
« Reply #1 on: June 02, 2015, 09:08:00 pm »
If you want to run cb build against wx 3.x it is better to use the latest trunk sources.
There are very few fixes for wx 3.x in the 13.12 release.
(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 warpino

  • Multiple posting newcomer
  • *
  • Posts: 30
Re: Two issues with C::B 13.12 SVN with wxWidgets 3.1 on OSX 10.10
« Reply #2 on: June 02, 2015, 09:10:06 pm »
If you want to run cb build against wx 3.x it is better to use the latest trunk sources.

That's exactly what I did!

There are very few fixes for wx 3.x in the 13.12 release.

What do you mean?

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Two issues with C::B 13.12 SVN with wxWidgets 3.1 on OSX 10.10
« Reply #3 on: June 02, 2015, 09:13:06 pm »
Ignore my comment. I though that you're using the sources from 13.12.

About your problems:
1. can you show a screen shot?
2. can you paste a backtrace from a debugger?
(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 warpino

  • Multiple posting newcomer
  • *
  • Posts: 30
Re: Two issues with C::B 13.12 SVN with wxWidgets 3.1 on OSX 10.10
« Reply #4 on: June 02, 2015, 09:27:25 pm »
1. Comparison between the Symbols tab (I guess it's from the CodeCompletion plugin)



and the FSymbols tab (from the FortranProject plugin)in the Management panel



Offline warpino

  • Multiple posting newcomer
  • *
  • Posts: 30
Re: Two issues with C::B 13.12 SVN with wxWidgets 3.1 on OSX 10.10
« Reply #5 on: June 02, 2015, 09:31:12 pm »
2. the following happens whenever I use the Search menu.
 
 relevant output in the terminal where I launched codeblocks from

Code
../src/osx/cocoa/combobox.mm(209): assert "item >= 0 && item < [m_comboBox numberOfItems]" failed in SetSelectedItem(): Inavlid item index.
../src/common/sizer.cpp(2091): assert "!(flags & (wxALIGN_RIGHT | wxALIGN_CENTRE_HORIZONTAL))" failed in DoInsert(): Horizontal alignment flags are ignored with wxEXPAND

debug log:

http://pastebin.com/YZ6EDf5d
« Last Edit: June 02, 2015, 10:33:45 pm by warpino »

Offline warpino

  • Multiple posting newcomer
  • *
  • Posts: 30
Re: Two issues with C::B 13.12 SVN with wxWidgets 3.1 on OSX 10.10
« Reply #6 on: June 02, 2015, 10:38:33 pm »
I also get this in the wxWidgets debug info popup window:

http://pastebin.com/PsYYaw1m

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Two issues with C::B 13.12 SVN with wxWidgets 3.1 on OSX 10.10
« Reply #7 on: June 02, 2015, 11:32:28 pm »
About FSymbol: This tab is part of the FortranProject plugin. So it is better to report this problem to its author - http://darmar.vgtu.lt/

Can you try if this patch will resolve the search issue?

Code
diff --git a/src/sdk/findreplacedlg.cpp b/src/sdk/findreplacedlg.cpp
index f2fac92..27d2114 100644
--- a/src/sdk/findreplacedlg.cpp
+++ b/src/sdk/findreplacedlg.cpp
@@ -143,18 +143,20 @@ FindReplaceDlg::FindReplaceDlg(wxWindow* parent, const wxString& initial, bool h
     // load search path options
     XRCCTRL(*this, "txtSearchPath", wxTextCtrl)->SetValue(cfg->Read(CONF_GROUP _T("/search_path"),
                                                                     (active_project ? active_project->GetBasePath() : wxT(""))));
+    wxComboBox *cmbSearchMask = XRCCTRL(*this, "cmbSearchMask", wxComboBox);
        if(cfg->Exists(CONF_GROUP _T("/search_mask")))
        {
                // Migrate from previous config setting of "search_mask" string (since it used to be a textbox)
                // to new config setting of "search_masks" array for the combobox
-               XRCCTRL(*this, "cmbSearchMask", wxComboBox)->Append(cfg->Read(CONF_GROUP _T("/search_mask")));
+               cmbSearchMask->Append(cfg->Read(CONF_GROUP _T("/search_mask")));
                cfg->UnSet(CONF_GROUP _T("/search_mask"));
        }
        else
        {
-               FillComboWithLastValues(XRCCTRL(*this, "cmbSearchMask", wxComboBox), CONF_GROUP _T("/search_masks"));
+               FillComboWithLastValues(cmbSearchMask, CONF_GROUP _T("/search_masks"));
        }
-    XRCCTRL(*this, "cmbSearchMask", wxComboBox)->SetSelection(0);
+       if (cmbSearchMask->GetCount() > 0)
+        cmbSearchMask->SetSelection(0);
 
     XRCCTRL(*this, "chkSearchRecursively", wxCheckBox)->SetValue(cfg->ReadBool(CONF_GROUP _T("/search_recursive"), false));
     XRCCTRL(*this, "chkSearchHidden", wxCheckBox)->SetValue(cfg->ReadBool(CONF_GROUP _T("/search_hidden"), false));


(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 warpino

  • Multiple posting newcomer
  • *
  • Posts: 30
Re: Two issues with C::B 13.12 SVN with wxWidgets 3.1 on OSX 10.10
« Reply #8 on: June 03, 2015, 01:34:13 am »
Thank you so much for your help!
Now, I know this is totally OT but I am a total newbie so... could you possibly tell me how to:
1) apply the patch
2) compile and link the patched file without having to rebuild the whole project

Thanks again

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Two issues with C::B 13.12 SVN with wxWidgets 3.1 on OSX 10.10
« Reply #9 on: June 03, 2015, 01:58:17 am »
1. Probably execute patch -p1 < /path/tofile.diff in the root of the project.
2. If you're using autotools just run make and make install (if you've installed it already).
(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 Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: Two issues with C::B 13.12 SVN with wxWidgets 3.1 on OSX 10.10
« Reply #10 on: June 03, 2015, 06:13:12 am »
The layout is another thing:
in recent versions of wx3 several combinations of alignment flags that does not make sense lead to such layout errors.
I made several fixes for the C::B sources, but the fortran-plugin is not maintained by us and so the fixes are not there.
You can try to open the appropriate xrc-file in the newly compiled C::B with wxSmith, change something irrelevant (and probably change it back) and save the file.
The "new" wxSmith tries to fix these incompatible alignment flags.
The same can be done with wxs-files.
In general: wxEXPAND can not be used together with any sizer-alignment flag, because it dies not make sense and horizontal alignment flags can not be used inside sizers with wxHORIZONTAL-flag (the same is for vertical flags in wxVERTICAL-sizers).

Offline warpino

  • Multiple posting newcomer
  • *
  • Posts: 30
Re: Two issues with C::B 13.12 SVN with wxWidgets 3.1 on OSX 10.10
« Reply #11 on: June 03, 2015, 02:42:36 pm »
1. Probably execute patch -p1 < /path/tofile.diff in the root of the project.
2. If you're using autotools just run make and make install (if you've installed it already).

That's what I get:

Code
patch -p1 < patch.diff
patching file src/sdk/findreplacedlg.cpp
Hunk #1 FAILED at 143.
1 out of 1 hunk FAILED -- saving rejects to file src/sdk/findreplacedlg.cpp.rej

as I said, I'm quite newbie but looking at the patch:

Code
@@ -143,18 +143,20 @@ FindReplaceDlg::FindReplaceDlg(wxWindow* parent, const wxString& initial, bool h

The only line starting like that in my findreplacedlg.cpp is line 56:

Code
FindReplaceDlg::FindReplaceDlg(wxWindow* parent, const wxString& initial, bool hasSelection,

am I missing something?

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Two issues with C::B 13.12 SVN with wxWidgets 3.1 on OSX 10.10
« Reply #12 on: June 03, 2015, 10:24:40 pm »
Which is your head revision?
The patch is generated against rev 10316.
(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 warpino

  • Multiple posting newcomer
  • *
  • Posts: 30
Re: Two issues with C::B 13.12 SVN with wxWidgets 3.1 on OSX 10.10
« Reply #13 on: June 03, 2015, 10:47:04 pm »
I think is 10315. What can I do?

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Two issues with C::B 13.12 SVN with wxWidgets 3.1 on OSX 10.10
« Reply #14 on: June 03, 2015, 11:50:28 pm »
You can try to apply the changes manually. The method at line 56 is the correct one.
(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 MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: Two issues with C::B 13.12 SVN with wxWidgets 3.1 on OSX 10.10
« Reply #15 on: June 08, 2015, 07:26:46 am »
I made several fixes for the C::B sources, but the fortran-plugin is not maintained by us and so the fixes are not there.
If you provide them to me, I can apply the fixes.
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 juanfal

  • Multiple posting newcomer
  • *
  • Posts: 10
Re: Two issues with C::B 13.12 SVN with wxWidgets 3.1 on OSX 10.10
« Reply #16 on: June 25, 2015, 10:36:41 am »
Hi, calling for help, SOS!

trying to make C::B work with Spanish keyboard. I think some other keyboards fail too.  It is impossible to do anything when the opening-curly-brace does not work, you can imagine.

Thanks Anders F Björklund, I have known there could be some patches for src/sdk/wxscintilla/src/ScintillaWX.cpp
Code
-
-    if (key)
-        return rv;
-    else
-        return 1;
etc, etc.

It seems somehow brew could install it, and even before that, I could put the .patch files in the Cellar directories.

No luck with anything.

Nor brew can install code blocks
Code
$ brew install codeblocks
Error: No available formula for codeblocks
Searching formulae...
Searching taps...
Caskroom/cask/codeblocks
nor I can compile it from sources
Code
Making all in autorevision
/bin/sh ../../../libtool  --tag=CXX   --mode=link g++ -DTIXML_USE_STL -O2 -ffast-math -DCB_AUTOCONF  -DCB_PRECOMP -Winvalid-pch -fPIC -DPIC -fexceptions  -Wl,--no-undefined -o auto_revision auto_revision-autorevision.o ../../base/tinyxml/libtinyxml.la
libtool: link: g++ -DTIXML_USE_STL -O2 -ffast-math -DCB_AUTOCONF -DCB_PRECOMP -Winvalid-pch -fPIC -DPIC -fexceptions -Wl,--no-undefined -o auto_revision auto_revision-autorevision.o -Wl,-bind_at_load  ../../base/tinyxml/.libs/libtinyxml.a
ld: unknown option: --no-undefined
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[3]: *** [auto_revision] Error 1
make[2]: *** [all-recursive] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all-recursive] Error 1

…nothing

How could I compile, Yosemite 10.10.3, just to start to find a fix for the { problem?

Thanks


Offline stahta01

  • Lives here!
  • ****
  • Posts: 7588
    • My Best Post
Re: Two issues with C::B 13.12 SVN with wxWidgets 3.1 on OSX 10.10
« Reply #17 on: June 25, 2015, 01:44:32 pm »
Did you try the steps in this thread for homebrew http://forums.codeblocks.org/index.php/topic,20366.0.html

Tim S.


Hi, calling for help, SOS!

trying to make C::B work with Spanish keyboard. I think some other keyboards fail too.  It is impossible to do anything when the opening-curly-brace does not work, you can imagine.

Thanks Anders F Björklund, I have known there could be some patches for src/sdk/wxscintilla/src/ScintillaWX.cpp
Code
-
-    if (key)
-        return rv;
-    else
-        return 1;
etc, etc.

It seems somehow brew could install it, and even before that, I could put the .patch files in the Cellar directories.

No luck with anything.

Nor brew can install code blocks
Code
$ brew install codeblocks
Error: No available formula for codeblocks
Searching formulae...
Searching taps...
Caskroom/cask/codeblocks
…nothing

How could I compile, Yosemite 10.10.3, just to start to find a fix for the { problem?

Thanks
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 afb

  • Developer
  • Lives here!
  • *****
  • Posts: 884
Re: Two issues with C::B 13.12 SVN with wxWidgets 3.1 on OSX 10.10
« Reply #18 on: June 28, 2015, 12:29:15 pm »
I haven't submitted the formula yet, since homebrew wants release versions (and not only --HEAD)
And the "last release" (13.12) doesn't work with wxWidgets 3, so think it'll have to wait until next release.

Stable versions

Formulae in the core repository must have a stable version tagged by the upstream project. Tarballs are preferred to git checkouts, and tarballs should include the version in the filename whenever possible.

For the actual error, I think the fix was as simple as:
Code
 inreplace "configure", "-Wl,--no-undefined", "-Wl,-undefined,error"

This fix and the fix for *.so (vs *.dylib) should be prepared to be fixed properly/upstream, for OS X.
Currently this is left as an exercise for the reader, Code::Blocks needs real OS X developer to volunteer.

But if you want to apply some additional patches, you can probably just throw them in at the end:
https://github.com/afb/homebrew/blob/codeblocks-osx/Library/Formula/codeblocks.rb