Hi
I am using Code::Block 17.2 on windows 10 and I can't include <regex.h>.
I tried to add this search directory C:\Program Files (x86)\CodeBlocks\MinGW\lib\gcc\mingw32\5.1.0\include\c++ but this is not working.
Thanks
You must include <regex>, not <regex.h>
Thanks Miguel
Unfortunately I have tried also
Quote#include <regex>
, but the result is always
Quote... fatal error: regex: No such file or directory|
best regards
Then post a full rebuild log:
http://wiki.codeblocks.org/index.php?title=FAQ-Compiling_%28general%29#Q:_How_do_I_report_a_compilation_problem_on_the_forums.3F
I am running Code::Blocks version 17.12 on Windows 10
Build log:
-------------- Build file: "no target" in "no project" (compiler: unknown)---------------
mingw32-gcc.exe -I"C:\Program Files (x86)\CodeBlocks\MinGW\lib\gcc\mingw32\5.1.0\include\c++\bits" -c C:\Sviluppo\fGenTK\C\re.c -o C:\Sviluppo\fGenTK\C\re.o
mingw32-g++.exe -o C:\Sviluppo\fGenTK\C\re.exe C:\Sviluppo\fGenTK\C\re.o
C:\Sviluppo\fGenTK\C\re.c:4:17: fatal error: regex: No such file or directory
compilation terminated.
Process terminated with status 1 (0 minute(s), 0 second(s))
1 error(s), 0 warning(s) (0 minute(s), 0 second(s))
I have already tried ...
#include <bits/regex.h>
... but none of them worked.
TDM 5.1.0 may have no regex, is there a regex file (with no extension) here?
C:\Program Files (x86)\CodeBlocks\MinGW\lib\gcc\mingw32\5.1.0\include\c++
If so, that's the path you must add as search directory. If not so, update MinGW to a newer version.
I suggest either using a Code::Blocks project or finding another IDE.
C::B is designed to use C::B projects; it does a very poor job when not using C::B projects.
http://wiki.codeblocks.org/index.php/Creating_a_new_project (http://wiki.codeblocks.org/index.php/Creating_a_new_project)
Tim S.
@stahta01: Why suggest something that is not helpful? The current problem is not related to the use of projects! Read below for details.
@Rossati: Please rename your file to have .cpp as extension. You're currently using .c which means you're compiling in C mode and not in C++ mode! After that if you have problems with the missing header then you'll need to update your compiler because it might not be available in this version of GCC!
Also next time you could read our FAQ. This problem is specifically addressed there!
Thanks to all
These suggestions have been useful to me:
- C:\Program Files (x86)\CodeBlocks\MinGW\lib\gcc\mingw32\5.1.0\include\c++ contains regex (Miguel)
- Changed estension to .cpp ( oBFusCATed)
- I set -std=c+11 (compilation warning)
Unfortunately, an example of using regular expressions that I try to compile, gives me many errors, but this is only my problem.
Best regards