complier problem

Write your question here.
when I try to compile my project this happen


C:\Program Files (x86)\CodeBlocks\MinGW\lib\gcc\mingw32\5.1.0\include\c++\mingw32\bits\c++config.h|194|error: expected initializer before 'namespace'|
C:\Program Files (x86)\CodeBlocks\MinGW\lib\gcc\mingw32\5.1.0\include\c++\bits\postypes.h|98|error: 'ptrdiff_t' does not name a type|

and more

this is the code,
ther first file
1
2
3
4
5
6
7
8
9
10
11
12
  #include <iostream>
void hi()
{
    std::cout << " hi ";
}
int main()
{
    std::cout <<"hi";
     hi();

}

the second file is
1
2
3
4
5
6
7
#include "log.h"
int main()
{

     hi();

}

the header file is
1
2
3
4

#pragma once

void hi();

I try everything??
Last edited on
You have int main() in two files.I believe one file is main,one is log.h and other is log.cpp.

when I put ; after void hi() in header problems it worked
but the problem is werid when I complie.
it launch new file
the name is c++config.h what is that???
and pls answer fast.
Last edited on
Try to make a new application when you get in Visual Studio open Empty project in there you can add your cpp and h files.The compiler won't add you anything I believe.I make projects that way .Compile it and debbug it.
Last edited on
can I do it in codeblock ?
visual studios is paid applicton
I do not know for codeblock but here is online debbuger it is very good in my opinion
https://www.onlinegdb.com/ here you can create 3 seperate files and write your functions.
Last edited on
no the problem of
lib/gcc/ming32/include what is that
http://www.mingw.org/wiki/includepathhowto
Try to find that on this site
No I install it and set it up so why it gives me the error in my first quesion ????
closed account (z05DSL3A)
ahmedddddddd wrote:
visual studios is paid applicton


Visual Studio Community
A fully-featured, extensible, free IDE for creating modern applications for Android, iOS, Windows, as well as web applications and cloud services.
https://visualstudio.microsoft.com/vs/community/
I guess you are trying to compile with a c compiler instead of a c++ one
Topic archived. No new replies allowed.