Skip to content

Fix breakage with -DLODEPNG_NO_COMPILE_CRC#161

Open
hpjansson wants to merge 1 commit into
lvandeve:masterfrom
hpjansson:fix-no-compile-crc
Open

Fix breakage with -DLODEPNG_NO_COMPILE_CRC#161
hpjansson wants to merge 1 commit into
lvandeve:masterfrom
hpjansson:fix-no-compile-crc

Conversation

@hpjansson

@hpjansson hpjansson commented Mar 22, 2022

Copy link
Copy Markdown
Contributor

Compiling with -DLODEPNG_NO_COMPILE_CRC would lead to linker errors, since
lodepng_crc32() was still being referenced:

liblodepng.a(lodepng.o): in function lodepng_chunk_check_crc:
lodepng.cpp:2496: undefined reference to lodepng_crc32
liblodepng.a(lodepng.o): in function lodepng_chunk_generate_crc:
lodepng.cpp:2503: undefined reference to lodepng_crc32
liblodepng.a(lodepng.o): in function lodepng_inspect:
lodepng.cpp:4083: undefined reference to lodepng_crc32

Just #ifdef out the references too, ignoring CRCs in the decoder and
generating a zero CRC in the encoder.

Compiling with -DLODEPNG_NO_COMPILE_CRC would lead to linker errors, since
lodepng_crc32() was still being referenced:

liblodepng.a(lodepng.o): in function `lodepng_chunk_check_crc':
lodepng.cpp:2496: undefined reference to `lodepng_crc32'
liblodepng.a(lodepng.o): in function `lodepng_chunk_generate_crc':
lodepng.cpp:2503: undefined reference to `lodepng_crc32'
liblodepng.a(lodepng.o): in function `lodepng_inspect':
lodepng.cpp:4083: undefined reference to `lodepng_crc32'

Just #ifdef out the references too, ignoring CRCs in the decoder and
generating a zero CRC in the encoder.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant