Solved

Unresolved external  symbol

Posted on 1998-04-16
10
542 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
  • 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
 
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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
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 30 total points
ID: 1412828
Thank you.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

This article shows a few slightly more advanced techniques for Windows 7 gadget programming, including how to save and restore user settings for your gadget and how to populate the "details" panel that is displayed in the Windows 7 gadget gallery.  …
If you have ever found yourself doing a repetitive action with the mouse and keyboard, and if you have even a little programming experience, there is a good chance that you can use a text editor to whip together a sort of macro to automate the proce…
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…
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…

920 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now