LoginSignup
0
1

More than 5 years have passed since last update.

c++ builder XE4 > psapi.hを使う > #include <paspi.h>以外に#pragma comment( lib, "psapi.lib" )を追加

Last updated at Posted at 2016-08-19
動作環境
C++ Builder XE4

関連: c++ builder > アプリ使用メモリの確認 > GetProcessMemoryInfo()使用 > WorkingSetSize: DLLの使用分を含んだメモリ使用量

症状

実行プロセスの情報を取得するためpsapi.hを使おうとした。

プロジェクトをビルドすると以下のエラーが出た。

[ilink32 エラー] Error: 未解決の外部シンボル 'GetProcessMemoryInfo' が C:\USERS\xxx\DOCUMENTS\RAD STUDIO\PROJECTS\00-WORK\WIN32\DEBUG\UNIT1.OBJ から参照されています

対応

参考 http://stackoverflow.com/questions/18432745/visual-studio-c-link-with-psapi-lib

answered Aug 26 '13 at 11:29
by boleto

Method 2
The following pragma directive causes the linker to search in your source file for the psapi.lib library while linking .
#pragma comment( lib, "psapi.lib" )

#include <psapi.h>とは別に上記の#pragmaを追加すると未解決のシンボルのエラーは出なくなった。

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