Author Topic: CodeBlocks compiling fail  (Read 30620 times)

Offline je_rem_y

  • Multiple posting newcomer
  • *
  • Posts: 15
Re: CodeBlocks compiling fail
« Reply #15 on: January 03, 2012, 07:09:01 pm »
Since wxWidgets is not necessarily compiled with "--with-regex=builtin", it might be a good idea to add a condition to handle this case right ?

Offline polylux

  • Single posting newcomer
  • *
  • Posts: 7
Re: CodeBlocks compiling fail
« Reply #16 on: January 03, 2012, 07:13:48 pm »
The only thing you could do is to report a bug to the maintainers of wxGTK in Arch.
Building separate version of wxgtk is a workaround with high maintenance cost.

I agree. It's necessary to fix the issue in the repo version. I go write a bug report for that. Thanks everyone.

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7608
    • My Best Post
Re: CodeBlocks compiling fail
« Reply #17 on: January 03, 2012, 07:16:44 pm »
I am willing to post a patch to svn trunk that fixes part of this problem.
But, it will not be perfect.

Edit: It will require testing on your part.

Does anyone wish me to do so?

Tim S.

Patch of first location needed; more locations are still needed to be patched.

Code
Index: src/sdk/macrosmanager.cpp
===================================================================
--- src/sdk/macrosmanager.cpp (revision 7657)
+++ src/sdk/macrosmanager.cpp (working copy)
@@ -86,7 +86,7 @@
     m_RE_IfSp.Compile(_T("[^=!<>]+|(([^=!<>]+)[ ]*(=|==|!=|>|<|>=|<=)[ ]*([^=!<>]+))"), wxRE_EXTENDED | wxRE_NEWLINE);
     m_RE_Script.Compile(_T("(\\[\\[(.*)\\]\\])"), wxRE_EXTENDED | wxRE_NEWLINE);
     m_RE_ToAbsolutePath.Compile(_T("\\$TO_ABSOLUTE_PATH{([^}]*)}"),
-#ifndef __WXMAC__
+#if !defined(__WXMAC__) && defined(wxHAS_REGEX_ADVANCED)
                                 wxRE_ADVANCED);
 #else
                                 wxRE_EXTENDED);
« Last Edit: January 03, 2012, 07:22:52 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 oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: CodeBlocks compiling fail
« Reply #18 on: January 03, 2012, 07:25:13 pm »
It is not that simple, you should verify that the expressions still work. Probably with the wxregexp testbed plugin.
(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 stahta01

  • Lives here!
  • ****
  • Posts: 7608
    • My Best Post
Re: CodeBlocks compiling fail
« Reply #19 on: January 03, 2012, 07:32:35 pm »
Patch that needs tested. Note: It is not worth my time to test it.
The users under Linux with the problem needs to test it.
After, they test it please think about submitting it as a patch to the proper Code::Blocks site.

EDIT2: Possible flaw of patch the defining of wxHAS_REGEX_ADVANCED; I can not find it under windows.
EDIT3: Found it. Wrote a simple wx Program to confirm it is defined for windows wx Build.

Code
Index: src/sdk/macrosmanager.cpp
===================================================================
--- src/sdk/macrosmanager.cpp (revision 7657)
+++ src/sdk/macrosmanager.cpp (working copy)
@@ -86,19 +86,19 @@
     m_RE_IfSp.Compile(_T("[^=!<>]+|(([^=!<>]+)[ ]*(=|==|!=|>|<|>=|<=)[ ]*([^=!<>]+))"), wxRE_EXTENDED | wxRE_NEWLINE);
     m_RE_Script.Compile(_T("(\\[\\[(.*)\\]\\])"), wxRE_EXTENDED | wxRE_NEWLINE);
     m_RE_ToAbsolutePath.Compile(_T("\\$TO_ABSOLUTE_PATH{([^}]*)}"),
-#ifndef __WXMAC__
+#if !defined(__WXMAC__) && defined(wxHAS_REGEX_ADVANCED)
                                 wxRE_ADVANCED);
 #else
                                 wxRE_EXTENDED);
 #endif
     m_RE_To83Path.Compile(_T("\\$TO_83_PATH{([^}]*)}"),
-#ifndef __WXMAC__
+#if !defined(__WXMAC__) && defined(wxHAS_REGEX_ADVANCED)
                                 wxRE_ADVANCED);
 #else
                                 wxRE_EXTENDED);
 #endif
     m_RE_RemoveQuotes.Compile(_T("\\$REMOVE_QUOTES{([^}]*)}"),
-#ifndef __WXMAC__
+#if !defined(__WXMAC__) && defined(wxHAS_REGEX_ADVANCED)
                                 wxRE_ADVANCED);
 #else
                                 wxRE_EXTENDED);
