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

error C3688: invalid literal suffix 'PRId32' #416

Closed
Anton-V-K opened this issue Sep 8, 2019 · 2 comments
Closed

error C3688: invalid literal suffix 'PRId32' #416

Anton-V-K opened this issue Sep 8, 2019 · 2 comments
Labels
compilation Issues related to compiling source code fixed Issue or bug has been fixed

Comments

@Anton-V-K
Copy link

Anton-V-K commented Sep 8, 2019

It is not possible to compile minizip\test\test.c with MS VS 2017 because of numerouse errors of same type:
error C3688: invalid literal suffix 'PRId32'; literal operator or literal operator template 'operator ""PRId32' not found

It seems the C++ compiler can't properly handle lines like:

        printf("%s encrypted %"PRId32"\n", encrypt_path, written);

Adding spaced around PRId32 and PRId64 (to separate the tokens) resolves the issue.

It seems the problems is specific to C++ compiler, because similar fragments in other C-files are compiled fine (by C compiler).
The error happens when file is included (in a C++ file) this way:

extern "C"
{
#include <minizip/test/test.c>
}
@Anton-V-K Anton-V-K changed the title error C3688: invalid literal suffix 'PRId32'; literal operator or literal operator template 'operator ""PRId32' not found error C3688: invalid literal suffix 'PRId32' Sep 8, 2019
@nmoinvaz
Copy link
Member

nmoinvaz commented Sep 9, 2019

PRId32 is found in inttypes.h. The test.c source file is not intended to be used as an include.

@nmoinvaz
Copy link
Member

nmoinvaz commented Sep 9, 2019

If you want to add spaces around those inttypes.h #defines and submit as a PR.

@nmoinvaz nmoinvaz added 2.0 compilation Issues related to compiling source code fixed Issue or bug has been fixed labels Jan 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compilation Issues related to compiling source code fixed Issue or bug has been fixed
Projects
None yet
Development

No branches or pull requests

2 participants