Installing MinGW / gdb on Winodws

CodeLite installation/troubleshooting forum
Fred
CodeLite Enthusiast
Posts: 43
Joined: Mon Jul 02, 2012 12:53 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: Installing MinGW / gdb on Winodws

Post by Fred »

There is a bug in MinGW 4.6.1 oaidl.h:
http://permalink.gmane.org/gmane.comp.g ... ounce/2392
You can patch it like this:

Code: Select all

/* moved to top to avoid circular dependency with oleauto.h */
#ifndef COM_NO_WINDOWS_H
#include <windows.h>
#include <ole2.h>
#endif

#ifndef _OAIDL_H
#define _OAIDL_H
#if __GNUC__ >= 3
#pragma GCC system_header
#endif
/* causes here circular dependency with oleauto.h -> moved to top
#ifndef COM_NO_WINDOWS_H
#include <windows.h>
#include <ole2.h>
#endif
*/
#ifdef __cplusplus
extern "C" {
#endif
...
Regards,
Fred
meirab100
CodeLite Curious
Posts: 3
Joined: Sun Nov 17, 2013 1:11 am
Genuine User: Yes
IDE Question: c++
Contact:

Re: Installing MinGW / gdb on Winodws

Post by meirab100 »

i use win10 pro/64 bit + codelite 10.0.3 + boost 1.6.3 + mingw gcc/64.
after install and connect to mingw/gcc path, i try to build a simple program:

#include <iostream>
#include <string>
#include <boost/regex.hpp>
using namespace std;
using namespace boost;
int main() {
string s = "This is my simple sample text, really.";
regex re(",|:|-|\s+");
sregex_token_iterator my_iter(s.begin( ), s.end( ), re, -1);
sregex_token_iterator my_end;
while (my_iter != my_end)
cout << *my_iter++ << 'n';
return (EXIT_SUCCESS);
}

and the result i get is (it cannot find the place of: <iostream>):

C:\Windows\system32\cmd.exe /C C:/MinGW/bin/make.exe -j2 SHELL=cmd.exe -e -f Makefile
"----------Building project:[ cl_regex_1 - Debug ]----------"
make.exe[1]: Entering directory 'C:/schmidt_CODELITE/test1/cl_regex_1'
C:/MinGW/bin/gcc.exe -c "C:/schmidt_CODELITE/test1/cl_regex_1/main.c" -g -O0 -Wall -o ./Debug/main.c.o -IC:\boost_1_63_0_GCC -I. -I. -IC:\boost_1_63_0_GCC
C:/schmidt_CODELITE/test1/cl_regex_1/main.c:1:20: fatal error: iostream: No such file or directory
#include <iostream>
^
compilation terminated.
make.exe[1]: *** [cl_regex_1.mk:97: Debug/main.c.o] Error 1
make.exe[1]: Leaving directory 'C:/schmidt_CODELITE/test1/cl_regex_1'
make.exe: *** [Makefile:5: All] Error 2
====1 errors, 0 warnings====

what am i missing with codelite settings?
User avatar
eranif
CodeLite Plugin
Posts: 6367
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: Installing MinGW / gdb on Winodws

Post by eranif »

C:/MinGW/bin/gcc.exe -c "C:/schmidt_CODELITE/test1/cl_regex_1/main.c" -g -O0 -Wall -o ./Debug/main.c.o -IC:\boost_1_63_0_GCC -I. -I. -IC:\boost_1_63_0_GCC
Notice that you are writing C++ code in a .C file. You should rename main.c to main.cpp so it will get compiled with g++ and not gcc

Eran
Make sure you have read the HOW TO POST thread
Post Reply