Index: src/plugins/contrib/ToolsPlus/PipedProcessCtrl.cpp
===================================================================
--- src/plugins/contrib/ToolsPlus/PipedProcessCtrl.cpp (revision 7657)
+++ src/plugins/contrib/ToolsPlus/PipedProcessCtrl.cpp (working copy)
@@ -206,7 +206,12 @@
 
 void PipedProcessCtrl::ParseLinks(int lineno, int lastline)
 {
-    wxRegEx re(m_linkregex,wxRE_ADVANCED|wxRE_NEWLINE);
+    #ifdef wxHAS_REGEX_ADVANCED
+        wxRegEx re(m_linkregex,wxRE_ADVANCED|wxRE_NEWLINE);
+    #else
+        wxRegEx re(m_linkregex,wxRE_EXTENDED|wxRE_NEWLINE);
+    #endif
+
     while(lineno<lastline)
     {
         int col=0;
@@ -305,7 +310,11 @@
     wxString text=m_textctrl->GetTextRange(start,end+1);
 
     //retrieve the file and line number parts of the link
-    wxRegEx re(m_linkregex,wxRE_ADVANCED|wxRE_NEWLINE);
+    #ifdef wxHAS_REGEX_ADVANCED
+        wxRegEx re(m_linkregex,wxRE_ADVANCED|wxRE_NEWLINE);
+    #else
+        wxRegEx re(m_linkregex,wxRE_EXTENDED|wxRE_NEWLINE);
+    #endif
     wxString file;
     long line;
     if(!re.Matches(text))
Index: src/plugins/contrib/DoxyBlocks/Expressions.h
===================================================================
--- src/plugins/contrib/DoxyBlocks/Expressions.h (revision 7657)
+++ src/plugins/contrib/DoxyBlocks/Expressions.h (working copy)
@@ -84,7 +84,7 @@
     "([^)]*)?"                      // The function's parameters.
     "\\)"                           // The closing parenthesis.
     ),
-#ifndef __WXMAC__
+#if !defined(__WXMAC__) && defined(wxHAS_REGEX_ADVANCED)
     wxRE_ADVANCED);
 #else
     wxRE_EXTENDED);
@@ -104,7 +104,7 @@
     "([^)]*)?"                      // The function's parameters.
     "\\)"                           // The closing parenthesis.
     ),
-#ifndef __WXMAC__
+#if !defined(__WXMAC__) && defined(wxHAS_REGEX_ADVANCED)
     wxRE_ADVANCED);
 #else
     wxRE_EXTENDED);

Tim S.

« Last Edit: January 03, 2012, 08:10:53 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 je_rem_y

  • Multiple posting newcomer
  • *
  • Posts: 15
Re: CodeBlocks compiling fail
« Reply #20 on: January 04, 2012, 12:25:53 am »
I tested your patch and it work perfectly (with all plugins too).
Great work, thank you ;)

It would be nice that it be added to the codeblocks source.

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7608
    • My Best Post
Re: CodeBlocks compiling fail
« Reply #21 on: January 04, 2012, 12:28:48 am »
Feel free to submit to the Code::Blocks site; I do NOT have the time to keep it up to date till the devs approve it. Also, it needs more testing before the devs should even think about approving it.

