LNK2001 unresolved external symbols - linker

I am sure this has come up time and time again. I get the following error:
1>precision.obj : error LNK2001: unresolved external symbol "int nprecision"
in my program precision.cxx I have a #include to u.hxx which has the following declaration:
extern int nprecision
Surely this now reads the variable nprecision as an external variable and should all be fine. I am unsure of what is going on.
Any suggestions would be appreciated. I've done everything I can think of.
Regards
Mat

Related

Where is the IID of IVpnManagementAgent defined

I'm trying to create an object of IVpnManagementAgent but I can't seem to find where the IID (IID___x_ABI_CWindows_CNetworking_CVpn_CIVpnManagementAgent) of it is defined so I can instance RoGetActivationFactory as it seems it requires me a second parameter of REFIID.
Also I saw this example but as I'm using C - I can't use __uuidof.
Weirdly enough the msdn sample seems to omit this parameter.
The problem is if I compile this code:
#include <roapi.h>
#define COBJMACROS
#include <windows.networking.vpn.h>
(main)()
{__x_ABI_CWindows_CNetworking_CVpn_CIVpnManagementAgent *pVpnMan;
IClassFactory *pCF; RoInitialize(RO_INIT_MULTITHREADED),
RoGetActivationFactory(0,
&IID___x_ABI_CWindows_CNetworking_CVpn_CIVpnManagementAgent,
&pVpnMan);}
Like this: cl rmousevpn.c /link RuntimeObject.lib windows.networking.lib
It gives me unresolved:
rmousevpn.obj : error LNK2019: unresolved external symbol IID___x_ABI_CWindows_CNetworking_CVpn_CIVpnManagementAgent referenced in function main
rmousevpn.exe : fatal error LNK1120: 1 unresolved externals

Absoft Fortran 77 Linking Error: error LNK2001:unresolved external symbol _rand_ and _seed_

I am getting 2 linking errors which I think have to do with a library not being linked properly using the Absoft Fortran Pro 2014 compiler. The function that I believe is causing the error is:
real FUNCTION RAND(i)
integer i
real x
IF (i-1) 20, 10, 20
10 CALL SEED(-1)
i=i+1
20 continue
CALL RANDOM(x)
RAND=x
END
Is there a library that I need to include for the random number generator to work? If so, how do I do that?
The error messages are:
RAND.obj : error LNK2001: unresolved external symbol _random_
RAND.obj : error LNK2001: unresolved external symbol _seed_
Thank you,
David.

Assimp SimpleOpenGL example Linker errors

I'm trying to get the sample "SimpleOpenGl" from Assimp to work, but I get some linker errors i can't solve. (And yes I am very new)
I get 12 LNK2001 errors (below is two of them)
1>Sample_SimpleOpenGL.obj : error LNK2001: unresolved external symbol _aiTransformVecByMatrix4
1>Sample_SimpleOpenGL.obj : error LNK2001: unresolved external symbol _aiImportFile
When googling "aiTransformVecByMatrix4" it says that it requires cimport, but it is already included, so I am not sure why I am getting this error.
The sample project can be found here: http://assimp.svn.sourceforge.net/viewvc/assimp/trunk/samples/SimpleOpenGL/
Any help is appreciated, thanks.
If you have downloaded assimp, you must have its libraries in any place on your disk. Open your sample properties dialog, select Linker and check the path to external references.
This must give you a clue about where the sample is looking for libraries.
If you are not sure, please post your values so I can help you

Error after compiling C code

I get this problem while compiling my code.
Error 14 error LNK2019: unresolved external symbol _findFuncs referenced in function _main H:\pshtoolkit_v1.4-src\whosthere\whosthere.obj whoisthere-alt
What libraries should I link with visual studio in order to resolve the error?
What libraries should I link with visual studio:
The library containing _findFuncs.
OK, not helpful I know, but presumably you know what findFuncs is and you are calling it for a reason. Where did you find out about it? Do you have any documentation?
Maybe you have a typo calling this function (case?), e.g. should it be FindFuncs?
Or is it defined somewhere as a static function?
I have solved the error, it is not the problems with the libraries. The .c file which contains the fincFuncs method had not been properly referenced. Thanks for helping though!
It's actually Linker error which your compiler doesn't resolve that name I think just
do forward declartion for the symbol which you are using in main.
May be you have done forward declaration but missing the definition itself.
Which your linker is looking for
Here it's your function "findfunc"
Check whether it works or not

Unresolved External Symbol Error When Using cvEigenDecomposition and Others

I am new to learning openCV and was trying to reproduce an online example "face recognition" program here: http://www.cognotics.com/opencv/servo_2007_series/part_5/index.html.
I am however getting an "unresolved external symbol" error for few functions:
cvEigenDecomposite
cvCalcEigenObjects
indNearestNeighbor(float *) // functions defined locally by the user
loadTrainingData(struct CvMat *) // functions defined locally by the user
The "unresolved external symbol" would show up when I mess up the linker. The weird thing, it worked just fine for other examples I have done so far on other websites. My reasoning is that the first two functions cvEigenDecomposite and cvCalcEigenObjects require extra .lib object that I haven't linked to and the other two functions depend on the first two. So my question is whether those functions require extra .lib objects to be linked to?
here is the list of the .lib objects I currently link to:
opencv_core231d.lib
opencv_highgui231d.lib
opencv_imgproc231d.lib
opencv_features2d231d.lib
opencv_calib3d231d.lib
Thanks!
EDIT:
ERRORS:
1>main.obj : error LNK2019: unresolved external symbol _cvEigenDecomposite referenced in function "void __cdecl learn(void)" (?learn##YAXXZ)
1>main.obj : error LNK2019: unresolved external symbol _cvCalcEigenObjects referenced in function "void __cdecl doPCA(void)" (?doPCA##YAXXZ)
1>main.obj : error LNK2019: unresolved external symbol "int __cdecl findNearestNeighbor(float *)" (?findNearestNeighbor##YAHPAM#Z) referenced in function "void __cdecl recognize(void)" (?recognize##YAXXZ)
1>main.obj : error LNK2019: unresolved external symbol "int __cdecl loadTrainingData(struct CvMat * *)" (?loadTrainingData##YAHPAPAUCvMat###Z) referenced in function "void __cdecl recognize(void)" (?recognize##YAXXZ)
1>C:\Users\Lyukshins\Dropbox\Programming\OpenCV2\Face Recognition\Debug\Face Recognition.exe : fatal error LNK1120: 4 unresolved externals
DEPENDENCIES:
C:\opencv\build\include
C:\opencv\build\include\opencv2
C:\opencv\build\include\opencv
INCLUDED DIRECTORIES:
C:\opencv\build\x86\vc10\lib
C:\opencv\build\include
cvEigenDecomposite and cvCalcEigenObjects are located in opencv_legacy231d.lib
The other 2 functions, as you said, are local functions. So they must be declared in the code before the functions that call them.

Resources