Trouble with linking - c++

I'm trying to write some C++ code for Windows 7 which will connect to a mobile broadband network. When I run the first example at http://msdn.microsoft.com/en-us/library/ee677092(v=VS.85).aspx I get the following when compiling within Visual Studio:
testII.obj : error LNK2001: unresolved external symbol _CLSID_MbnInterfaceManager
testII.obj : error LNK2001: unresolved external symbol _IID_IMbnInterfaceManager
or when I compile with the "cl" command at the command prompt I get:
test.cpp
Microsoft (R) Incremental Linker Version 10.00.30319.01
Copyright (C) Microsoft Corporation. All rights reserved.
/out:test.exe
test.obj
test.obj : error LNK2019: unresolved external symbol _CLSID_MbnInterfaceManager referenced in function _main
test.obj : error LNK2019: unresolved external symbol _IID_IMbnInterfaceManager referenced in function _main
test.exe : fatal error LNK1120: 2 unresolved externals
It would seem I need to link so some library somewhere, can anyone tell me which library and how to link it? Do these errors have anything to do with the mbnapi.idl requirement?
Thanks a lot, appreciate it

What you need to do is include mbnapi_uuid.lib

Related

OpenSSL Compile WinCE 6.0

I am trying to compile OpenSSL 0.9.8i with windows CE SDK Toradex CE600 with reference to steps defined in the link below
OpenSSL Compile WinCE
When running nmake -f ms\cedll.mak command getting many Link2001 Errors as below
Please Help me in resolving this errors.
OLDNAMES.lib(wcsdup.obj) : error LNK2001: unresolved external symbol _wcsdup
OLDNAMES.lib(strnicmp.obj) : error LNK2001: unresolved external symbol __strnicmp
OLDNAMES.lib(stricmp.obj) : error LNK2001: unresolved external symbol __stricmp
OLDNAMES.lib(setmode.obj) : error LNK2001: unresolved external symbol __setmode
OLDNAMES.lib(fileno.obj) : error LNK2001: unresolved external symbol __fileno
OLDNAMES.lib(strdup.obj) : error LNK2001: unresolved external symbol __strdup
OLDNAMES.lib(wcsdup.obj) : error LNK2001: unresolved external symbol __wcsdup
out32dll_ARMV4I\libeay32d.dll : fatal error LNK1120: 113 unresolved externals
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\ce\bin\x86_arm\link.EXE"' : return code '0x460'
Stop.
If you need to add SSL/TLS support to your application and don't have specific dependencies on openSSL, you may have a look at mbedTLS:
https://github.com/ARMmbed/mbedtls
I made a fork of an old version to build it for Windows Embedded Compact 2013:
https://github.com/VMinute/mbedtls
and it builds with almost no changes.

Error Link 2001 libavformat.a(tls_schannel.o) when building any ffmpeg project in Visual Studio 2010

I have just built ffmpeg latest version 3.0 and when I am trying to build ffmpeg related project in Visual Studio 2010, it gives this error:
libavformat.a(tls_schannel.o) : error LNK2001: unresolved external symbol _FreeContextBuffer#4
1>libavformat.a(tls_schannel.o) : error LNK2001: unresolved external symbol _InitializeSecurityContextA#48
1>libavformat.a(tls_schannel.o) : error LNK2001: unresolved external symbol __imp__ApplyControlToken#8
1>libavformat.a(tls_schannel.o) : error LNK2001: unresolved external symbol __imp__FreeCredentialsHandle#4
1>libavformat.a(tls_schannel.o) : error LNK2001: unresolved external symbol __imp__DeleteSecurityContext#4
1>libavformat.a(tls_schannel.o) : error LNK2001: unresolved external symbol _AcquireCredentialsHandleA#36
1>libavformat.a(tls_schannel.o) : error LNK2001: unresolved external symbol _DecryptMessage#16
1>libavformat.a(tls_schannel.o) : error LNK2001: unresolved external symbol _EncryptMessage#16
1>libavformat.a(tls_schannel.o) : error LNK2001: unresolved external symbol _QueryContextAttributesA#12
My project is able to build an older version from 2014. When I search in 2014 ffmpeg there is no tls_schannel.c present.
But I have to make project now with latest ffmpeg3.0.
So please tell me how to make it work.
Above problem is solved by doing following steps:
i have run command line ./cibfugyre --toolchain=msvc --enable-gpl --disable-network
Then i build again with make command.
Then i included resultant library and headers and my project is running now.
The problem was i was not doing --disable-network. For that you can do google.
Thank you.

Building m2crypto: 7 unresolved externals

