Visual C 2008 Express を使用して、サードパーティ ソフトウェアを Linux から Windows に移植しています。
関数 `wctype' だけに問題があります。%VCDIR%/include/wctype.h ファイルで次のように宣言されています。
_MRTIMP2 wctype_t __cdecl wctype (const char *);
ただし、リンクしようとすると、次のエラーが発生します。
C:\test>cl test.c
Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 15.00.30729.01 for 80x86
Copyright (C) Microsoft Corporation. All rights reserved.
test.c
Microsoft (R) Incremental Linker Version 9.00.30729.01
Copyright (C) Microsoft Corporation. All rights reserved.
/out:test.exe
test.obj
test.obj : error LNK2019: unresolved external symbol _wctype referenced in function _main
test.exe : fatal error LNK1120: 1 unresolved externals
テストコードは次のとおりです。
#include <wctype.h>
int
main (void)
{
return (int) wctype ("alpha");
}
エラー メッセージでわかるように、コードは正常にコンパイルされていますが、リンクできません。
何をすべきか?私はこのソフトウェアの開発者ではないので、元の開発者を混乱させる可能性があるため、「wctype」関数を別のものに置き換えたくありません。
お待ちいただきありがとうございます。
PS Dependency Walker を使用して MSVCRT90.DLL ファイルのインポート テーブルも調べましたが、「wctype」関数はありません。