title: Code::Blocks error: ld returned 1 exit status
body: <p>I'm using Code::Blocks v 16.1.0.0 along with the MINGW that came with it. There is a problem with the linker. I cannot link a single header / source file to a source file using <code>#include "sth"</code>. To narrow the problem down i only have 1 source and 1 header file in my project, but i cannot bypass this error no matter what files i use and options i try.</p>
  
  <p>This is the build log</p>
  
  <pre><code>-------------- Build: Debug in MISC (compiler: GNU GCC Compiler)---------------
  
  gcc.exe -Wall -Wextra -Wall -g -std=c99  -c C:\Users\username\Documents\CodeBlocks\C\MISC\readFileByChars.c -o obj\Debug\readFileByChars.o
  g++.exe -LC:\Users\username\Documents\CodeBlocks\C\MISC -o bin\Debug\MISC.exe obj\Debug\readFileByChars.o readFileByChars.h.gch   
  readFileByChars.h.gch: file not recognized: File format not recognized
  collect2.exe: error: ld returned 1 exit status
  Process terminated with status 1 (0 minute(s), 0 second(s))
  1 error(s), 0 warning(s) (0 minute(s), 0 second(s))
  </code></pre>
  
  <p>This is the toolchain directories : </p>
  
  <p><a href="https://i.stack.imgur.com/2uBrR.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/2uBrR.jpg" alt="enter image description here"></a></p>
  
  <p>I don't have any previous instances of programs running. I also have working MINGW standalone (without including its bin folder in the environment variables not to confuse codeblocks during build), but for codeblocks i include the prepackaged one that came with its installation. When i click the option to link a header file in my project the project won't build (but if i don't link the file how can i build my application?). I repeat this project is empty, i have only one header and only one source file included. I have seen other similar questions about this on here but their solutions did not work. Help will be appreciated. Thank you.</p>