Unable to compile SOIL2
https://github.com/SpartanJ/SOIL2
I want to compile it into a library, is this command correct?
occ -Wd src/SOIL2/*.c src/common/*.cpp -o SOIL2
BTW, this is the error messages:
occ (OrangeC) Version 6.73.1
Copyright (C) LADSoft 2006-2025
src/SOIL2/image_DXT.c
src/SOIL2/image_helper.c
src/SOIL2/SOIL2.c
Error src\SOIL2\stb_image.h(748): Could not open <emmintrin.h> for input
Error( 18) src\SOIL2\stb_image.h(2593): Undefined symbol '__m128i'
Error( 18) src\SOIL2\stb_image.h(2593): Undefined symbol 'row0'
Error( 18) src\SOIL2\stb_image.h(2593): Undefined symbol 'row1'
Error( 18) src\SOIL2\stb_image.h(2593): Undefined symbol 'row2'
Error( 18) src\SOIL2\stb_image.h(2593): Undefined symbol 'row3'
Error( 18) src\SOIL2\stb_image.h(2593): Undefined symbol 'row4'
Error( 18) src\SOIL2\stb_image.h(2593): Undefined symbol 'row5'
Error( 18) src\SOIL2\stb_image.h(2593): Undefined symbol 'row6'
Error( 18) src\SOIL2\stb_image.h(2593): Undefined symbol 'row7'
Error( 11) src\SOIL2\stb_image.h(2594): Syntax error: ; expected
Error( 18) src\SOIL2\stb_image.h(2594): Undefined symbol 'tmp'
Error( 11) src\SOIL2\stb_image.h(2675): Syntax error: ; expected
Error( 18) src\SOIL2\stb_image.h(2675): Undefined symbol 'rot0_0'
Error( 11) src\SOIL2\stb_image.h(2676): Syntax error: ; expected
Error( 18) src\SOIL2\stb_image.h(2676): Undefined symbol 'rot0_1'
Error( 11) src\SOIL2\stb_image.h(2677): Syntax error: ; expected
Error( 18) src\SOIL2\stb_image.h(2677): Undefined symbol 'rot1_0'
Error( 11) src\SOIL2\stb_image.h(2678): Syntax error: ; expected
Error( 18) src\SOIL2\stb_image.h(2678): Undefined symbol 'rot1_1'
Error( 11) src\SOIL2\stb_image.h(2679): Syntax error: ; expected
Error( 18) src\SOIL2\stb_image.h(2679): Undefined symbol 'rot2_0'
Error( 11) src\SOIL2\stb_image.h(2680): Syntax error: ; expected
Error( 18) src\SOIL2\stb_image.h(2680): Undefined symbol 'rot2_1'
Error( 11) src\SOIL2\stb_image.h(2681): Syntax error: ; expected
Error( 1) src\SOIL2\stb_image.h(2681): Too many errors or warnings
I tried another command:
occ -Wd -DSTBI_NO_SIMD src/SOIL2/*.c src/common/*.cpp -o SOIL2
This time it can generate a SOIL2.dll but there are a lot of warnings:
Warning(374) src/SOIL2/SOIL2.c(2295): Goto on line 2247 bypasses initializatio
n
Warning(374) src/SOIL2/SOIL2.c(2294): Goto on line 2247 bypasses initializatio
n
Warning(374) src/SOIL2/SOIL2.c(2293): Goto on line 2247 bypasses initializatio
n
Warning(374) src/SOIL2/SOIL2.c(2292): Goto on line 2247 bypasses initializatio
n
Warning(374) src/SOIL2/SOIL2.c(2295): Goto on line 2248 bypasses initializatio
n
Warning(374) src/SOIL2/SOIL2.c(2294): Goto on line 2248 bypasses initializatio
n
Warning(374) src/SOIL2/SOIL2.c(2293): Goto on line 2248 bypasses initializatio
n
Warning(374) src/SOIL2/SOIL2.c(2292): Goto on line 2248 bypasses initializatio
n
Warning(374) src/SOIL2/SOIL2.c(2295): Goto on line 2251 bypasses initializatio
n
Warning(374) src/SOIL2/SOIL2.c(2294): Goto on line 2251 bypasses initializatio
n
Warning(374) src/SOIL2/SOIL2.c(2293): Goto on line 2251 bypasses initializatio
n
Warning(374) src/SOIL2/SOIL2.c(2292): Goto on line 2251 bypasses initializatio
n
Warning(374) src/SOIL2/SOIL2.c(2295): Goto on line 2258 bypasses initializatio
n
Warning(374) src/SOIL2/SOIL2.c(2294): Goto on line 2258 bypasses initializatio
n
Warning(374) src/SOIL2/SOIL2.c(2293): Goto on line 2258 bypasses initializatio
n
Warning(374) src/SOIL2/SOIL2.c(2292): Goto on line 2258 bypasses initializatio
n
Warning(374) src/SOIL2/SOIL2.c(2295): Goto on line 2259 bypasses initializatio
n
Warning(374) src/SOIL2/SOIL2.c(2294): Goto on line 2259 bypasses initializatio
n
Warning(374) src/SOIL2/SOIL2.c(2293): Goto on line 2259 bypasses initializatio
n
Warning(374) src/SOIL2/SOIL2.c(2292): Goto on line 2259 bypasses initializatio
n
Warning(374) src/SOIL2/SOIL2.c(2295): Goto on line 2260 bypasses initializatio
n
Warning(374) src/SOIL2/SOIL2.c(2294): Goto on line 2260 bypasses initializatio
n
Warning(374) src/SOIL2/SOIL2.c(2293): Goto on line 2260 bypasses initializatio
n
Warning(374) src/SOIL2/SOIL2.c(2292): Goto on line 2260 bypasses initializatio
n
Warning(374) src/SOIL2/SOIL2.c(2295): Goto on line 2286 bypasses initializatio
n
Warning(374) src/SOIL2/SOIL2.c(2294): Goto on line 2286 bypasses initializatio
n
Warning(374) src/SOIL2/SOIL2.c(2293): Goto on line 2286 bypasses initializatio
n
Warning(374) src/SOIL2/SOIL2.c(2292): Goto on line 2286 bypasses initializatio
n
Somehow the stb_image assumes SSE2 (? Might be later SSE revisions) support in-extras like __m128i. Currently, we do not support using SSE2(?) constructs like that.
Somehow the stb_image assumes SSE2 (? Might be later SSE revisions) support in-extras like __m128i. Currently, we do not support using SSE2(?) constructs like that.
-DSTBI_NO_SIMDwill disable that.
Hmmm... You're right, your second half you point that out.
The SOIL2 issues likely are a result of the warning mechanism detecting an item initialized later that isn't actually used in-context as the GOTO is used as an early exit, so it's a little too trigger happy on those "Uninitialized items after a goto".
so yeah it could be argued that while the goto does bypass those initializations, those initializations aren't used after the target to the goto is reached so it shouldn't cause a warning lol.... i'm going to look at this eventually, but the warnings are benign in this ccase so I'll defer it for a while :smile: