0

I have been trying to link the FFMPEG static libraries to Visual studio 2012 in c++ environment. But i get the following error.

  • Error 1 error LNK1104: cannot open file 'avcodec.lib' C:\Users\username\Documents\Visual Studio 2012\Projects\ConsoleApplication5\ConsoleApplication5\LINK ConsoleApplication5

my lib files were located in C:\Users\username\Documents\Visual Studio 2012\Projects\ConsoleApplication5\ConsoleApplication5\ExtLib\lib

The compile seems to be fine. The command line is

  • /Yu"stdafx.h" /GS /W3 /Zc:wchar_t /I"C:\Users\username\Documents\Visual Studio 2012\Projects\ConsoleApplication5\ConsoleApplication5\ExtLib\include" /Zi /Gm /Od /sdl /Fd"x64\Debug\vc110.pdb" /fp:precise /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_UNICODE" /D "UNICODE" /errorReport:prompt /WX- /Zc:forScope /RTC1 /Gd /MTd /Fa"x64\Debug\" /EHsc /nologo /Fo"x64\Debug\" /Fp"x64\Debug\ConsoleApplication5.pch"

The main issue seems to be at the linking stage where I have just not been able to get VS2012 to find my ffmpeg .lib files

The linker command line is below:

  • /OUT:"C:\Users\username\Documents\Visual Studio 2012\Projects\ConsoleApplication5\x64\Debug\ConsoleApplication5.exe" /MANIFEST /NXCOMPAT /PDB:"C:\Users\username\Documents\Visual Studio 2012\Projects\ConsoleApplication5\x64\Debug\ConsoleApplication5.pdb" /DYNAMICBASE "avcodec.lib" "kernel32.lib" "user32.lib" "gdi32.lib" "winspool.lib" "comdlg32.lib" "advapi32.lib" "shell32.lib" "ole32.lib" "oleaut32.lib" "uuid.lib" "odbc32.lib" "odbccp32.lib" /DEBUG /MACHINE:X64 /OPT:NOREF /INCREMENTAL /PGD:"C:\Users\username\Documents\Visual Studio 2012\Projects\ConsoleApplication5\x64\Debug\ConsoleApplication5.pgd" /SUBSYSTEM:CONSOLE /MANIFESTUAC:"level='asInvoker' uiAccess='false'" /ManifestFile:"x64\Debug\ConsoleApplication5.exe.intermediate.manifest" /ERRORREPORT:PROMPT /NOLOGO /LIBPATH:"/LIBPATH:C:\Users\username\Documents\Visual Studio 2012\Projects\ConsoleApplication5\ConsoleApplication5\ExtLib\lib" /TLBID:1

I cant figure out why the linker cant locate my ffmpeg lib files even though they are physically located in the /LIBPATH area - c:...\vs12...\ExtLib\lib

Pferd
  • 49
  • 1
  • 1
  • 8

2 Answers2

0

Your LIBPATH doesn't look correct - it should be quoted like this if the path contains spaces:

/LIBPATH:"C:\Users\username\Documents\Visual Studio 2012\Projects\ConsoleApplication5\ConsoleApplication5\ExtLib\lib"

You seem to have an additional LIBPATH inside the quotes (in asterisks below)

/LIBPATH:"**/LIBPATH:**C:\Users\username\Documents\Visual Studio 2012\Projects\ConsoleApplication5\ConsoleApplication5\ExtLib\lib"

Roger Rowland
  • 25,885
  • 11
  • 72
  • 113
0

Thanks a lot! it helped in pulling out the problems. The most important step is to add the absolute path of lib files in the additional dependencies option. I have now made a comprehensive and detailed report of what steps are to be followed to get it ported. If some one needed, please find it here. [link] (http://ramu492.blogspot.in/2013/06/porting-ffmpeg-on-to-winodws7-and.html)

Pferd
  • 49
  • 1
  • 1
  • 8