I've tried to build M2Crypto (github) for win-amd64-py3.3:
python setup.py build --compiler msvc
And I've got an linker's unresolved external symbol errors (full log):
C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\BIN\amd64\link.exe /DLL /nologo /INCREMENTAL:NO /LIBPATH:D:\Programy\Python33\libs /LIBPATH:D:\Programy\Python33\PCbuild\amd64 /LIBPATH:c:\pkg\lib ssleay32.lib libeay32.lib /EXPORT:PyInit___m2crypto build\temp.win-amd64-3.3\Release\SWIG/_m2crypto_wrap.obj /OUT:build\lib.win-amd64-3.3\M2Crypto\__m2crypto.pyd /IMPLIB:build\temp.win-amd64-3.3\Release\SWIG\__m2crypto.lib /MANIFESTFILE:build\temp.win-amd64-3.3\Release\SWIG\__m2crypto.pyd.manifest
_m2crypto_wrap.obj : warning LNK4197: export 'PyInit___m2crypto' specified multiple times; using first specification
Creating library build\temp.win-amd64-3.3\Release\SWIG\__m2crypto.lib and object build\temp.win-amd64-3.3\Release\SWIG\__m2crypto.exp
_m2crypto_wrap.obj : error LNK2019: unresolved external symbol PyString_AsStringAndSize referenced in function m2_PyString_AsStringAndSizeInt
_m2crypto_wrap.obj : error LNK2019: unresolved external symbol PyString_FromStringAndSize referenced in function bn_to_mpi
_m2crypto_wrap.obj : error LNK2019: unresolved external symbol PyInt_AS_LONG referenced in function asn1_integer_set
_m2crypto_wrap.obj : error LNK2019: unresolved external symbol PyBuffer_New referenced in function ec_key_get_public_der
_m2crypto_wrap.obj : error LNK2019: unresolved external symbol PyFile_AsFile referenced in function _wrap_err_print_errors_fp
_m2crypto_wrap.obj : error LNK2019: unresolved external symbol PyFile_Check referenced in function _wrap_err_print_errors_fp
_m2crypto_wrap.obj : error LNK2019: unresolved external symbol PyInstance_New referenced in function ssl_verify_callback
build\lib.win-amd64-3.3\M2Crypto\__m2crypto.pyd : fatal error LNK1120: 7 unresolved externals
What's going on? I'm using Win64 OpenSSL v1.0.1e. Do I need older libraries?
from the full log it looks like one first problem is that the compiler can't find the python c header files. Then the linker can't find the python library. Perhaps the options to cl.exe are not good (shouldn't it be /ID:\... instead of -ID:\...?) or you don't have the python header files installed.

lua 5.2.1 unresolved externals

I'm using visual studio 2012 and when I try to compile, I get following errors:
Error 7 error LNK1120: 6 unresolved externals C:\Users\MS\Documents\Visual Studio 2012\Projects\LuaTest\Release\LuaTest.exe LuaTest
Error 4 error LNK2001: unresolved external symbol _lua_close C:\Users\MS\Documents\Visual Studio 2012\Projects\LuaTest\LuaTest\main.obj LuaTest
Error 5 error LNK2001: unresolved external symbol _lua_pcallk C:\Users\MS\Documents\Visual Studio 2012\Projects\LuaTest\LuaTest\main.obj LuaTest
Error 6 error LNK2001: unresolved external symbol _lua_settop C:\Users\MS\Documents\Visual Studio 2012\Projects\LuaTest\LuaTest\main.obj LuaTest
Error 2 error LNK2001: unresolved external symbol _luaL_loadfilex C:\Users\MS\Documents\Visual Studio 2012\Projects\LuaTest\LuaTest\main.obj LuaTest
Error 1 error LNK2001: unresolved external symbol _luaL_newstate C:\Users\MS\Documents\Visual Studio 2012\Projects\LuaTest\LuaTest\main.obj LuaTest
Error 3 error LNK2001: unresolved external symbol _luaopen_base C:\Users\MS\Documents\Visual Studio 2012\Projects\LuaTest\LuaTest\main.obj LuaTest
Source code taken from
HERE.
Using following library version: lua-5.2.1_Win32_dll10_lib.zip
I tried different lua52.lib files, but with all of them I get these errors.
What could be wrong?
You are using Visual Studio 2012, but library files from here appealingly only support up to Visual Studio 2010.
Anyway, Lua is small and very easy to compile. I would really recommend you to include Lua source files in Visual Studio instead of libraries.

Problem compiling Platform SDK program

I'm trying to compile the example from here;
http://msdn.microsoft.com/en-us/library/ms682619(VS.85).aspx
I've installed the Platform SDK, but I'm getting these errors;
Error 1 error LNK2019: unresolved external symbol _GetDeviceDriverBaseNameW#12 referenced in function _main DriverChecker.obj DriverChecker
Error 2 error LNK2019: unresolved external symbol _EnumDeviceDrivers#12 referenced in function _main DriverChecker.obj DriverChecker
Error 3 fatal error LNK1120: 2 unresolved externals C:\Files\Projects\VS2008\DriverChecker\Debug\DriverChecker.exe DriverChecker
Anyone any idea how to get this compiling correctly?
You just need to add psapi.lib as an additional library in your linker options.
Edit properties for your project, navigate to Linker->Input, and type "psapi.lib" where it says Additional Dependencies.