Yes, check out my code above. I still don't understand the "undeclared identifiers" though?
Printable View
Aw, screw it
Nevermind
Thanks for the help guys but this project is due in 2 days. I really don't have time to be debugging something that already works fine when I use Putty, especially since they'll be testing it in Unix anyway. Again, thanks the help
Undeclared identifiers means you didn't tell the compiler yet what some variable or function was. You might have told it later, or in a different file, but not that the compiler could see yet.
I couldn't find countwords.c anywhere in this thread. Maybe it's somewhere in your project and you forgot about it?
You appear to define LL_Element in hashTable.c. You need to do that in hashTable.h or it will not be visible outside of the hashTable.c file.
I think this was the problem, putting this in my hashTable.c:
#ifndef HASHTABLE_H
#define HASHTABLE_H
Oops?
I'm on campus right now so can't test it, but a buddy of mine did the same, ouch. Maybe there is hope for Visual Studio after all!
Except that link error was pretty useless, gave no hints as to the above problem...
Remember: Visual Studio is not at fault here; your other compiler/IDE is. Including other source files is a big no-no.
Now TWO files will have the same source - so there's bound to be more than one symbol with the same name which is not allowed.
As for your error... LL_Element must be declared/defined somewhere, right? Probably in that .c file. Declarations for structs and such should be in headers. And all source files that needs to use them includes that header. Simple.
You'll see that it should compile then.
I'm guessing the reason it compiled on UNIX is that he probably wasn't linking both hashTable.obj & main.obj in the makefile, so the multiple definition problem wouldn't have appeared.
Can't tell unless you post the entire source and the makefile/build process.