Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

the encoding in test.c affects the compile failure on Windows OS

Open
#1,468 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
35/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Stale
Tech stack
c, java

Research direction

Open native/testlib.c around line 897 and inspect the Chinese punctuation or other characters that trigger the Windows code-page warning. Reproduce the native build on Windows with the stated JDK and verify that compilation completes without the warning-as-error and produces testlib.o and testlib.dll.

Written by the indexing model from the issue text.

Description

Versions in use
JDK: 1.8
OS: Windows 10
Architecture: x86_64

Description of compile failure:
[exec] 正在创建库 ../build/native-win32-x86-64/jnidispatch.lib 和对象 ../build/native-win32-x86-64/jnidispatch.exp
[exec] ../build/native-win32-x86-64/jnidispatch.dll
[exec] /cygdrive/d/work/workspace/jna/jna_0930/jna/native/libffi/msvcc.sh -m64 -W -Wall -Wno-unused -Wno-parentheses -DPSAPI_VERSION=1 -DFFI_BUILDING -DUNICODE -D_UNICODE -DHAVE_PROTECTION -DUSE_STATIC_RTL -I"D:\system\jdk8-64\jdk1.8.0_252\jre/../include" -I"D:\system\jdk8-64\jdk1.8.0_252\jre/../include/win32" -I"D:\work\workspace\jna\jna_0930\jna\build\headers" -I../build/native-win32-x86-64/libffi/include -DJNA_JNI_VERSION='"6.1.5"' -DCHECKSUM='"147a998f0cbc89681a1ae6c0dd121629"' -Wno-unknown-warning-option -Werror -Wno-clobbered -Wno-unused-variable -c testlib.c -o ../build/native-win32-x86-64/testlib.o
[exec] D:/work/workspace/jna/jna_0930/jna/native/testlib.c: error C2220: 警告被视为错误 - 没有生成“object”文件
[exec] D:/work/workspace/jna/jna_0930/jna/native/testlib.c: warning C4819: 该文件包含不能在当前代码页(936)中表示的字符。请将该文件保存为 Unicode 格式以防止数据丢失
[exec] link /DLL /OUT:../build/native-win32-x86-64/testlib.dll ../build/native-win32-x86-64/testlib.o psapi.lib
[exec] Microsoft (R) Incremental Linker Version 14.16.27041.0
[exec] Copyright (C) Microsoft Corporation. All rights reserved.
[exec]
[exec] LINK : fatal error LNK1181: 无法打开输入文件“..\build\native-win32-x86-64\testlib.o”
[exec] make: *** [Makefile:492: ../build/native-win32-x86-64/testlib.dll] Error 157

The Chinese punctuation mark at line 897 in testlib.c affects compilation and causes compilation failure on Windows OS

Dominant language
Java
Stars
8.9k
Forks
1.7k
PR merge metrics
No merged PRs in 30d

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from java-native-access/jna

All issues in java-native-access/jna

Similar issues

More Java issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.