Jump to content
  • Advertisement
Finalspace

VStudio links to wrong DLL?

Recommended Posts

I am getting a crash in a FFMPEG applications, when i use linked shared libraries. It compiles just fine, but when i execute the application i get a exception that the function "sws_freeContext" is not found in "swresample-3.dll". But the function is in a totally different library called "swscale-5.dll", because the function is from the software-image-scale library, hence the prefix "sws" - so visual studio does bullshit here, linking to the wrong DLL?

Looking into the swscale-5.def and the swresample-3.def i can clearly see, that the functions are properly defined:

swresample-3.def (Audio resampling)

EXPORTS
    swr_alloc
    swr_alloc_set_opts
    swr_build_matrix
    swr_close
    swr_config_frame
    swr_convert
    swr_convert_frame
    swr_drop_output
    swr_ffversion
    swr_free
    swr_get_class
    swr_get_delay
    swr_get_out_samples
    swr_init
    swr_inject_silence
    swr_is_initialized
    swr_next_pts
    swr_set_channel_mapping
    swr_set_compensation
    swr_set_matrix
    swresample_configuration
    swresample_license
    swresample_version

 

swscale-5.def (Image format conversion)

EXPORTS
    sws_addVec
    sws_allocVec
    sws_alloc_context
    sws_alloc_set_opts
    sws_cloneVec
    sws_convVec
    sws_convertPalette8ToPacked24
    sws_convertPalette8ToPacked32
    sws_freeContext
    sws_freeFilter
    sws_freeVec
    sws_getCachedContext
    sws_getCoefficients
    sws_getColorspaceDetails
    sws_getConstVec
    sws_getContext
    sws_getDefaultFilter
    sws_getGaussianVec
    sws_getIdentityVec
    sws_get_class
    sws_init_context
    sws_isSupportedEndiannessConversion
    sws_isSupportedInput
    sws_isSupportedOutput
    sws_normalizeVec
    sws_printVec2
    sws_scale
    sws_scaleVec
    sws_setColorspaceDetails
    sws_shiftVec
    sws_subVec
    swscale_configuration
    swscale_license
    swscale_version

 

Also i double checked my FFMPEG shared build and the libs match the shared dll´s properly - so i have no idea, what the heck is wrong.

Can i force visual studio to use a specific .DLL/.DEF match in the linking... ???

 

The (Shared, Dev) build i use is https://ffmpeg.zeranoe.com/builds/

And i just want to compile https://git.ffmpeg.org/gitweb/ffmpeg.git/blob/1b5d3c0:/fftools/ffplay.c with a new visual studio project and SDL2.

Edited by Finalspace

Share this post


Link to post
Share on other sites
Advertisement

Rebuild the libraries fixed the problem for me.

for x86 libs:
lib /def:swscale-5.def /out:swscale.lib /machine:x86
lib /def:avcodec-58.def /out:avcodec.lib /machine:x86
lib /def:avdevice-58.def /out:avdevice.lib /machine:x86
lib /def:avfilter-7.def /out:avfilter.lib /machine:x86
lib /def:avformat-58.def /out:avformat.lib /machine:x86
lib /def:avutil-56.def /out:avutil.lib /machine:x86
lib /def:postproc-55.def /out:postproc.lib /machine:x86
lib /def:swresample-3.def /out:swresample.lib /machine:x86

for x64 libs with /machine:x64

lib /def:swscale-5.def /out:swscale.lib /machine:x64

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!