Hi, I'm facing a problem here.
I am running Code::Blocks version Code::Blocks 13.12 on Windows 7 HP
(version OperatingSystemVersionNumber). The compiler I use is TDM-GCC
version 4.7.1.
Description of problem.
My project files fail to compile. Googling tells me that the problem seems to lie with the header file. I followed the steps by un-checking both "Compile" and "Link" boxes but the code gives me this error instead. I deleted all .gch files from the folder too.
Build log:
mingw32-g++.exe -o bin\Debug\C9E4.exe obj\Debug\main.o obj\Debug\namespace.o
obj\Debug\main.o: In function `main':
C:/Users/Drakonaut/Desktop/Chapter 9 Ex1/C9E4/main.cpp:11: undefined reference to `SALES::setSales(SALES::Sales&, double const*, int)'
C:/Users/Drakonaut/Desktop/Chapter 9 Ex1/C9E4/main.cpp:12: undefined reference to `SALES::setSales(SALES::Sales&)'
C:/Users/Drakonaut/Desktop/Chapter 9 Ex1/C9E4/main.cpp:13: undefined reference to `SALES::showSales(SALES::Sales const&)'
C:/Users/Drakonaut/Desktop/Chapter 9 Ex1/C9E4/main.cpp:14: undefined reference to `SALES::showSales(SALES::Sales const&)'
collect2.exe: error: ld returned 1 exit status
I read some threads on this forum and some faced the same problem as me. I've got my main.cpp and namespace.cpp linked and compiled. However, it doesn't seem to solve the problem.
Oh, there are these "C9E4.depend" and "C9E4.layout". But I think it isn't related to the problem.
I cut out the "bin" and "obj" and let the compiler re-compile, but the problem is still there.
Thanks!