I have a solution that is works, then I was needed to add a project that has implementation of MediaFoundation. So, in order to include it I added this project as existing one then in configuration in General section I provided path to .h files and then in Liker input added .lib
After this I tried to use it and write include in one of my files and then invoked a few methods from this project that was added.
When I tried to compile my project I got an errors :
9>LINK : warning LNK4098: defaultlib 'MSVCRT' conflicts with use of other libs; use /NODEFAULTLIB:library
9>co_AudioDecoder.lib(co_AudioDecoderMF.obj) : error LNK2019: unresolved external symbol MFStartup referenced in function "private: bool __cdecl co_AudioDecoderMF::InitAndStartCOMLib(void)" (?InitAndStartCOMLib#co_AudioDecoderMF##AEAA_NXZ)
9>co_AudioDecoder.lib(co_AudioDecoderMF.obj) : error LNK2019: unresolved external symbol MFShutdown referenced in function "public: virtual void __cdecl co_AudioDecoderMF::Cleanup(void)" (?Cleanup#co_AudioDecoderMF##UEAAXXZ)
9>co_AudioDecoder.lib(co_AudioDecoderMF.obj) : error LNK2019: unresolved external symbol MFCreateAttributes referenced in function "private: bool __cdecl co_AudioDecoderMF::CreateSourceReader(void)" (?CreateSourceReader#co_AudioDecoderMF##AEAA_NXZ)
9>co_AudioDecoder.lib(co_AudioDecoderMF.obj) : error LNK2019: unresolved external symbol MFCreateMediaType referenced in function "private: bool __cdecl co_AudioDecoderMF::ConfigureAudioStream(enum co_AudioDecoder::SoundDataType,struct IMFSourceReader *,struct IMFMediaType * *)" (?ConfigureAudioStream#co_AudioDecoderMF##AEAA_NW4SoundDataType#co_AudioDecoder##PEAUIMFSourceReader##PEAPEAUIMFMediaType###Z)
9>co_AudioDecoder.lib(co_AudioDecoderMF.obj) : error LNK2019: unresolved external symbol MFCreateMFByteStreamOnStream referenced in function "private: bool __cdecl co_AudioDecoderMF::CreateByteStream(unsigned char const *,__int64)" (?CreateByteStream#co_AudioDecoderMF##AEAA_NPEBE_J#Z)
9>co_AudioDecoder.lib(co_AudioDecoderMF.obj) : error LNK2019: unresolved external symbol MFCreateSourceReaderFromByteStream referenced in function "private: bool __cdecl co_AudioDecoderMF::CreateSourceReader(void)" (?CreateSourceReader#co_AudioDecoderMF##AEAA_NXZ)
9>co_AudioDecoder.lib(co_AudioDecoderMF.obj) : error LNK2001: unresolved external symbol MFAudioFormat_PCM
9>co_AudioDecoder.lib(co_AudioDecoderMF.obj) : error LNK2001: unresolved external symbol MF_MT_MAJOR_TYPE
9>co_AudioDecoder.lib(co_AudioDecoderMF.obj) : error LNK2001: unresolved external symbol MF_MT_SUBTYPE
9>co_AudioDecoder.lib(co_AudioDecoderMF.obj) : error LNK2001: unresolved external symbol MF_MT_AUDIO_NUM_CHANNELS
9>co_AudioDecoder.lib(co_AudioDecoderMF.obj) : error LNK2001: unresolved external symbol MF_MT_AUDIO_SAMPLES_PER_SECOND
9>co_AudioDecoder.lib(co_AudioDecoderMF.obj) : error LNK2001: unresolved external symbol MF_MT_AUDIO_BLOCK_ALIGNMENT
9>co_AudioDecoder.lib(co_AudioDecoderMF.obj) : error LNK2001: unresolved external symbol MF_MT_AUDIO_BITS_PER_SAMPLE
9>co_AudioDecoder.lib(co_AudioDecoderMF.obj) : error LNK2001: unresolved external symbol MFMediaType_Audio
First of all it is strange because I have already use this project in other solution and there weren't problems, but ok after a research I have found out that I need to add in configuration Linker -> input a few more .libs
Mf.lib
Mfplat.lib
mfuuid.lib
(inspire of I don't have these lines in my other solution where does it works) and after I added these lines a lot of error gone, but one left
9>co_AudioDecoder.lib(co_AudioDecoderMF.obj) : error LNK2019: unresolved external symbol MFCreateSourceReaderFromByteStream referenced in function "private: bool __cdecl co_AudioDecoderMF::CreateSourceReader(void)" (?CreateSourceReader#co_AudioDecoderMF##AEAA_NXZ)
And I have not found nothing about how to solve it. I am a relatively new in c++ and it looks weird that in order to make MediaFoundation(big lib) work I need to spend a few hours in order to find out what to add in additional in order to make it works.
So, question is - what am I missing here?
You need to include this :
#pragma comment(lib, "mfreadwrite")
Documentation usually helps :
MFCreateSourceReaderFromByteStream function
Related
Is there a specific way to define a DllMain function in Rust? I have tried this:
use winapi::shared::ntdef::*;
use winapi::um::winnt::DLL_PROCESS_ATTACH;
use winapi::shared::minwindef::*;
use std::*;
#[no_mangle]
extern "stdcall" fn DllMain(hInstDll: HINSTANCE, fdwReason: DWORD, lpvReserved: LPVOID){
if fdwReason == DLL_PROCESS_ATTACH {
}
}
But windows doesn't seem to call the function when the dll is attached to a process?
Edit: Renaming function to _DllMainCRTStartup is recognized as an entry point by the compiler, but rust is unable to find the c-runtime libraries
`error: linking with 'link.exe' failed: exit code: 1120
|
= note: "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.26.28801\bin\HostX64\x64\link.exe" "/NOLOGO" "/NXCOMPAT" "/LIBPATH:C:\Users\Admin\.rustup\toolchains\stable-x86_64-pc-windows-msvc\lib\rustlib\x86_64-pc-windows-msvc\lib" "C:\Users\Admin\source\repos\dandra_but_rust\target\debug\deps\dandra_but_rust.2zwdumngih9wy4mr.rcgu.o" "/OUT:C:\Users\Admin\source\repos\dandra_but_rust\target\debug\deps\dandra_but_rust.dll" "/DEF:C:\Users\Admin\AppData\Local\Temp\rustc7Q6l64\lib.def" "C:\Users\Admin\source\repos\dandra_but_rust\target\debug\deps\dandra_but_rust.2ir3c20pqmwv4eun.rcgu.o" "/OPT:REF,NOICF" "/DLL" "/IMPLIB:C:\Users\Admin\source\repos\dandra_but_rust\target\debug\deps\dandra_but_rust.dll.lib" "/DEBUG" "/NATVIS:C:\Users\Admin\.rustup\toolchains\stable-x86_64-pc-windows-msvc\lib\rustlib\etc\intrinsic.natvis" "/NATVIS:C:\Users\Admin\.rustup\toolchains\stable-x86_64-pc-windows-msvc\lib\rustlib\etc\liballoc.natvis" "/NATVIS:C:\Users\Admin\.rustup\toolchains\stable-x86_64-pc-windows-msvc\lib\rustlib\etc\libcore.natvis" "/NATVIS:C:\Users\Admin\.rustup\toolchains\stable-x86_64-pc-windows-msvc\lib\rustlib\etc\libstd.natvis" "/LIBPATH:C:\Users\Admin\source\repos\dandra_but_rust\target\debug\deps" "/LIBPATH:C:\Users\Admin\source\repos\dandra_but_rust\target\debug\build\minhook-sys-148df4753bb64a28\out" "/LIBPATH:C:\Users\Admin\.rustup\toolchains\stable-x86_64-pc-windows-msvc\lib\rustlib\x86_64-pc-windows-msvc\lib" "C:\Users\Admin\source\repos\dandra_but_rust\target\debug\deps\libwinapi-1d830746c941a966.rlib" "C:\Users\Admin\.rustup\toolchains\stable-x86_64-pc-windows-msvc\lib\rustlib\x86_64-pc-windows-msvc\lib\libstd-e5130808ccb074ce.rlib" "C:\Users\Admin\.rustup\toolchains\stable-x86_64-pc-windows-msvc\lib\rustlib\x86_64-pc-windows-msvc\lib\libpanic_unwind-580326a9fdffe4b1.rlib" "C:\Users\Admin\.rustup\toolchains\stable-x86_64-pc-windows-msvc\lib\rustlib\x86_64-pc-windows-msvc\lib\librustc_demangle-a76d77b5d9ed4759.rlib" "C:\Users\Admin\.rustup\toolchains\stable-x86_64-pc-windows-msvc\lib\rustlib\x86_64-pc-windows-msvc\lib\libhashbrown-d5a5b7aa7eeea0b8.rlib" "C:\Users\Admin\.rustup\toolchains\stable-x86_64-pc-windows-msvc\lib\rustlib\x86_64-pc-windows-msvc\lib\librustc_std_workspace_alloc-4b74b4985b95e6c8.rlib" "C:\Users\Admin\.rustup\toolchains\stable-x86_64-pc-windows-msvc\lib\rustlib\x86_64-pc-windows-msvc\lib\libunwind-b2d5eb0d27518d1c.rlib" "C:\Users\Admin\.rustup\toolchains\stable-x86_64-pc-windows-msvc\lib\rustlib\x86_64-pc-windows-msvc\lib\libcfg_if-8a162ec37e71ea47.rlib" "C:\Users\Admin\.rustup\toolchains\stable-x86_64-pc-windows-msvc\lib\rustlib\x86_64-pc-windows-msvc\lib\liblibc-45fb7c94b612099e.rlib" "C:\Users\Admin\.rustup\toolchains\stable-x86_64-pc-windows-msvc\lib\rustlib\x86_64-pc-windows-msvc\lib\liballoc-3c0db88c6c3c2080.rlib" "C:\Users\Admin\.rustup\toolchains\stable-x86_64-pc-windows-msvc\lib\rustlib\x86_64-pc-windows-msvc\lib\librustc_std_workspace_core-ae8fea3b9ef7193c.rlib" "C:\Users\Admin\.rustup\toolchains\stable-x86_64-pc-windows-msvc\lib\rustlib\x86_64-pc-windows-msvc\lib\libcore-44bd5dbe4e29964c.rlib" "C:\Users\Admin\.rustup\toolchains\stable-x86_64-pc-windows-msvc\lib\rustlib\x86_64-pc-windows-msvc\lib\libcompiler_builtins-2e1363d96f00dd60.rlib" "advapi32.lib" "cfgmgr32.lib" "credui.lib" "gdi32.lib" "kernel32.lib" "msimg32.lib" "ole32.lib" "opengl32.lib" "secur32.lib" "shell32.lib" "user32.lib" "winspool.lib" "advapi32.lib" "ws2_32.lib" "userenv.lib" "msvcrt.lib"
= note: LINK : warning LNK4216: Exported entry point _DllMainCRTStartup
Creating library C:\Users\Admin\source\repos\dandra_but_rust\target\debug\deps\dandra_but_rust.dll.lib and object C:\Users\Admin\source\repos\dandra_but_rust\target\debug\deps\dandra_but_rust.dll.exp
libstd-e5130808ccb074ce.rlib(std-e5130808ccb074ce.std.cergmp4c-cgu.0.rcgu.o) : error LNK2001: unresolved external symbol __CxxFrameHandler3
libpanic_unwind-580326a9fdffe4b1.rlib(panic_unwind-580326a9fdffe4b1.panic_unwind.c9nntgss-cgu.0.rcgu.o) : error LNK2001: unresolved external symbol __CxxFrameHandler3
liballoc-3c0db88c6c3c2080.rlib(alloc-3c0db88c6c3c2080.alloc.3pxpxezw-cgu.0.rcgu.o) : error LNK2001: unresolved external symbol __CxxFrameHandler3
libstd-e5130808ccb074ce.rlib(std-e5130808ccb074ce.std.cergmp4c-cgu.0.rcgu.o) : error LNK2019: unresolved external symbol memcpy referenced in function _ZN4core3fmt5Write10write_char17h1ad50f755d81c59eE
liballoc-3c0db88c6c3c2080.rlib(alloc-3c0db88c6c3c2080.alloc.3pxpxezw-cgu.0.rcgu.o) : error LNK2001: unresolved external symbol memcpy
libcore-44bd5dbe4e29964c.rlib(core-44bd5dbe4e29964c.core.7rmb18uk-cgu.0.rcgu.o) : error LNK2001: unresolved external symbol memcpy
libstd-e5130808ccb074ce.rlib(std-e5130808ccb074ce.std.cergmp4c-cgu.0.rcgu.o) : error LNK2019: unresolved external symbol memset referenced in function _ZN4core3ops8function6FnOnce40call_once$u7b$$u7b$vtable.shim$u7d$$u7d$17h79aa7d690a3d5e88E
librustc_demangle-a76d77b5d9ed4759.rlib(rustc_demangle-a76d77b5d9ed4759.rustc_demangle.bwbqjk7y-cgu.0.rcgu.o) : error LNK2001: unresolved external symbol memset
libcore-44bd5dbe4e29964c.rlib(core-44bd5dbe4e29964c.core.7rmb18uk-cgu.0.rcgu.o) : error LNK2001: unresolved external symbol memset
libstd-e5130808ccb074ce.rlib(std-e5130808ccb074ce.std.cergmp4c-cgu.0.rcgu.o) : error LNK2019: unresolved external symbol memmove referenced in function _ZN4core3ptr90drop_in_place$LT$std..io..buffered..bufwriter..BufWriter$LT$W$GT$..flush_buf..BufGuard$GT$17hedcaf5acf9e62584E
liballoc-3c0db88c6c3c2080.rlib(alloc-3c0db88c6c3c2080.alloc.3pxpxezw-cgu.0.rcgu.o) : error LNK2001: unresolved external symbol memmove
libstd-e5130808ccb074ce.rlib(std-e5130808ccb074ce.std.cergmp4c-cgu.0.rcgu.o) : error LNK2019: unresolved external symbol memcmp referenced in function _ZN5alloc11collections5btree3map21BTreeMap$LT$K$C$V$GT$6insert17hc358a9b81795c956E
librustc_demangle-a76d77b5d9ed4759.rlib(rustc_demangle-a76d77b5d9ed4759.rustc_demangle.bwbqjk7y-cgu.0.rcgu.o) : error LNK2001: unresolved external symbol memcmp
libcore-44bd5dbe4e29964c.rlib(core-44bd5dbe4e29964c.core.7rmb18uk-cgu.0.rcgu.o) : error LNK2001: unresolved external symbol memcmp
libstd-e5130808ccb074ce.rlib(std-e5130808ccb074ce.std.cergmp4c-cgu.0.rcgu.o) : error LNK2019: unresolved external symbol strlen referenced in function _ZN3std3ffi5c_str7CString8from_raw17h67ae0c016f9720bbE
libpanic_unwind-580326a9fdffe4b1.rlib(panic_unwind-580326a9fdffe4b1.panic_unwind.c9nntgss-cgu.0.rcgu.o) : error LNK2019: unresolved external symbol _CxxThrowException referenced in function _ZN12panic_unwind8real_imp5panic17hd7ecf9c6caff3a53E
msvcrt.lib(delete_scalar.obj) : error LNK2019: unresolved external symbol free referenced in function "void __cdecl operator delete(void *)" (??3#YAXPEAX#Z)
C:\Users\Admin\source\repos\dandra_but_rust\target\debug\deps\dandra_but_rust.dll : fatal error LNK1120: 8 unresolved externals
error: aborting due to previous error
error: could not compile 'dandra_but_rust'`
I am having problems to link my libraries in order to make a dll on VS2013. I have to say that I needed a Desktop dll because of some troubles with the winapifamily so this is a Win32 project and I guess that migh also be an issue but I have not better solution so far. Some of the errors I get:
error LNK2001: unresolved external symbol __imp_NuiCreateSensorByIndex
error LNK2001: unresolved external symbol __imp_NuiSetDeviceStatusCallback
error LNK2001: unresolved external symbol __imp_NuiGetSensorCount
error LNK2001: unresolved external symbol "void __cdecl pcl::console::print(enum pcl::console::VERBOSITY_LEVEL,char const *,...)" (?print#console#pcl##YAXW4VERBOSITY_LEVEL#12#PEBDZZ)
error LNK2001: unresolved external symbol "protected: bool __cdecl pcl::PCLBase<struct pcl::PointXYZ>::deinitCompute(void)" (?deinitCompute#?$PCLBase#UPointXYZ#pcl###pcl##IEAA_NXZ)
error LNK2001: unresolved external symbol "protected: bool __cdecl pcl::PCLBase<struct pcl::PointXYZ>::initCompute(void)" (?initCompute#?$PCLBase#UPointXYZ#pcl###pcl##IEAA_NXZ)
Thank you.
If you want to include external resources you need to explicitly feed them into the Linker or reference them as dynamic lib (explicitly or implicit)
This answer shows a few good steps : https://stackoverflow.com/a/20410798/351861
This question already has answers here:
Linker error LNK2019 from 3rd party library
(3 answers)
Closed 10 years ago.
I tried to see what is the problem(s) related to those error messages. I tried to check everything but still, I'm not finding the source of the error.
According to you, the obj error followed by error LNK2019: unresolved external symbol imp__is_CaptureVideo referenced in function, what is its provenance?
I'm using Visual Express C++ 2010.
Thank you.
1>IdsSimpleLiveDlg.obj : error LNK2019: unresolved external symbol __imp__is_CaptureVideo referenced in function "private: void __thiscall CIdsSimpleLiveDlg::OnButtonStart(void)" (?OnButtonStart#CIdsSimpleLiveDlg##AAEXXZ)
1>IdsSimpleLiveDlg.obj : error LNK2019: unresolved external symbol __imp__is_StopLiveVideo referenced in function "private: void __thiscall CIdsSimpleLiveDlg::OnButtonStop(void)" (?OnButtonStop#CIdsSimpleLiveDlg##AAEXXZ)
1>IdsSimpleLiveDlg.obj : error LNK2019: unresolved external symbol __imp__is_SetImageMem referenced in function "private: void __thiscall CIdsSimpleLiveDlg::OnBnClickedButtonLoadParameter(void)" (?OnBnClickedButtonLoadParameter#CIdsSimpleLiveDlg##AAEXXZ)
1>IdsSimpleLiveDlg.obj : error LNK2019: unresolved external symbol __imp__is_AllocImageMem referenced in function "private: void __thiscall CIdsSimpleLiveDlg::OnBnClickedButtonLoadParameter(void)" (?OnBnClickedButtonLoadParameter#CIdsSimpleLiveDlg##AAEXXZ)
1>IdsSimpleLiveDlg.obj : error LNK2019: unresolved external symbol __imp__is_SetColorMode referenced in function "private: void __thiscall CIdsSimpleLiveDlg::OnBnClickedButtonLoadParameter(void)" (?OnBnClickedButtonLoadParameter#CIdsSimpleLiveDlg##AAEXXZ)
1>IdsSimpleLiveDlg.obj : error LNK2019: unresolved external symbol __imp__is_AOI referenced in function "private: void __thiscall CIdsSimpleLiveDlg::OnBnClickedButtonLoadParameter(void)" (?OnBnClickedButtonLoadParameter#CIdsSimpleLiveDlg##AAEXXZ)
1>IdsSimpleLiveDlg.obj : error LNK2019: unresolved external symbol __imp__is_FreeImageMem referenced in function "private: void __thiscall CIdsSimpleLiveDlg::OnBnClickedButtonLoadParameter(void)" (?OnBnClickedButtonLoadParameter#CIdsSimpleLiveDlg##AAEXXZ)
1>IdsSimpleLiveDlg.obj : error LNK2019: unresolved external symbol __imp__is_ParameterSet referenced in function "private: void __thiscall CIdsSimpleLiveDlg::OnBnClickedButtonLoadParameter(void)" (?OnBnClickedButtonLoadParameter#CIdsSimpleLiveDlg##AAEXXZ)
1>IdsSimpleLiveDlg.obj : error LNK2019: unresolved external symbol __imp__is_EnableMessage referenced in function "private: bool __thiscall CIdsSimpleLiveDlg::OpenCamera(void)" (?OpenCamera#CIdsSimpleLiveDlg##AAE_NXZ)
1>IdsSimpleLiveDlg.obj : error LNK2019: unresolved external symbol __imp__is_GetSensorInfo referenced in function "private: bool __thiscall CIdsSimpleLiveDlg::OpenCamera(void)" (?OpenCamera#CIdsSimpleLiveDlg##AAE_NXZ)
1>IdsSimpleLiveDlg.obj : error LNK2019: unresolved external symbol __imp__is_RenderBitmap referenced in function "private: long __thiscall CIdsSimpleLiveDlg::OnUEyeMessage(unsigned int,long)" (?OnUEyeMessage#CIdsSimpleLiveDlg##AAEJIJ#Z)
1>IdsSimpleLiveDlg.obj : error LNK2019: unresolved external symbol __imp__is_ExitCamera referenced in function "private: void __thiscall CIdsSimpleLiveDlg::ExitCamera(void)" (?ExitCamera#CIdsSimpleLiveDlg##AAEXXZ)
1>IdsSimpleLiveDlg.obj : error LNK2019: unresolved external symbol __imp__is_GetColorDepth referenced in function "private: int __thiscall CIdsSimpleLiveDlg::InitDisplayMode(void)" (?InitDisplayMode#CIdsSimpleLiveDlg##AAEHXZ)
1>IdsSimpleLiveDlg.obj : error LNK2019: unresolved external symbol __imp__is_SetDisplayMode referenced in function "private: int __thiscall CIdsSimpleLiveDlg::InitDisplayMode(void)" (?InitDisplayMode#CIdsSimpleLiveDlg##AAEHXZ)
1>IdsSimpleLiveDlg.obj : error LNK2019: unresolved external symbol __imp__is_GetDuration referenced in function "private: int __thiscall CIdsSimpleLiveDlg::InitCamera(unsigned long *,struct HWND__ *)" (?InitCamera#CIdsSimpleLiveDlg##AAEHPAKPAUHWND__###Z)
1>IdsSimpleLiveDlg.obj : error LNK2019: unresolved external symbol __imp__is_InitCamera referenced in function "private: int __thiscall CIdsSimpleLiveDlg::InitCamera(unsigned long *,struct HWND__ *)" (?InitCamera#CIdsSimpleLiveDlg##AAEHPAKPAUHWND__###Z)
1>IdsSimpleLiveDlg.obj : error LNK2019: unresolved external symbol __imp__is_ImageFormat referenced in function "private: void __thiscall CIdsSimpleLiveDlg::GetMaxImageSize(int *,int *)" (?GetMaxImageSize#CIdsSimpleLiveDlg##AAEXPAH0#Z)
1>nafxcwd.lib(appcore.obj) : error LNK2001: unresolved external symbol ___argv
1>nafxcwd.lib(appcore.obj) : error LNK2001: unresolved external symbol ___argc
1>C:\Program Files\IDS\uEye\Develop\Source\SimpleLive\Debug\po.exe : fatal error LNK1120: 19 unresolved externals
I have added the correspondent library by clicking on the properties
of my project and then, adding the directory to the Library Directories
It seems like you've added the 'Additional Library Directory' to your VS Project - but didn't link the actual library file (windows extension: .lib). I think what you did is
Project Properties -> Configuration Properties-> Linker -> General -> Additional Library Directories
and added the directoy where your 3rd party '.lib' is inside. But in fact this doesn't link against that '.lib' file by itself (it just added the directory where VS is searching for the linked .lib files).
Try the following:
Right click on your project -> Project Properties -> Configuration Properties-> Linker -> Input -> Additional Dependencies
There is a list like:
'kernel32.lib;user32.lib;...;%(AdditionalDependencies)'
And somewehere inside there should the name of your '.lib file' appear. If it doesn't, you've to add it there. I.e. if the lib of your 3rd party library is named 'myLib.lib' you would insert there instead
'kernel32.lib;user32.lib;...;myLib.lib;%(AdditionalDependencies)'
I wrote a code in C++ called FaceTracker.cpp and other code in Matlab that do some analyzes and statics.
What I need to do is adding a button in matlab that calls the FaceTracker when being pressed. I tried to use the following command:
system (['FaceTracker.exe <' nameOfVideo]);
but it doesn't work. It opens the FaceTracker.exe GUI, then it stops ! (Like when internet explorer or any other program does sometimes\hang) with the msg "FaceTracker.exe stoped working.
When I tried to run the .exe from command prompt it showed me the following error:
Assertion Faile: Type == IO::TRACKER ... Debug error! R6010 - abort() has been called.
From what i understd from the answers\ other sites is that I need to statically link libraries.
I read in one site that I need to make the following changes:
The CRT:
• Configuration Properties -> C/C++ -> Code Generation: Where it reads Runtime Library, change to Multi-Threaded (/MT).
The manifest must go:
• Configuration Properties -> Manifest Tool -> Input and Output: Where it reads Embed Manifest, change to No.
But when I do it (Change to /MT) I start getting the following errors:
1> Generating Code... 1>LINK : warning LNK4098: defaultlib 'LIBCMT' conflicts with use of other libs; use /NODEFAULTLIB:library 1>libcpmtd.lib(xmbtowc.obj) : error LNK2001: unresolved external symbol __CrtDbgReportW 1>Tracker.obj : error LNK2019: unresolved external symbol __CrtDbgReportW referenced in function "public: void
__thiscall FACETRACKER::Tracker::Load(char const *)" (?Load#Tracker#FACETRACKER##QAEXPBD#Z) 1>libcpmtd.lib(stdthrow.obj) : error LNK2001: unresolved external symbol __CrtDbgReportW 1>libcpmtd.lib(cout.obj) : error LNK2001: unresolved external symbol
__CrtDbgReportW 1>libcpmtd.lib(cin.obj) : error LNK2001: unresolved external symbol __CrtDbgReportW 1>IO.obj : error LNK2001: unresolved external symbol __CrtDbgReportW 1>Patch.obj : error LNK2001: unresolved external symbol __CrtDbgReportW 1>PAW.obj : error LNK2001: unresolved external symbol __CrtDbgReportW 1>PDM.obj : error LNK2001: unresolved external symbol __CrtDbgReportW 1>CLM.obj : error LNK2001: unresolved external symbol __CrtDbgReportW 1>FaceTracker.obj : error LNK2001: unresolved external symbol __CrtDbgReportW 1>FCheck.obj : error LNK2001: unresolved external symbol __CrtDbgReportW 1>FDet.obj : error LNK2001: unresolved external symbol __CrtDbgReportW 1>libcpmtd.lib(cin.obj) : error LNK2001: unresolved external symbol
__free_dbg 1>libcpmtd.lib(xmbtowc.obj) : error LNK2001: unresolved external symbol __free_dbg 1>Tracker.obj : error LNK2001: unresolved external symbol __free_dbg 1>libcpmtd.lib(xdebug.obj) : error LNK2001: unresolved external symbol __free_dbg 1>libcpmtd.lib(locale0.obj) : error LNK2001: unresolved external symbol __free_dbg 1>libcpmtd.lib(cout.obj) : error LNK2001: unresolved external symbol
__free_dbg 1>IO.obj : error LNK2001: unresolved external symbol __free_dbg 1>Patch.obj : error LNK2001: unresolved external symbol __free_dbg 1>PAW.obj : error LNK2001: unresolved external symbol __free_dbg 1>PDM.obj : error LNK2001: unresolved external symbol __free_dbg 1>CLM.obj : error LNK2019: unresolved external symbol __free_dbg referenced in function "private: void __thiscall std::_Yarn<char>::_Tidy(void)" (?_Tidy#?$_Yarn#D#std##AAEXXZ) 1>FaceTracker.obj : error LNK2001: unresolved external symbol
__free_dbg 1>FCheck.obj : error LNK2001: unresolved external symbol __free_dbg 1>FDet.obj : error LNK2001: unresolved external symbol __free_dbg 1>libcpmtd.lib(xdebug.obj) : error LNK2019: unresolved external symbol __malloc_dbg referenced in function "void * __cdecl operator new(unsigned int,struct std::_DebugHeapTag_t const &,char
*,int)" (??2#YAPAXIABU_DebugHeapTag_t#std##PADH#Z) 1>libcpmtd.lib(locale0.obj) : error LNK2001: unresolved external symbol __malloc_dbg 1>libcpmtd.lib(xmbtowc.obj) : error LNK2001: unresolved external symbol __malloc_dbg 1>libcpmtd.lib(_tolower.obj) : error LNK2019: unresolved external symbol __calloc_dbg referenced in function __Getctype 1>C:\Users\wew\Documents\Jam3a\PROJECT-2012!!\FindSymetryInFaces\FaceTracker\Debug\FaceTracker.exe : fatal error LNK1120: 4 unresolved externals
Any Suggestions?
What do I Have to do in order to be able to use the FaceTracker.exe in every computer, also the ones that doesn't have c++\vs compiler?
besides, why does my program OPENS when I call it from matlab but then Hangs\stops working?
Thank in advance.
This almost certainly has nothing to do with debug versus release or whether mt is enabled. You are not making a matlab extension, just using a binary from the command line. If the program works when you type things in from the command line, it should work when called from Matlab unless you are running low on memory (highly unlikely also).
I would examine the contents of . .
['FaceTracker.exe < ' InputVid]
...and copy and paste the string directly into the command line (system, not Matlab) to see if you can replicate the error. The error is most likely occurring because your exe is not handling the file string well.
Try putting the inputvid, calling m file, and FaceTracker.exe in the working directory to make the most simple scenario. If that works, make things more complex by placing input vid into another directory and bug hunt from there.
Best of luck!
I think this exe file depends on some other libraries. You should copy them into one of the directories in your system parameter PATH. Or you can use the static link option when build your project.
Your applications don't require the entire Visual C++ compiler to be installed, just the runtime library. Microsoft has a free redistributable which can add this runtime library to any computer. You can find vcredist_x86.exe in your Visual C++ install path, or download it from http://www.microsoft.com/en-us/download/details.aspx?id=8328
I try to build cpp file using eclipse cdt. Linker throws "unresolved external symbol", however path to lib file that contains implementation for function is listed in LIB environment variable on Project properties->C/C++ Build->Environment
What am I doing wrong?
UPD I try to build file. There is lib RpcRT4.Lib on the path C:\Program Files\Microsoft SDKs\Windows\v7.0A\Lib\
And linker fails:
**** Build of configuration Debug for project test cpp ****
**** Internal Builder is used for build ****
link /debug /nologo /OUT:test cpp.exe main.obj
main.obj : error LNK2019: unresolved external symbol __imp__RpcStringFreeA#4 referenced in function "bool __cdecl Initialize_CreateWindowClass(void)"(?Initialize_CreateWindowClass##YA_NXZ)
main.obj : error LNK2019: unresolved external symbol __imp__RegisterClassA#4 referenced in function "bool __cdecl Initialize_CreateWindowClass(void)" (?Initialize_CreateWindowClass##YA_NXZ)
main.obj : error LNK2019: unresolved external symbol __imp__UuidToStringA#8 referenced in function "bool __cdecl Initialize_CreateWindowClass(void)" (?Initialize_CreateWindowClass##YA_NXZ)
main.obj : error LNK2019: unresolved external symbol __imp__UuidCreate#4 referenced in function "bool __cdecl Initialize_CreateWindowClass(void)" (?Initialize_CreateWindowClass##YA_NXZ)
main.obj : error LNK2019: unresolved external symbol __imp__DefWindowProcA#16 referenced in function "long __stdcall SkypeAPITest_Windows_WindowProc(struct HWND__ *,unsigned int,unsigned int,long)" (?SkypeAPITest_Windows_WindowProc##YGJPAUHWND__##IIJ#Z)
main.obj : error LNK2019: unresolved external symbol __imp__PostQuitMessage#4 referenced in function "long __stdcall SkypeAPITest_Windows_WindowProc(struct HWND__ *,unsigned int,unsigned int,long)" (?SkypeAPITest_Windows_WindowProc##YGJPAUHWND__##IIJ#Z)
main.obj : error LNK2019: unresolved external symbol __imp__UnregisterClassA#8 referenced in function "void __cdecl DeInitialize_DestroyWindowClass(void)" (?DeInitialize_DestroyWindowClass##YAXXZ)
main.obj : error LNK2019: unresolved external symbol __imp__CreateWindowExA#48 referenced in function "bool __cdecl Initialize_CreateMainWindow(void)" (?Initialize_CreateMainWindow##YA_NXZ)
main.obj : error LNK2019: unresolved external symbol __imp__DestroyWindow#4 referenced in function "void __cdecl DeInitialize_DestroyMainWindow(void)" (?DeInitialize_DestroyMainWindow##YAXXZ)
main.obj : error LNK2019: unresolved external symbol __imp__DispatchMessageA#4 referenced in function "void __cdecl Global_MessageLoop(void)" (?Global_MessageLoop##YAXXZ)
main.obj : error LNK2019: unresolved external symbol __imp__TranslateMessage#4 referenced in function "void __cdecl Global_MessageLoop(void)" (?Global_MessageLoop##YAXXZ)
main.obj : error LNK2019: unresolved external symbol __imp__GetMessageA#16 referenced in function "void __cdecl Global_MessageLoop(void)" (?Global_MessageLoop##YAXXZ)
main.obj : error LNK2019: unresolved external symbol __imp__PostMessageA#16 referenced in function "void __cdecl Global_InputProcessingThread(void *)" (?Global_InputProcessingThread##YAXPAX#Z)
main.obj : error LNK2019: unresolved external symbol __imp__SendMessageA#16 referenced in function "void __cdecl Global_InputProcessingThread(void *)" (?Global_InputProcessingThread##YAXPAX#Z)
main.obj : error LNK2019: unresolved external symbol __imp__RegisterWindowMessageA#4 referenced in function _main
test cpp.exe : fatal error LNK1120: 15 unresolved externals
Build error occurred, build is stopped
Time consumed: 2438 ms.
And environment settings for project
I'm not entirely clear on whether you've already done this based on the question, but just adding the directory to your linker's search path isn't enough for any compiler/linker I've ever used. There could be hundreds of different libraries in there, even different versions of the same library, and the linker has no idea which ones you do and don't want. You need to tell it, explicitly, to link against the library using the appropriate parameter.
It looks like you're using the Microsoft linker, which I've never used, so I can't help you with the specific flag but it should be easy enough to find what it is in the documentation if that's the issue. I presume Eclipse has a method of specifying this in the GUI as well which should be generic across the various compilers it supports.