Thread: __stdcall error

  1. #1
    Registered User kryptkat's Avatar
    Join Date
    Dec 2002
    Posts
    638

    __stdcall error

    Code:
    Error: Unresolved external '__stdcall CreateToolhelp32Snapshot(unsigned long, un
    signed long)' referenced from C:\BORLAND\BCC55\BIN\PRID.OBJ
    getting __stdcall error have tlhelp32.h and linking to tl32.lib but it is the stdcall that is confusing because there is no dll . See no need for extern() because there is nothing to put extern() in.

    Getting 3errors all __stdcall

    added stdlib.h stdarg.h stddef.h to see if one of those was the missing __stdcall

    checked function names and they match with .h files. Also linking to psapi.lib and have psapi.h included. Different prog.

  2. #2
    Registered User kryptkat's Avatar
    Join Date
    Dec 2002
    Posts
    638
    it is the example from code prodject.

  3. #3
    Registered User manofsteel972's Avatar
    Join Date
    Mar 2004
    Posts
    317
    What platform are you using NT? That function is in the Kernel32.dll but it is not available on WIN_NT kernel32.dll.

    [edit] Upon further research NT 5.0 does support the toolhelp functions. Version of NT prior to 5.0 do not.
    Last edited by manofsteel972; 06-28-2007 at 03:37 PM.
    "Knowledge is proud that she knows so much; Wisdom is humble that she knows no more."
    -- Cowper

    Operating Systems=Slackware Linux 9.1,Windows 98/Xp
    Compilers=gcc 3.2.3, Visual C++ 6.0, DevC++(Mingw)

    You may teach a person from now until doom's day, but that person will only know what he learns himself.

    Now I know what doesn't work.

    A problem is understood by solving it, not by pondering it.

    For a bit of humor check out xkcd web comic http://xkcd.com/235/

  4. #4
    Cat without Hat CornedBee's Avatar
    Join Date
    Apr 2003
    Posts
    8,895
    The error has nothing to do with __stdcall. That's just part of the function signature. Are you sure tl32.lib is the import library for the toolhelp32 API?
    All the buzzt!
    CornedBee

    "There is not now, nor has there ever been, nor will there ever be, any programming language in which it is the least bit difficult to write bad code."
    - Flon's Law

  5. #5
    Registered User kryptkat's Avatar
    Join Date
    Dec 2002
    Posts
    638
    Are you sure tl32.lib is the import library for the toolhelp32 API?
    No.... I did look through the th23.lib and tlhelp32.h and they had the same functions

    Code:
    CreateToolhelp32Snapshot()
    Process32Next()
    OpenProcess()
    I did compile another prog with the same tlhelp32.h and psapi.h header files. Only got a _openprocess() error and not the __stdcall openprocess.... error. Ok do not understand why one prog does not call stdcall and another prog does call stdcall with the same header files....? same functions but compiles diff ? I do not understand why I get __stdcall error when same header files and functions used?

    Ok so how to fix?

    Also no toolhelp32.lib


    ps also playing with tapi.lib now I am phreeking out.

  6. #6
    Registered User kryptkat's Avatar
    Join Date
    Dec 2002
    Posts
    638
    So why will one prog compile and the other will not when they both have the same headers?
    Both have tlhelp32.h and psapi.h ? There does not seem to be much difference between the two progs. meow. Both do the same thing.

    What libs are needed to compile this?

    So far -L with psapi.lib and th32.lib tried kernel32.lib still get same three errors.

    tried a few others with same result.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Getting an error with OpenGL: collect2: ld returned 1 exit status
    By Lorgon Jortle in forum C++ Programming
    Replies: 6
    Last Post: 05-08-2009, 08:18 PM
  2. An error is driving me nuts!
    By ulillillia in forum C Programming
    Replies: 5
    Last Post: 04-04-2009, 09:15 PM
  3. Making C DLL using MSVC++ 2005
    By chico1st in forum C Programming
    Replies: 26
    Last Post: 05-28-2008, 01:17 PM
  4. Connecting to a mysql server and querying problem
    By Diod in forum C++ Programming
    Replies: 8
    Last Post: 02-13-2006, 10:33 AM
  5. Couple C questions :)
    By Divx in forum C Programming
    Replies: 5
    Last Post: 01-28-2003, 01:10 AM