0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

*1 error LNK 2019: 未解決の外部シンボル __imp_GetFileAttributesExW が関数 _waccess_s で参照されました。

Posted at

はじめに

system("pause");

などという文が入っていませんか?

背景

まず Windows でコンソールアプリケーションを開発し、それを RTX に移植するような場合で、プログラム中に上記のような文があると表題のエラーが発生します。

発生したエラーと原因

*1 error LNK 2019: 未解決の外部シンボル __imp_GetFileAttributesExW が関数 _waccess_s で参照されました。

リンカのエラーで、具体的にどの箇所がエラー原因なのかわかりません。またメッセージから推測することもできません。ネットで調べても、これといった情報には当たりません。そもそも RTX の開発自体が少ないのかもしれません。Windows 開発と RTX 開発とを並行して行うことも少ないのかもしれません。あるいは開発ノウハウを共有するという文化も希薄なのかもしれません。

system("pause");

Windows のシステムコールを RTX でやろうとしているのでエラーになるのは当然ですが、リンカエラーなので、原因までたどり着くのは困難です。とにかく情報がなかったので、ここに記します。原因は上記のような関数コールでした。

以上です。

0
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?