process id from exe

This is a discussion on process id from exe within the C++ Programming forums, part of the General Programming Boards category; Originally Posted by kryptkat Code: and printf("%lu", (unsigned long)dwPID); return; } to printf("%lu", (unsigned long)dwPID); return 0; } getting unresolved ...

  1. #16
    Registered User
    Join Date
    Oct 2001
    Posts
    2,934
    Quote Originally Posted by kryptkat View Post
    Code:
    and 
    
    	printf("%lu", (unsigned long)dwPID);
    	return;
    }
    
    to
    
    	printf("%lu", (unsigned long)dwPID);
    	return 0;
    }
    getting unresolved external.
    Well in that case I would imagine the void main is also up for modification:
    Code:
    int __cdecl main(int argc, char *argv[])

  2. #17
    Registered User kryptkat's Avatar
    Join Date
    Dec 2002
    Posts
    638
    Code:
    C:\borland\bcc55\bin>bcc32 processid.cpp
    Borland C++ 5.5.1 for Win32 Copyright (c) 1993, 2000 Borland
    processid.cpp:
    Warning W8012 processid.cpp 31: Comparing signed and unsigned values in functi
    on GetProcessByFileName(char *)
    Warning W8057 processid.cpp 57: Parameter 'argc' is never used in function mai
    n(int,char * *)
    Warning W8057 processid.cpp 57: Parameter 'argv' is never used in function mai
    n(int,char * *)
    Turbo Incremental Link 5.00 Copyright (c) 1997, 2000 Borland
    Error: Unresolved external 'EnumProcesses' referenced from C:\BORLAND\BCC55\BIN\
    processid.OBJ
    Error: Unresolved external 'GetModuleBaseNameA' referenced from C:\BORLAND\BCC55
    \BIN\processid.OBJ
    
    C:\borland\bcc55\bin>
    did the int main thing .... forgot to say....

    missing header?

  3. #18
    Cat without Hat CornedBee's Avatar
    Join Date
    Apr 2003
    Posts
    8,893
    Missing import library.
    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

  4. #19
    Registered User kryptkat's Avatar
    Join Date
    Dec 2002
    Posts
    638
    if i compile as win32 i get missing winmain if i try other libs like import32.lib and cw32.lib same error.

    which import lib missing?

  5. #20
    Registered User kryptkat's Avatar
    Join Date
    Dec 2002
    Posts
    638
    found it! psapi.lib was hiding in psdk.

Page 2 of 2 FirstFirst 12
Popular pages Recent additions subscribe to a feed

Similar Threads

  1. init adopts zombie process?
    By password636 in forum Linux Programming
    Replies: 4
    Last Post: 07-01-2009, 11:05 AM
  2. create a child process that creates a child process
    By cus in forum Linux Programming
    Replies: 9
    Last Post: 01-13-2009, 02:14 PM
  3. Replies: 3
    Last Post: 10-15-2008, 10:24 AM
  4. Problem with forking a process
    By Unitedroad in forum C Programming
    Replies: 10
    Last Post: 10-04-2007, 02:43 AM
  5. process programming
    By St0rM-MaN in forum Linux Programming
    Replies: 2
    Last Post: 09-15-2007, 08:53 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21