I'm trying to compile the latest codeblocks source but I get this error :
macrosmanager.cpp: In member function 'void MacrosManager::Reset()':
macrosmanager.cpp:90:33: error: 'wxRE_ADVANCED' was not declared in this scope
OS?
Steps taken?
Your OS name and version?
wxWidgets version?
OS : Arch linux
wxWidgets : 2.8.12
Steps taken :
mkdir ~/devel
cd ~/devel
svn checkout http://svn.berlios.de/svnroot/repos/codeblocks/trunk
cd trunk
./bootstrap
./configure
make <-- error
I also tried with the aur repo of arch (https://aur.archlinux.org/packages.php?ID=18493 (https://aur.archlinux.org/packages.php?ID=18493)) with the same error (it try to compile from the latest source too)
Version 7174 compile but with this command ./configure --with-contrib-plugins=all I get this error with 7174 :
Expressions.h:87:5: error: 'wxRE_ADVANCED' was not declared in this scope
Expressions.h:103:5: error: 'wxRE_ADVANCED' was not declared in this scope
Self built wxWidgets or installed from distro?
In 2007, this problem was caused by not using "--with-regex=builtin" when building wxWidgets on Linux.
Tim S.
I installed wxWidgets from distro.
The problem come from this instruction : ifndef __WXMAC__
macrosmanager.cpp:90:33: error: 'wxRE_ADVANCED' was not declared in this scope
__WXMAC__ is for mac no ? If I replace wxRE_ADVANCED by wxRE_EXTENDED to test, it compile ;)
#ifndef __WXMAC__
wxRE_ADVANCED);
#else
wxRE_EXTENDED);
#endif
m_RE_To83Path.Compile(_T("\\$TO_83_PATH{([^}]*)}"),
#ifndef __WXMAC__
wxRE_ADVANCED);
#else
wxRE_EXTENDED);
#endif
m_RE_RemoveQuotes.Compile(_T("\\$REMOVE_QUOTES{([^}]*)}"),
#ifndef __WXMAC__
wxRE_ADVANCED);
#else
wxRE_EXTENDED);
#endif
Not a valid fix according to the 2007 thread.
Tim S.
No need to "fix" the code. You're using an outdated, broken wxWidgets build which was configured --with-regex=system. This is a known Arch Linux thing, and has been fixed in the mean time. Just upgrade.
Quote from: stahta01 on January 03, 2012, 05:59:39 AM
Not a valid fix according to the 2007 thread.
Tim S.
I know it is not a valid fix, it was to test ;)
Quote from: thomas on January 03, 2012, 10:43:16 AM
No need to "fix" the code. You're using an outdated, broken wxWidgets build which was configured --with-regex=system. This is a known Arch Linux thing, and has been fixed in the mean time. Just upgrade.
I use the latest and only version from the arch repo. So what I have to do ? Compile wxWidgets myself ? Install wxWidgets 2.9.2 from aur repo ?
C::B is not usable at the moment with wx2.9...
Quote from: thomas on January 03, 2012, 10:43:16 AM
No need to "fix" the code. You're using an outdated, broken wxWidgets build which was configured --with-regex=system. This is a known Arch Linux thing, and has been fixed in the mean time. Just upgrade.
I got the same problem, doesn't seem there's a "fix-through-upgrade" available yet.
I compile wxWidgets with this "--with-regex=builtin" and codeblocks compile.
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.
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 ?
Quote from: oBFusCATed on January 03, 2012, 05:12:23 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.
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.
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);
It is not that simple, you should verify that the expressions still work. Probably with the wxregexp testbed plugin.
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.
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.
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.
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 (http://developer.berlios.de/patch/?func=addpatch&group_id=5358)
Tim S.
Quote from: stahta01 on January 03, 2012, 07:32:35 PM
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.
Removing the wxMAC macro from patch; building Code::Blocks on windows right now to verify syntax error not introduced.
Tim S.
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.
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);
Anyone testing this patch should use the new option -v, when staring C::B!
The new patch still works well on Arch Linux.
But if I start codeblocks with "codeblocks -v" I get this message :
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).
Yes, it is due to the patch.
Just curiosity, but does anyone have a Mac with CB trunk with no patch on it.
What does "codeblocks -v" give?
Tim S.
It enables wx logging, I think and you get lots of annoying dialogs :)
Quote from: oBFusCATed on January 04, 2012, 09:49:17 PM
It enables wx logging, I think and you get lots of annoying dialogs :)
Yes, it was rather obvious.
I take you DO NOT have a Mac.
Tim S.
Quote from: je_rem_y 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 :
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).
Quote from: oBFusCATed on January 04, 2012, 06:11:27 PM
Yes, it is due to the patch.
You're right I recompiled wxgtk with "--with-regex=builtin" and I just have this error :
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)
It is significant/serious or not ?
Quote from: je_rem_y on January 04, 2012, 11:03:27 PM
It is significant/serious or not ?
No, that's not an issue. C::B searches on several common path's for registered scripts to open (i.e. to allow portable mode). If that fails because a folder is not present you see this warning, but only in verbose mode. Maybe we should check the path before trying to open it to avoid this message... but really: This is not an error.
Ok, but this error with the patch :
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)
Is it an issue ?
You can test it yourself, by using a TO_ABSOLUTE_PATH or TO_83_PATH macro in your project and then you can check the full log if the macro has worked. If it has worked, then the patch is OK.
It seems to not work but I don't know if my test is ok (I'm not a developer ;) ).
#include <iostream>
#if defined(TO_ABSOLUTE_PATH)
# define MESSAGE "OK"
#else
# define MESSAGE "NOT OK"
#endif
using namespace std;
int main() {
cout << MESSAGE << endl;
return 0;
}
Unless I am mistaken, these are Code::Blocks macros (http://wiki.codeblocks.org/index.php?title=Variable_expansion) (not preprocessor macros).
Try testing them in pre/post-build steps (http://wiki.codeblocks.org/index.php?title=The_build_process_of_Code::Blocks#Pre-build_and_post-build_steps).
It doesn't work too...
I have reported the wxWidgets problem to Arch developer. wxWidgets has been updated (compiled with "--with-regex=builtin") and codeblocks compile now 8)
I don't know if the problem is fixed in codeblocks code for those who don't compile wxWidgets with "--with-regex=builtin" but if not it would be nice that this is done ;)