microsoft / FFmpegInterop

This is a code sample to make it easier to use FFmpeg in Windows applications.
Apache License 2.0
1.29k stars 310 forks source link

fatal error LNK1120: 1 unresolved externals #234

Closed xiedongweo closed 6 years ago

xiedongweo commented 6 years ago

I followed this Instructions to compile ffmpeg x64 for UWP, but I got the following error:

BEGIN ./ffconf.jNjZgZMl.c 1 int main(void){ return 0; } END ./ffconf.jNjZgZMl.c cl -nologo -MD -DWINAPI_FAMILY=WINAPI_FAMILY_APP -D_WIN32_WINNT=0x0A00 -c -Fo./ffconf.HqaC4Hfy.o ./ffconf.jNjZgZMl.c ffconf.jNjZgZMl.c /d/Working_Space/GitHub/FFmpegInterop/ffmpeg/compat/windows/mslink -APPCONTAINER WindowsApp.lib -nologo -out:./ffconf.hSEPEeZV.exe ./ffconf.HqaC4Hfy.o LINK : error LNK2001: unresolved external symbol _mainCRTStartup C:\Program Files (x86)\Windows Kits\10\lib\10.0.16299.0\um\x64\WindowsApp.lib : warning LNK4272: library machine type 'x64' conflicts with target machine type 'X86' C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\lib\store\amd64\MSVCRT.lib : warning LNK4272: library machine type 'x64' conflicts with target machine type 'X86' ./ffconf.hSEPEeZV.exe : fatal error LNK1120: 1 unresolved externals C compiler test failed.

Could anyone help me on this issue?

brabebhin commented 6 years ago

Try reinstalling Visual Studio 2015.

xiedongweo commented 6 years ago

@mcosmin222 Are you sure that my Visual Studio 2015 has some problems? Reinstalling VS is not easy for me.

brabebhin commented 6 years ago

I encountered the "C compiler test failed" error in 2 instances:

1) Incorrectly configured VS command prompt environment for the target platform (i.e, use the x64 config for ARM for example). 2) Something conflicting within VS setups, this usually happens if VS itself is corrupted or if several versions of VS are installed.

xiedongweo commented 6 years ago

@mcosmin222 Yes. My machine installed VS 2015 & 2017, but it's unrealistic to uninstall the VS 2017 for compiling ffmpeg for UWP. Have you any other ways to resolve this issue?

brabebhin commented 6 years ago

Sadly, no. Perhaps @khouzam can help more

khouzam commented 6 years ago

Hi @xiedongweo

Can you verify which Developer Command Prompt shortcut you are using?

Also, can you try from a plain command prompt to run buildFFmpeg.bat from the FFmpepInterop repo? This should setup your environment correctly for the architectures you specify.

xiedongweo commented 6 years ago

@khouzam Thanks for your suggestion. You're right. Using the command prompt to run buildFFmpeg.bat is an easy and good way. Now I build it successfully. Thank you so much.