Hmm... My third qhestion of the night.
I am trying to make my program lake less time to compile, so i made my program modular (.o files), and made a makefile to only compile what is needed.
Here is the deal (greatly simplified):
main.cpp
Code:
#include "file2.h"
#include "file3.h"
#include "file4.h"
file2.cpp
Code:
#include "file2.h"
class stuff;
file3.cpp
Code:
#include "file3.h"
class morejunk;
file4.cpp
Code:
#include "file4.h"
class evenmorejunk;
And all the .h files hold the prototypes for their namesake.cpp files.
Now, the makefile has this: (simplified, again)
makefile
Code:
junk : main.o file2.o file3.o file4.o
g++ -o junk main.o file2.o file2.o file4.o
file2.o : file2.cpp file2.h
g++ -c file2.cpp
file3.o : file3.cpp file3.h
g++ -c file3.cpp
file4.o : file4.cpp file4.h
g++ -c file4.cpp
Now, the linker is giving me errors telling me:
Code:
nemoserv.cpp:27: storage size of `log' isn't known
nemoserv.cpp:30: storage size of `opts' isn't known
nemoserv.cpp:49: storage size of `chman' isn't known
nemoserv.cpp:50: storage size of `cmd' isn't known
These are the elements of a struct that is defined in a separate source file, and
Code:
nemoserv.cpp:277: aggregate `rawMsg message' has incomplete type and
cannot be initialized
This class is defined also in another source file.
Please tell me what I am doing wrong, or if you need more information (and what)
Thanks!
~EtherealFlaim
[/CODE]