When trying to compile some source I downloaded (MSVC++ 6.0), I get 61 linker errors (unresolved external symbol). Clearly something is missing from my project. What could it be?
When trying to compile some source I downloaded (MSVC++ 6.0), I get 61 linker errors (unresolved external symbol). Clearly something is missing from my project. What could it be?
Well...since you didn't give much to go by I can only assume that you don't know what "linking" is. So here is a short summary. When you click the compile button, the compiler generates object code (*.obj files). It generate one object file per .cpp/.c file that you have. When it is finished compiling, it must hook all those files together in a process called linking (the linker is actually a separate program). When you get unresolved external symbols, that means that some symbol, i.e. a function or a variable, was referenced in your code but was not found when the linking phase took place.
Example:
Now, in your particular case, I would guess that the code you downloaded references some code library on windows (maybe a .dll). In that case, the code will not be able to link, because by definition a .dll links in at run-time. But the linker is dumb, and it doesn't know that. So you need to help it out. You need to specify a .lib file in your project settings, so that the linker will realize that those functions it can't find are references to a dynamic library (dll).Code:void non_existent_function(); int main() { // this will compile fine, but it won't link, because I didn't // define non_existent_function. non_existent_function(); return 0; }
The settings can be found by clicking on Project/properties, and then clicking on "Linker", and "Command Line", and typing the .lib name in the "Additional Settings" edit box.
I know that this doesn't exactly answer your question, because you are wondering right now exactly which lib file you should add. But you didn't tell us what any of the errors were either, so I can't help you there...
The crows maintain that a single crow could destroy the heavens. Doubtless this is so. But it proves nothing against the heavens, for the heavens signify simply: the impossibility of crows.
Err...Sorry the instructions for getting to project properties are for VC.NET 2003. I missed where you said you are using VC6. Maybe someone else can post how to get to the project settings on VC6, and adding additional .lib's on the link line?
The crows maintain that a single crow could destroy the heavens. Doubtless this is so. But it proves nothing against the heavens, for the heavens signify simply: the impossibility of crows.