?
Solved

Unresolved external  symbol

Posted on 1998-04-16
10
Medium Priority
?
566 Views
Last Modified: 2013-12-03
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(TH32CS_SNAPPROCESS, 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);
      }
      }
0
Comment
Question by:gnik
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
  • 3
10 Comments
 
LVL 22

Expert Comment

by:nietod
ID: 1412819
You need to include the tlhelp32.h file.
0
 
LVL 22

Expert Comment

by:nietod
ID: 1412820
Note that these functions are only available in windows 95.  That is why the file is not automatically included.  
0
 

Author Comment

by:gnik
ID: 1412821
I should have said, tlhelp32.h has been included and it is on windows 95.
0
 [eBook] Windows Nano Server

Download this FREE eBook and learn all you need to get started with Windows Nano Server, including deployment options, remote management
and troubleshooting tips and tricks

 
LVL 11

Expert Comment

by:alexo
ID: 1412822
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.
0
 

Author Comment

by:gnik
ID: 1412823
how do you go about adding libraries to your linker settings?
0
 
LVL 22

Expert Comment

by:nietod
ID: 1412824
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.
0
 
LVL 11

Expert Comment

by:alexo
ID: 1412825
>> I don't know what I was thinking.
About defwnd.c perchance?
0
 
LVL 22

Expert Comment

by:nietod
ID: 1412826
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?
0
 

Author Comment

by:gnik
ID: 1412827
I am going to reopen this question so that I can grade alexo's answer.
Thanks for the help. The problem's sorted.
0
 
LVL 11

Accepted Solution

by:
alexo earned 120 total points
ID: 1412828
Thank you.
0

Featured Post

Veeam Disaster Recovery in Microsoft Azure

Veeam PN for Microsoft Azure is a FREE solution designed to simplify and automate the setup of a DR site in Microsoft Azure using lightweight software-defined networking. It reduces the complexity of VPN deployments and is designed for businesses of ALL sizes.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article describes how to add a user-defined command button to the Windows 7 Explorer toolbar.  In the previous article (http://www.experts-exchange.com/A_2172.html), we saw how to put the Delete button back there where it belongs.  "Delete" is …
As more and more people are shifting to the latest .Net frameworks, the windows presentation framework is gaining importance by the day. Many people are now turning to WPF controls to provide a rich user experience. I have been using WPF controls fo…
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

765 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question