Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix breakage with -DLODEPNG_NO_COMPILE_CRC #161

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

hpjansson
Copy link
Contributor

@hpjansson hpjansson commented Mar 22, 2022

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