http://developer.berlios.de/patch/?func=addpatch&group_id=5358

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 MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: CodeBlocks compiling fail
« Reply #22 on: January 04, 2012, 07:21:21 am »
Patch that needs tested. Note: It is not worth my time to test it.
OK, I think this patch is fine, but I believe you can safely remove the __WXMAC__ stuff, thus checking only for wxHAS_REGEX_ADVANCED should work on the Mac, too. I was under the impression that this was a Mac only issue, but it isn't as you see.
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 stahta01

  • Lives here!
  • ****
  • Posts: 7608
    • My Best Post
Re: CodeBlocks compiling fail
« Reply #23 on: January 04, 2012, 02:47:55 pm »
Removing the wxMAC macro from patch; building Code::Blocks on windows right now to verify syntax error not introduced.

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 stahta01

  • Lives here!
  • ****
  • Posts: 7608
    • My Best Post
Re: CodeBlocks compiling fail
« Reply #24 on: January 04, 2012, 03:57:32 pm »
Updated patch; still not really well tested. But, really not very major changes.
Should be verified it compiles for at least Linux and Mac would be good idea.

No Functional testing done by me; just compile only testing.

Tim S.

Code
Index: src/sdk/macrosmanager.cpp
===================================================================
--- src/sdk/macrosmanager.cpp (revision 7665)
+++ src/sdk/macrosmanager.cpp (working copy)
@@ -86,19 +86,19 @@
     m_RE_IfSp.Compile(_T("[^=!<>]+|(([^=!<>]+)[ ]*(=|==|!=|>|<|>=|<=)[ ]*([^=!<>]+))"), wxRE_EXTENDED | wxRE_NEWLINE);
     m_RE_Script.Compile(_T("(\\[\\[(.*)\\]\\])"), wxRE_EXTENDED | wxRE_NEWLINE);
     m_RE_ToAbsolutePath.Compile(_T("\\$TO_ABSOLUTE_PATH{([^}]*)}"),
-#ifndef __WXMAC__
+#ifdef wxHAS_REGEX_ADVANCED
                                 wxRE_ADVANCED);
 #else
                                 wxRE_EXTENDED);
 #endif
     m_RE_To83Path.Compile(_T("\\$TO_83_PATH{([^}]*)}"),
-#ifndef __WXMAC__
+#ifdef wxHAS_REGEX_ADVANCED
                                 wxRE_ADVANCED);
 #else
                                 wxRE_EXTENDED);
 #endif
     m_RE_RemoveQuotes.Compile(_T("\\$REMOVE_QUOTES{([^}]*)}"),
-#ifndef __WXMAC__
+#ifdef wxHAS_REGEX_ADVANCED
                                 wxRE_ADVANCED);
 #else
                                 wxRE_EXTENDED);
Index: src/plugins/contrib/ToolsPlus/PipedProcessCtrl.cpp
===================================================================
--- src/plugins/contrib/ToolsPlus/PipedProcessCtrl.cpp (revision 7665)
+++ src/plugins/contrib/ToolsPlus/PipedProcessCtrl.cpp (working copy)
@@ -206,7 +206,12 @@
 
 void PipedProcessCtrl::ParseLinks(int lineno, int lastline)
 {
-    wxRegEx re(m_linkregex,wxRE_ADVANCED|wxRE_NEWLINE);
+    #ifdef wxHAS_REGEX_ADVANCED
+        wxRegEx re(m_linkregex,wxRE_ADVANCED|wxRE_NEWLINE);
+    #else
+        wxRegEx re(m_linkregex,wxRE_EXTENDED|wxRE_NEWLINE);
+    #endif
+
     while(lineno<lastline)
     {
         int col=0;
@@ -305,7 +310,11 @@
     wxString text=m_textctrl->GetTextRange(start,end+1);
 
     //retrieve the file and line number parts of the link
-    wxRegEx re(m_linkregex,wxRE_ADVANCED|wxRE_NEWLINE);
+    #ifdef wxHAS_REGEX_ADVANCED
+        wxRegEx re(m_linkregex,wxRE_ADVANCED|wxRE_NEWLINE);
+    #else
+        wxRegEx re(m_linkregex,wxRE_EXTENDED|wxRE_NEWLINE);
+    #endif
     wxString file;
     long line;
     if(!re.Matches(text))
Index: src/plugins/contrib/DoxyBlocks/Expressions.h
===================================================================
--- src/plugins/contrib/DoxyBlocks/Expressions.h (revision 7665)
+++ src/plugins/contrib/DoxyBlocks/Expressions.h (working copy)
@@ -84,7 +84,7 @@
     "([^)]*)?"                      // The function's parameters.
     "\\)"                           // The closing parenthesis.
     ),
-#ifndef __WXMAC__
+#ifdef wxHAS_REGEX_ADVANCED
     wxRE_ADVANCED);
 #else
     wxRE_EXTENDED);
