JPEG parameter struct mismatch

前端 未结 2 565
陌清茗
陌清茗 2021-01-18 11:39

Ater compiling libjpeg and then using it, I stumbled upon the problem:

JPEG parameter struct mismatch: library thinks size is 512, caller expects 492
         


        
相关标签:
2条回答
  • 2021-01-18 12:04

    It seems that the static package architecture does not conform to the current package architecture when the linker is connected. It is recommended to download the source code and compile it into a static library with the same parameters. Try again, remember to quote the correct version.

    0 讨论(0)
  • 2021-01-18 12:19

    In my case, the problem was that the library and my program were compiled with different values of HAVE_BOOLEAN, so boolean type had different size.

    Library was compiled with HAVE_BOOLEAN not defined, so it was using int as defined in libjpeg. Program was compiled with HAVE_BOOLEAN defined, and because some other headers were included before libjpeg, it was using unsigned char as defined in Windows RTL.

    Reason I used HAVE_BOOLEAN was to fix compile error about this, but it then caused a linker error. Instead, the proper solution was to not include Windows RTL (or any file that includes it) in the file that uses libjpeg.

    0 讨论(0)
提交回复
热议问题