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 : 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
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
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);
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.
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);
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).
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.
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 ?
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 ?
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;
}