The problem is that I am getting
Code:
undefined reference to `IssueQueue::full()'
undefined reference to `IssueQueue::full()'
undefined reference to `IssueQueue::empty()'
undefined reference to `IssueQueue::empty()'
when compiling. I have been trying to figure this one out for over an hour and hopefully some of you here are willing to look at this with some fresh eyes.
What's really weird is that I call the IssueQueue constructor and another function before the first call to full, as well as other functions throughout main. It is only these two functions that the linker is having a problem with and it is all instances of them. I removed the four places that I call these two functions and everything compiles and runs beautifully.
...
dynamic_scheduler.h only includes the prototype for fetchInstruction and dynamic_scheduler.cpp defines it. Like I said, if I remove those four lines that I commented in main then everything compiles fine. So why would some functions be able to be linked and not others?
I am using an IDE which has been compiling fine previously but I have also tried by hand with "g++ -o out classes.cpp dynamic_scheduler.cpp prototype.cpp" as well as used a makefile that pretty much did the same.
I've tried renaming full and empty in case the linker was getting confused with functions from another class in classes.h (one other does have full and empty as well) but same error.
Any help would be appreciated.
EDIT: Removed code. I found the cause. It was these two functions being inlined and probably optimized down into no code or something.