Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Unresolved external  symbol

Posted on 1998-04-16
10
Medium Priority
?
567 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
Learn Veeam advantages over legacy backup

Every day, more and more legacy backup customers switch to Veeam. Technologies designed for the client-server era cannot restore any IT service running in the hybrid cloud within seconds. Learn top Veeam advantages over legacy backup and get Veeam for the price of your renewal

 
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

NEW Veeam Agent for Microsoft Windows

Backup and recover physical and cloud-based servers and workstations, as well as endpoint devices that belong to remote users. Avoid downtime and data loss quickly and easily for Windows-based physical or public cloud-based workloads!

Question has a verified solution.

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

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.  …
Whether you've completed a degree in computer sciences or you're a self-taught programmer, writing your first lines of code in the real world is always a challenge. Here are some of the most common pitfalls for new programmers.
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…
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…

636 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