私はWindows7x64でc++言語で作業しています。
ShellExecuteEx関数を使用して、Webカメラにマーカーを表示したときにFirefoxブラウザーを開くプロジェクトを作成しました。私のプロジェクトは、VisualStudio2010でうまく機能します。
しかし、Qt Creatorを使用してプロジェクトを実行しようとすると、次のエラーが発生します。
main_cam.obj:-1: error: LNK2019: riferimento al simbolo esterno __imp__ShellExecuteExW@4 non risolto nella funzione _main
debug\cam.exe:-1: error: LNK1120: 1 esterni non risolti
コードは次のとおりです。
#include <iostream>
#include <stdio.h>
#include <string> // for strings
#include <iomanip> // for controlling float print precision
#include <sstream> // string to number conversion
#include <windows.h>
#include <ShellAPI.h>
include [...]
int main () {
[...]
SHELLEXECUTEINFO ShExecInfo = {0};
ShExecInfo.cbSize = sizeof(SHELLEXECUTEINFO);
ShExecInfo.fMask = SEE_MASK_NOCLOSEPROCESS;
ShExecInfo.hwnd = NULL;
ShExecInfo.lpVerb = NULL;
ShExecInfo.lpFile = "firefox.exe";
ShExecInfo.lpDirectory = NULL;
ShExecInfo.nShow = SW_SHOW;
ShExecInfo.hInstApp = NULL;
[...]
if (condition_is_verified) {
ShExecInfo.lpParameters = (LPCWSTR)"www.google.it";
ShellExecuteEx(&ShExecInfo);
WaitForSingleObject(ShExecInfo.hProcess,INFINITE);
}
[...]
}//end main
問題はshell32.libだと思います。もしそうなら、私は私のPCにこのライブラリを持っていません。どうすれば修正できますか?
手伝って頂けますか?
前もって感謝します!