title: Separate Compilation and Linking in C++ using Dev-C++
body: <p>Thanks pals for your response so far on my previous post.</p>
  <p>I can now do the class things but there is still a stumbling block on my path that I just have to get rid of.</p>
  <p>I don’t have any problem with the header file now but the implementation file. The problem is this, if I try to complile the implementation file for my class I do get this error message:</p>
  <blockquote>
  <p>In function `main':</p>
  <p>[Linker error] c:/crossdev/src/mingw-w64-svn/mingw-w64-crt/crt/crt0_c.c:18: undefined reference to `WinMain@16'</p>
  <p>C:\Users\Chuks Joe\Desktop\myC++Class\collect2.exe       [Error] ld returned 1 exit status</p>
  </blockquote>
  <p>And if I try compiling the main program I get this error messages:</p>
  <blockquote>
  <p>In function `main':</p>
  <p>[Linker error] C:/Users/Chuks Joe/Desktop/carTest.cpp:6: undefined reference to `car::car(float, std::string, std::string)'</p>
  <p>[Linker error] C:/Users/Chuks Joe/Desktop/carTest.cpp:8: undefined reference to `car::read_prop() const'</p>
  <p>[Linker error] C:/Users/Chuks Joe/Desktop/carTest.cpp:11: undefined reference to `car::change_spd(float)'</p>
  <p>[Linker error] C:/Users/Chuks Joe/Desktop/carTest.cpp:14: undefined reference to `car::change_clr(std::string)'</p>
  <p>[Linker error] C:/Users/Chuks Joe/Desktop/carTest.cpp:17: undefined reference to `car::read_prop() const'</p>
  <p>C:\Users\Chuks Joe\Desktop\collect2.exe      [Error] ld returned 1 exit status</p>
  </blockquote>
  <p>even when I add the code:</p>
  <pre><code>int main(){}
  </code></pre>
  <p>to the implementation file, it compiles without any error message but when I try running the main program, it still gives me the same error message as stated above.</p>
  <p>but when I put the main program in the implementation file, it compiles and runs successfully.</p>
  <p>Please pals, which of the settings should I review to rectify this issue, because I will prefer my class implementation code to be in a separate file and the main program in another one.</p>
  <p>The compiler am using is Dev-C++</p>
  <p>Thanks in advance.</p>