mpg123 link error "_read" and "_lseek" - c++

I compile mpg123 lib in win32.
It don't want it linked to MSVCR90.DLL
I change:
C/C++ -> "ignore all default libraries" to YES
add "additional dependencies" ==> libcmt.lib
"C/C++ -> Runtime Library "from "multi-threaded DLL" to "Multi-threaded"
But i still get this error:
Please help me.
readers.obj : error LNK2001: unresolved external symbol _read
readers.obj : error LNK2001: unresolved external symbol _lseek

Perhaps you should be linking to LIBCPMT.LIB which is the CPP standard library.

Related

How to resolve an unresolved external symbol error with MSVCRTD.lib

I have a C++ Visual Studio DLL project that has a link error:
MSVCRTD.lib(tncleanup.obj) : error LNK2019: unresolved external symbol __imp__InitializeSListHead#4 referenced in function "void __cdecl __scrt_initialize_type_info(void)" (?__scrt_initialize_type_info##YAXXZ)
I set the Project Properties, Linker, General, Show Progress to "For Libraries Searched" to verify the correct version of MSVCRTD.lib is being referenced.
Look up the unresolved external symbol: InitializeSListHead to find what library it is defined in:
https://msdn.microsoft.com/en-us/library/windows/desktop/ms683482(v=vs.85).aspx
Kernel32.lib
In Visual Studio, set the Project Properties, Linker, General, Show Progress to “For Libraries Searched (/VERBOSE:Lib)"
Start a build and examine the output to see the "Searching libraries" referencing "Kernel32.lib".
In my case I found another Kernel32.lib was being referenced incorrectly.

Unresolved external symbol for imp_fputws, imp_towupper in visual studio

I am developing windows program, and got link error :
error LNK2001: unresolved external symbol __imp__wcsicmp
error LNK2001: unresolved external symbol __imp_fputws
error LNK2001: unresolved external symbol __imp_towupper
It seems like I need wide char version fputs() and toupper(), but I can't find it.
Could someone provide the library name or compile settings that will resolve the link error?
Environment : Win server 2008 + visual studio 2010 pro + WinDDK 7600.16385.1
Not sure if it was the case for you, but I was using the (lib file) meant for a MD runtime execution instead of a MT runtime execution.
Using the correct lib in:
Project Properties -> Configuration Properties -> Linker -> Input -> Additional Dependencies
helped me fix the issue

Poco and openssl linker error with visual studio 2010 c++ project

Trying to link with the static library of Poco throws the following error
1>PocoNetSSLmd.lib(SSLManager.obj) : error LNK2001: unresolved external symbol X509_verify_cert_error_string
1>PocoNetSSLmd.lib(Utility.obj) : error LNK2001: unresolved external symbol X509_verify_cert_error_string
But the libeay32.lib static library to which the project is linked contains the symbols
$ dumpbin /ALL libeay32.lib | grep X509_STORE_CTX_get_error
915B6 _X509_STORE_CTX_get_error
915B6 __imp__X509_STORE_CTX_get_error
9162E _X509_STORE_CTX_get_error_depth
9162E __imp__X509_STORE_CTX_get_error_depth
92C _X509_STORE_CTX_get_error
92D _X509_STORE_CTX_get_error_depth
92C __imp__X509_STORE_CTX_get_error
92D __imp__X509_STORE_CTX_get_error_depth
Symbol name : _X509_STORE_CTX_get_error
Symbol name : _X509_STORE_CTX_get_error_depth
1016 _X509_STORE_CTX_get_error
1017 _X509_STORE_CTX_get_error_depth
The preprocessor symbols POCO_STATIC, POCO_NO_UNWINDOWS, POCO_HAVE_IPv6 are set in the project settings.
How to resolve the issue.
In your Project Properties, on the Linker page, add the path to your POCO libraries to the "Additional Library Entries" page.
Also, on Properties > General > Use of MFC, select "Use MFC in a Static Library"
Depending on which POCO libs you are using, you will probably have to add paths for Poco/Foundation and at least one other POCO lib.

Linker errors while migrating from x32 to x64

I have recently migrated a project from x32 to x64 in VS professional 2008 and I'm getting this weird linker errors:
error LNK2001: unresolved external symbol __imp_PostMessageW
error LNK2001: unresolved external symbol __imp_FlushFileBuffers
error LNK2001: unresolved external symbol __imp_WriteFile
error LNK2001: unresolved external symbol __imp_WaitForSingleObject
error LNK2001: unresolved external symbol __imp_SetFilePointer
error LNK2001: unresolved external symbol __imp_EnterCriticalSection
...
And more of this nature.
I am including shlwapi.lib in the linker.
Running on Windows 7 x64.
Additional Dependencies:
The solution for my problem was setting Linker > General > Additional Library Directories with "C:\Program Files\Microsoft SDKs\Windows\v6.0A\Lib\x64" instead of "C:\Program Files\Microsoft SDKs\Windows\v6.0A\Lib".
Ensure that the x64 configuration is selected. Right-click your project in the Solution Explorer window, Properties, Linker, Input. Click on the Additional Dependencies box and click the button that appears.
This is what it should look like if the project is configured correctly. Note how the "Inherit" checkbox is ticked and how the inherited values list the standard SDK libraries. Like kernel32.lib, the link library that has the definition for __imp_FlushFileBuffers, etc. If it doesn't look like this in your project then you'll get these linker errors.

CUDA 5.0 error LNK2001: unresolved external symbol for cuda methods

I have error in linker
1>ManifestResourceCompile:
1> All outputs are up-to-date.
1>kernel.cu.obj : error LNK2001: unresolved external symbol _cudaMalloc#8
1>kernel.cu.obj : error LNK2001: unresolved external symbol _cudaFree#4
I saw similar question added here :
Unresolved external symbols in beginners CUDA program
But it's already have added this information to linker.
So where is the problem ?
I'm using Visual Studio 2010 Premium with CUDA SDK 5.0 and Nsight 3.0 for VS
Source code here : http://pastebin.com/DfdfSfWd
(It's a example generated by Visual Studio on created new project for CUDA 5.0)
[EDIT]
Settings for Linker
Configuration Properties->Linker->General->Additional Library Directories :
$(CudaToolkitLibDir) $(CUDA_LIB_PATH) $(CUDA_PATH)\lib\$(PlatformName)
Configuration Properties->Linker->Input->Additional Dependencies
cuda.lib;cudart.lib; and the other libs..
But in properties I see that CUDA haves own Linder, "CUDA Linker" and that doesnt have set
Additional Library Directories
and
Additional Dependencies
so I set this properties but nothing that change, the linker still have problem.
[EDIT]
Ok, the error is when I change
Configuration Properties->CUDA C/C++->Device->Code Generation
from
compute_10,sm_10
to
compute_20,sm_20
and add a flag -dc for CUDA C/C++
Ok, I found how to set the project for Separate Compilation & Linking, below we have an example of project where it work :
example simpleSeparateCompilation