@@ -104,7 +104,7 @@
     "([^)]*)?"                      // The function's parameters.
     "\\)"                           // The closing parenthesis.
     ),
-#ifndef __WXMAC__
+#ifdef wxHAS_REGEX_ADVANCED
     wxRE_ADVANCED);
 #else
     wxRE_EXTENDED);
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: CodeBlocks compiling fail
« Reply #25 on: January 04, 2012, 04:01:37 pm »
Anyone testing this patch should use the new option -v, when staring C::B!
(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 je_rem_y

  • Multiple posting newcomer
  • *
  • Posts: 15
Re: CodeBlocks compiling fail
« Reply #26 on: January 04, 2012, 05:54:09 pm »
The new patch still works well on Arch Linux.

But if I start codeblocks with "codeblocks -v" I get this message :
Code
17:46:29: Invalid regular expression '\[([A-z]:)(.*) @ ([0-9]+)\]': Fin d'intervalle invalide
17:46:29: Invalid regular expression '[0-9]+[ ]+([A-Fa-f0-9]+)[ ]+[A-Fa-f0-9]+[ ]+(.*)\[([A-z]:)(.*) @ ([0-9]+)\]': Fin d'intervalle invalide
17:46:29: Invalid regular expression '[ ]([A-z]+.*)[ ]+\[([A-z]:)(.*) @ ([0-9]+)\]': Fin d'intervalle invalide
17:46:29: Invalid regular expression '([A-z0-9]+)[ ]+(0x[0-9A-Fa-f]+)[ ]+(.*)': Fin d'intervalle invalide
17:46:32: Invalid regular expression '\$TO_ABSOLUTE_PATH{([^}]*)}': Contenu invalide de \{\}
17:46:32: Invalid regular expression '\$TO_83_PATH{([^}]*)}': Contenu invalide de \{\}
17:46:32: Invalid regular expression '\$REMOVE_QUOTES{([^}]*)}': Contenu invalide de \{\}
17:46:37: can't open file 'plugin_find_broken_files.script' (error 2: Aucun fichier ou dossier de ce type)
17:46:37: can't open file '/usr/local/share/codeblocks/scripts/plugin_find_broken_files.script' (error 2: Aucun fichier ou dossier de ce type)
17:46:37: can't open file '' (error 2: Aucun fichier ou dossier de ce type)

I don't know if it's due to the patch or not (I hope not).
« Last Edit: January 05, 2012, 02:58:07 am by je_rem_y »

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: CodeBlocks compiling fail
« Reply #27 on: January 04, 2012, 06:11:27 pm »
Yes, it is due to the patch.
(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 stahta01

  • Lives here!
  • ****
  • Posts: 7608
    • My Best Post
Re: CodeBlocks compiling fail
« Reply #28 on: January 04, 2012, 09:40:36 pm »
Just curiosity, but does anyone have a Mac with CB trunk with no patch on it.

What does "codeblocks -v" give?

Tim S.
« Last Edit: January 04, 2012, 09:45:35 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 oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: CodeBlocks compiling fail
« Reply #29 on: January 04, 2012, 09:49:17 pm »
It enables wx logging, I think and you get lots of annoying dialogs :)
(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!]