Linker error (file not recognized: File format not recognized)

This is a discussion on Linker error (file not recognized: File format not recognized) within the C++ Programming forums, part of the General Programming Boards category; Hello, I'm doing a simple application to test the C++ capabilities and to learn some and have found an error ...

  1. #1
    Registered User
    Join Date
    Jun 2007
    Posts
    4

    Question Linker error (file not recognized: File format not recognized)

    Hello, I'm doing a simple application to test the C++ capabilities and to learn some and have found an error that don't understand, I've search for a solution to this, but dont found a valid solution, I will explain my problem:

    Using CodeBlocks to compile with MinGw I obtain the error "file not recognized: File format not recognized" when linking an header file for example:

    Code:
    #include <string>
    //#include "aryan.h"
    
    #ifndef DBWORKER_H_INCLUDED
    #define DBWORKER_H_INCLUDED
    
    using namespace std;
    
    class DBWorker {
    
        public:
            DBWorker(string dbname);
            bool checkManufacturer(string manufacturer);
            bool checkCategory(string cat);
           // Aryan checkArticle(Aryan article, bool forceUpdate);
    
        private:
            bool createManufacturer(string manufacturer);
            bool createCategory(string cat);
            string dbname;
    };
    
    #endif // DBWORKER_H_INCLUDED
    I've comment out all the "real code" of the class but the error persists how can I repair this?

    The complete log is this:

    Code:
    -------------- Build: Release in gTintargossPrices ---------------
    Precompiling header: DBWorker.h
    Precompiling header: csvparser.h
    Compiling: aryanparser.cc
    Compiling: csvparser.cpp
    Precompiling header: aryan.h
    Compiling: main.c
    Compiling: DBWorker.cpp
    Linking console executable: bin\Release\gTintargossPrices.exe
    DBWorker.h.gch: file not recognized: File format not recognized
    collect2: ld returned 1 exit status
    Process terminated with status 1 (0 minutes, 7 seconds)
    0 errors, 0 warnings
    DBWorker.h.gch is a file created by CodeBlocks from DBWorker.h.

    Hope you can help me and thanks to all in advance

  2. #2
    Registered User
    Join Date
    Jan 2005
    Posts
    7,317
    Did you accidentally add DBWorker.h.gch to the project yourself?

  3. #3
    Registered User
    Join Date
    Jun 2007
    Posts
    4
    No, I'm sure that the file isn't in my project files, inclusive I've deleted the file previously to the build...

  4. #4
    Registered User
    Join Date
    Jan 2005
    Posts
    7,317
    Strange. It might be something for the pre-compiled headers, have you looked on the CodeBlocks site for similar information? I'm not actually familiar with that IDE myself.

  5. #5
    Registered User
    Join Date
    Jun 2007
    Posts
    4
    I've searched in the codeblocks forum but found nothing

  6. #6
    Registered User
    Join Date
    Jun 2007
    Posts
    4
    Thanks for the help, the problem is solved one person have pointed me to the solution in the codeblocks forum, if anyone interested there is the thread

    http://forums.codeblocks.org/index.p....html#msg46765

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. File transfer- the file sometimes not full transferred
    By shu_fei86 in forum C# Programming
    Replies: 13
    Last Post: 03-13-2009, 12:44 PM
  2. Formatting a text file...
    By dagorsul in forum C Programming
    Replies: 12
    Last Post: 05-02-2008, 03:53 AM
  3. Formatting the contents of a text file
    By dagorsul in forum C++ Programming
    Replies: 2
    Last Post: 04-29-2008, 12:36 PM
  4. gcc link external library
    By spank in forum C Programming
    Replies: 6
    Last Post: 08-08-2007, 03:44 PM
  5. archive format
    By Nor in forum A Brief History of Cprogramming.com
    Replies: 0
    Last Post: 08-05-2003, 07:01 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21