gnik
asked on
Unresolved external symbol
I get the unresolved external symbol error message when trying to build my program.
unresolved external symbol _Process32Next@8
unresolved external symbol _Process32First@8
unresolved external symbol _CreateToolhelp32Snapshot@ 8
From the code section:-
void Snap()
{
HWND hSnap;
hSnap = CreateToolhelp32Snapshot(T H32CS_SNAP PROCESS, 0);
if (hSnap ==(HANDLE) -1)
{
MessageBox();
}
else
{
PROCESSENTRY32 procEntry;
procEntry.dwSize = sizeof(PROCESSENTRY32);
if (!Process32First(hSnap, &procEntry))
{
//this can't possibly happen
MessageBox();
assert(FALSE);
}
else
{
BOOL bResult;
do
{
bResult = Process32Next(hSnap, &procEntry);
} while (bResult);
}
CloseHandle(hSnap);
}
}
unresolved external symbol _Process32Next@8
unresolved external symbol _Process32First@8
unresolved external symbol _CreateToolhelp32Snapshot@
From the code section:-
void Snap()
{
HWND hSnap;
hSnap = CreateToolhelp32Snapshot(T
if (hSnap ==(HANDLE) -1)
{
MessageBox();
}
else
{
PROCESSENTRY32 procEntry;
procEntry.dwSize = sizeof(PROCESSENTRY32);
if (!Process32First(hSnap, &procEntry))
{
//this can't possibly happen
MessageBox();
assert(FALSE);
}
else
{
BOOL bResult;
do
{
bResult = Process32Next(hSnap, &procEntry);
} while (bResult);
}
CloseHandle(hSnap);
}
}
You need to include the tlhelp32.h file.
Note that these functions are only available in windows 95. That is why the file is not automatically included.
ASKER
I should have said, tlhelp32.h has been included and it is on windows 95.
You need to add the library TH32.LIB to your linker settins (list of libraries).
Note that "Unresolved external symbol" is a linker error and cannot be resolved by include files.
Note that "Unresolved external symbol" is a linker error and cannot be resolved by include files.
ASKER
how do you go about adding libraries to your linker settings?
Alexo is right of course. I don't know what I was thinking.
In Microsoft VC+, choose "Project"->"Add to Project"->"Files". Then add the .lib file.
In Borland C++ there is a similar option, but I don't know the details.
In Builder. You open up the project manager andn right click on the project then select "add" and add the .lib file.
In Microsoft VC+, choose "Project"->"Add to Project"->"Files". Then add the .lib file.
In Borland C++ there is a similar option, but I don't know the details.
In Builder. You open up the project manager andn right click on the project then select "add" and add the .lib file.
>> I don't know what I was thinking.
About defwnd.c perchance?
About defwnd.c perchance?
Hey, I resent that. You are suggesting that I have a one-track mind. Nothing could be further from the truth. In fact I have som many things on my mind that...what was I saying?
ASKER
I am going to reopen this question so that I can grade alexo's answer.
Thanks for the help. The problem's sorted.
Thanks for the help. The problem's sorted.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.