.gch file not recognized ?!

Mar 19, 2008 at 3:39pm
Helo,

using Codeblocks, when i compile my project, i get the following message:

fel12.h.gch: file not recognized: File format not recognized

The only problem is that my project has no such a file. In the project, there are three files:

main.cpp
fel12.cpp
fel12.h

I'm pretty shure, that fel12.h is not fel12.h.gch. However, i tried to delete it, and remaking, readding it to the project, but i got the same message.
I do got a fel12.h.gch file in my project folder (i don't know how that file gets in my folder everytime btw), but removing it doesn't remove the problem at all.

I even tried to add it to the project, but then i get this:

mingw32-g++.exe: .objs\fel12.h.o: No such file or directory

Does anyone have any ideas, what is happening ?
Mar 19, 2008 at 3:51pm
closed account (z05DSL3A)
Found this elsewhere d to do with this problem, hope it helps.
1
2
3
4
5
Right-click your header file, select properties, choose the Build tab,
 and uncheck the "Compile file" and "Link file" options. Do this for each
 header file. You should only ever use the Compile option on a header if
 you specifically want it to be used as a precompiled header, and you
 should never use the Link option for a header.
Last edited on Mar 19, 2008 at 3:52pm
Mar 19, 2008 at 10:03pm
"uncheck the "Compile file" and "Link file" options"

If i do that, i get

multiple definition of `Konzolvagyfajl(std::string, std::string*)'

And that function is defined in fel12.cpp, and is declared in fel12.h
Mar 20, 2008 at 9:04am
closed account (z05DSL3A)

Have you deleted the .gch file from your project folder; you should if it is corrupt? And do not add them to your project.

A ‘.gch’ file is a precompiled header; if it is not there then the normal header files will be used. If your project is set to generate precompiled headers it will make them if they don’t exist and use them in the next build.

I don’t use Codeblocks but the text I posted last time was from there forum on fixing this issue. I don’t know if anyone else can help you out.

Good luck.
Topic archived. No new replies allowed.