User forums > Help

mm its late & gch: file not recognized: File format not recognized

<< < (3/4) > >>

MortenMacFly:

--- Quote from: Carola on August 26, 2009, 10:24:59 am ---I'll try to be precise, let me know if you need any more.

--- End quote ---
You'll need to create a project and add all files: main, the StringTokenizer.h and StringTokenizer.cpp to the project. Do not enabled compiling/linking for the header file explicitly. Just let C::B do the right thing:
- compile your StringTokenizer class into an object
- compile your main application into an object
- link both object files together.

Edit: Next time post the full build log (see my sig). Even if it's very long (you might want to add it zipped then). Otherwise it's hard to assist.

Carola:
I found the following topic, which seems to describe my problem quite well:

http://forums.codeblocks.org/index.php/topic,6108.msg46765.html#msg46765

especially this post:


--- Quote from: ddam1 on June 07, 2007, 09:37:46 pm ---I've found the line with the problem, is this:

mingw32-g++.exe -LC:\GTK\lib -LD:\Temp\CodeBlocks\lib  -o bin\Release\gTintargossPrices.exe aryan.h.gch DBWorker.h.gch csvparser.h.gch obj\Release\csvparser.o obj\Release\aryanparser.o obj\Release\main.o obj\Release\DBWorker.o    -lgtk-win32-2.0 -lgobject-2.0 -lglib-2.0 ..\..\..\Descargas\dtl.3.6.10\only_lib\linker\libdtl_proj.a

if remove this "aryan.h.gch DBWorker.h.gch csvparser.h.gch" the command works ok, are there any way to do this from the IDE?

--- End quote ---

In the build log of my previous post, you can see I have
a "StringTokenizer.h.gch" floating in the first line as well.
Aparently the guy (or girl) who posted the topic at the time
found the solution, but the topic's from 2007, and I don't
think he's active anymore.


Morten: I promiss I'll add complete logs next time.
I'll let you know if I can figure out how to do what you're advicing by myself.

Though if anyone has any idea about it: I would like to understand
why C::B can't simply link the files within a project itself.

MortenMacFly:

--- Quote from: Carola on August 26, 2009, 10:53:32 am ---In the build log of my previous post, you can see I have
a "StringTokenizer.h.gch" floating in the first line as well.

--- End quote ---
This happened because you selected to compile and link the header file, too. This is used to create pre-compiled headers which is surely not what you had in mind. The compiler will pick a pre-compiled header if found. As I told you: Do not select this option and remove the gch file(s).

Carola:
AHHHRRGH!!

I got it. I didn't check the "link" button for the StringTokenizer.cpp
I'm going to have to get used to this...
Thanks, though

MortenMacFly:

--- Quote from: Carola on August 26, 2009, 11:17:51 am ---I got it. I didn't check the "link" button for the StringTokenizer.cpp

--- End quote ---
You never need to check that although you really want to setup each and every file individually. All you have to do is to create a project (with a target) and add the files you want to that project (target). That's basically it. You can use a wizard that will setup the project for you.

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version