ImageOptim / libimagequant

Palette quantization library that powers pngquant and other PNG optimizers
https://pngquant.org/lib
Other
780 stars 132 forks source link

VS build fail help #46

Closed HeLinSpace closed 2 years ago

HeLinSpace commented 3 years ago

image image Error C3015 OpenMP "for" statement has an incorrect initialization format of Imagequant :\ workSpace.net \libimagequant\ mediancut-c 202

kornelski commented 3 years ago

This is because Visual Studio doesn't support C99 properly, and doesn't understand for(unsigned int i=0; Try changing it to unsigned int i; and for(i=0;

yudaichen commented 3 years ago

Excuse me. How to solve it?Have you considered the ease of use of the software? image

kornelski commented 3 years ago

I can't help that Microsoft can't write a good C compiler, and Visual Studio still struggles with a C standard from year 1999.

I have a branch with workarounds for the buggy Microsoft compiler. Try using that branch, and let me know if VS still struggles with it:

https://github.com/ImageOptim/libimagequant/tree/msvc

Alternatively, switch to a modern compiler, like GCC 11.

kornelski commented 2 years ago

Fixed. Use cargo build --release.