FFmpeg Code Debug mode no problem, release mode error

Source: Internet
Author: User

ffmpeg Code Debug mode no problem, release mode error

I compile the project when I do the fire monitoring and warning software, and I need to decode the H264 code stream using FFmpeg. Found "cannot locate program input point" when switching to release when working with FFmpeg debug version? Avcodec-56.dll "in the dynamic link library.


I am directly from the http://ffmpeg.zeranoe.com/builds/website up and down the DLL that has been compiled through. At the time I suspected that the DLL was compiled in debug mode, not release version.

But the files I downloaded did not differentiate between debug and release versions of the DLL.

Fortunately, find the keyword "ffmpeg release error dynamic link library failed", found the solution:

This problem can be resolved as long as the project properties are modified. First open the Project properties , find the linked project , in the optimization has a reference item, choose to keep unreferenced data (/opt:noref), my project is English version, as follows:


Find information about /opt(optimization) on MSDN

REF | Noref

/opt:ref clears functions and data that are never referenced;

/opt:noref preserves functions and data that are never referenced.

When /oft:ref is enabled , link removes unreferenced packaged functions and data. If the object has already been compiled with the /gy option, it will contain packaged functions and data (COMDAT). This optimization is known as transitive comdat elimination. By default, /opt:refis enabled in non-debug builds. To override this default and leave unreferenced comdat in your program, specify /opt:noref. You can use the /include option to override the removal of a specific symbol.

       is enabled explicitly or by default; /opt:ref   , the restricted form of   is enabled; /OPT:ICF (only the same function is collapsed).   /opt:ref   instead of   /OPT:ICF , You must specify   /opt:ref,noicf   or   /OPT:NOICF .

If /debugis specified, the default entry for/OPT is NOREF, and all functions remain in the image.  To override this default and optimize debug builds, specify /opt:ref. Because /opt:ref implicitly uses /OPT:ICF, it is recommended that you specify /OPT:NOICF at the same time to retain the same functions in the debug build. This makes it easier to read the stack traces and set breakpoints in functions that should be collapsed together. The /opt:ref option disables incremental linking.

You must explicitly mark the const data as comdat; use __declspec (selectany).

Specifies that /OPT:ICF does not enable the/OPT:REF option.

icf[= iterations ]| NOICF

Use /opt:icf[=iterations] to perform the same comdat folding.  Redundant comdat can be removed from the linker output. The optional iterations parameter specifies the number of times the symbol is traversed to find duplicates. The default number of iterations is two times. Additional iterations can find more duplicates that have not been discovered by collapsing in the previous iteration.

The linker behaves differently when you specify /opt:ref and the ICF defaults to be valid when you explicitly specify/OPT:REF,ICF.  Forms that use /opt:ref -enabled ICF alone do not collapse read-only data (including. Rdata,. pdata, and. XData). Therefore, fewer functions are collapsed when the image is generated for x64 because the functions in these modules are more dependent on read-only data such as. pdata and. XData. To get the full ICF collapse behavior, explicitly specify /OPT:ICF.

To Place a function in Comdat , use the /gy compiler option; to place the const data, declare it as __declspec (selectany) . For more information about how to specify data for collapsing, see selectany.

By default, if REF is open, ICF is turned on.  To override this default value, use noicfwhen you specify REF . When /OPT:ICF is not specified in a debug build, you must explicitly specify /opt:ref to enable COMDAT folding. However, because /OPT:ICF can merge the same data or function, it can also change the name of the function that is displayed in the stack trace. It also makes it impossible for you to set breakpoints in certain functions or examine some data in the debugger, and let you enter unexpected functions when stepping into code. Therefore, it is recommended not to use /OPT:ICFin debug builds, unless the benefits of smaller code compensate for these deficiencies.

FFmpeg Code Debug mode no problem, release mode error

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.