User forums > Help
Possible Bug: File not Recognized [SOLVED]
cprgmswr2:
I am getting a strange error with code blocks:
The build output:
--- Code: ---Compiling: CString.CPP
Precompiling header: CString.h
Compiling: Pointer.CPP
Precompiling header: Pointer.h
Compiling: SClass.cpp
Precompiling header: SClass.h
Compiling: SFunction.cpp
Precompiling header: SFunction.h
Compiling: SProcedure.cpp
Precompiling header: SProcedure.h
Compiling: ShortestPath.cpp
Precompiling header: ShortestPath.h
Compiling: ShortestPath.rc
Linking executable: ShortestPath.exe
CString.h.gch\default_CString_h_gch: file not recognized: File format not recognized
collect2: ld returned 1 exit status
Process terminated with status 1 (0 minutes, 44 seconds)
0 errors, 0 warnings
--- End code ---
I then proceeded to compile the exact same files through a batch file.
The batch file:
--- Code: ---c:\mingw\bin\windres -o resfile.o ShortestPath.rc 2> Error.txt
c:\mingw\bin\g++ -s -o shortestPath CString.CPP Pointer.CPP SClass.CPP SFunction.CPP ShortestPath.CPP SProcedure.CPP resfile.o C:\mingw\lib\libcomctl32.a -mwindows 2>> Error.txt
--- End code ---
Produced no errors and made an executable with the batch file.
Is there any suggestion on how to solve this issue, so I can get code blocks to create an executable.?
Forgot to mention I am in windows using the March 31st, 2007 nightly build
Biplab:
This is not a C::B bug, rather it's related to linker.
Also the comparison is not perfect. In the second example you didn't create PCH file.
Delete the file CString.h.gch\default_CString_h_gch and recompile your project. :)
Regards,
Biplab
cprgmswr2:
I have deleted all .gch files over and over. I have rebuild the project numerous times yet it continues to fail at recognizing the file.
Is there a way to prevent it from making those files?
Biplab:
Right click on CString.h file in Project Manager. Click on Properties menu option. Go to Build tab and uncheck Compile file option.
If you've set any pre-processor directive for PCH support you have to remove them, too. :)
cprgmswr2:
After unchecking compile file for the cstring.cpp file, I get this error
--- Code: ----------------- Build: default in Win32 Application ---------------
Linking executable: ShortestPath.exe
mingw32-g++.exe: .objs\CString.o: No such file or directory
Process terminated with status 1 (0 minutes, 0 seconds)
0 errors, 0 warnings
--- End code ---
--- Modified ---
I relized I had done the wrong file it was suppose to be the .h file, but I get this error instead
--- Code: ---Linking executable: ShortestPath.exe
mingw32-g++.exe: CString.h.gch\default_CString_h_gch: No such file or directory
Process terminated with status 1 (0 minutes, 0 seconds)
0 errors, 0 warnings
--- End code ---
Navigation
[0] Message Index
[#] Next page
Go to full version