Click here to Skip to main content
15,949,686 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Good morning to everyone. I'm trying to create c project in MS Vc++ 2008. I have all the declaration in the header files. And i have included it in the main program. But there comes error as follows:

VB
Error   1   error LNK2001: unresolved external symbol _quant_vals   encoder.obj mdc
Error   2   error LNK2001: unresolved external symbol _hifilt   encoder.obj mdc
Error   3   error LNK2001: unresolved external symbol _lofilt   encoder.obj mdc
Error   4   error LNK2001: unresolved external symbol _w_tree   encoder.obj mdc
Error   5   error LNK2001: unresolved external symbol _q_tree   encoder.obj mdc
Error   6   fatal error LNK1120: 5 unresolved externals F:\PROJECT MDC\mdc\Debug\mdc.exe    1   mdc


If i right click on the variable and go to the declaration. It goes to the declaration part correctly.

How to solve this????
Posted

1 solution

Including the headers is not enough, you should link with the library (.lib) file.
Select the Project->Properties menu item, then (in the newly appeeared window) select the Configuration Properties->Linker->Input node and finally add the appropriate .lib file in the Additional Dependecies row.
:)
 
Share this answer
 
Comments
balasubramaniyan94 6-Jul-10 5:26am    
which lib file i have to add?
CPallini 6-Jul-10 5:33am    
The library (.lib) file corrensponding to the header file you included (for instance, if the DLL you need to use is 'foo.dll' then, probably its header file is 'foo.h' and the library one is 'foo.lib'.
balasubramaniyan94 6-Jul-10 5:42am    
I'm using the header file wsq.h. And if include wsq.lib, there comes a error "cannot open the file wsq.lib".
CPallini 6-Jul-10 5:46am    
Usually BUT NOT ALWAYS the prefix of the .h and .lib file is the same. What library are you using? Have you a bit of documentation?
balasubramaniyan94 6-Jul-10 5:52am    
cann't understand. "what library are you using?" means what you are mentioning?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900