unresolved external linker crap

This is a discussion on unresolved external linker crap within the Windows Programming forums, part of the Platform Specific Boards category; hi, i am trying to compile this example http://msdn.microsoft.com/en-us/libr...21(VS.85).aspx but i get this link errors: unresolved external 'EnumProcesses' referenced ... ...

  1. #1
    Registered User
    Join Date
    Nov 2008
    Posts
    18

    unresolved external linker crap

    hi,
    i am trying to compile this example http://msdn.microsoft.com/en-us/libr...21(VS.85).aspx but i get this link errors:
    unresolved external 'EnumProcesses' referenced ...
    unresolved external 'EnumProcessesModules' referenced ...
    unresolved external 'GetModuleFileNameExA' referenced ...

    i'm using the borland c++ comandline compiler with this options:
    -W
    -ID:\devlopment\BCC55\INCLUDE
    -ID:\devlopment\BCC55\INCLUDE\SYS
    -ID:\devlopment\BCC55\INCLUDE\RW
    -LD:\devlopment\BCC55\LIB
    -LD:\devlopment\BCC55\LIB\PSDK
    (D:\devlopment\BCC55\LIB\PSDK contains the PSAPI.LIB)

  2. #2
    Registered User
    Join Date
    Aug 2008
    Posts
    188
    i think u need to explicitly specify psapi.lib as a dependency.

  3. #3
    Registered User
    Join Date
    Nov 2008
    Posts
    18
    -W
    -ID:\devlopment\BCC55\INCLUDE
    -ID:\devlopment\BCC55\INCLUDE\SYS
    -ID:\devlopment\BCC55\INCLUDE\RW
    -LD:\devlopment\BCC55\LIB\PSDK
    -LD:\devlopment\BCC55\LIB
    -LD:\devlopment\BCC55\LIB\PSDK\pkpd32.lib

    doesnt work too
    or what do you mean?

  4. #4
    and the hat of wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,489
    Yes, you need to specify names of libraries, as well as places where they might be found.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

  5. #5
    Registered User
    Join Date
    Nov 2008
    Posts
    18
    but the compiler help documentation says : "-L: The search directory options let you specify the directories that contain your standard include files, library and .OBJ files, and program source files."

    [edit]
    and compiling works in other projects that dont use the pkpd32.lib
    Last edited by electrohippi; 11-11-2008 at 01:29 PM.

  6. #6
    and the Hat of Guessing tabstop's Avatar
    Join Date
    Nov 2007
    Posts
    14,185
    That is true. And then, later, there is another command (-l, maybe?), which allows you to specify the .obj files you actually need to use.

  7. #7
    Registered User
    Join Date
    Nov 2008
    Posts
    18
    i think i know what you are meaning, now. >it needs an explicitly dependency ...<

    but i can't found such option:
    http://home.arcor.de/electrohippi/compiler.txt
    http://home.arcor.de/electrohippi/linker.txt

  8. #8
    and the Hat of Guessing tabstop's Avatar
    Join Date
    Nov 2007
    Posts
    14,185
    Well, hm. Try -lpkpd32.lib -- after all, you want that file to be passed off to the linker, and you've got the paths set so it should find it I guess.

  9. #9
    Registered User
    Join Date
    Nov 2008
    Posts
    18
    -l is not a valid option

  10. #10
    and the Hat of Guessing tabstop's Avatar
    Join Date
    Nov 2007
    Posts
    14,185
    Quote Originally Posted by electrohippi View Post
    -l is not a valid option
    But ... but ... I got it off the list you posted. If you're using the linker proper, rather than having the compiler hand it off, then try just using the filename itself, without any options.

  11. #11
    Registered User
    Join Date
    Nov 2008
    Posts
    18
    ah, you did mean a big 'i', i did mean a small 'L'

    but -I(big i) doesnt work couse:
    -I: The search directory options let you specify the directories that contain your standard include files, library and .OBJ files, and program source files.
    [edit]the borland linker has the same problem - do i need another linker ?
    Last edited by electrohippi; 11-11-2008 at 02:41 PM.

  12. #12
    and the Hat of Guessing tabstop's Avatar
    Join Date
    Nov 2007
    Posts
    14,185
    No I meant small l. It was on the compiler list. Try it without any prefix, just "pkwhatever.lib" on the command line and see what happens.

  13. #13
    Registered User
    Join Date
    Nov 2008
    Posts
    18
    Quote Originally Posted by tabstop View Post
    No I meant small l. It was on the compiler list.
    ah -l is for passing linker options through the compiler

    Quote Originally Posted by tabstop View Post
    Try it without any prefix, just "pkwhatever.lib" on the command line and see what happens.
    what the?

    i need another console compiler ... it just hurts now

  14. #14
    and the Hat of Guessing tabstop's Avatar
    Join Date
    Nov 2007
    Posts
    14,185
    Quote Originally Posted by electrohippi View Post
    ah -l is for passing linker options through the compiler


    what the?

    i need another console compiler ... it just hurts now
    I'm suggesting it because that's what all the compilers I know do. gcc does it, and so does MS I think -- just put an .obj file or a .lib file or a .o file on the command line and it will get linked in.

  15. #15
    Registered User
    Join Date
    Nov 2008
    Posts
    18
    ah ok, big thx for your help - i will try out the cygwin later.
    Last edited by electrohippi; 11-11-2008 at 03:48 PM.

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

Similar Threads

  1. Compiling sample DarkGDK Program
    By Phyxashun in forum Game Programming
    Replies: 6
    Last Post: 01-27-2009, 02:07 AM
  2. C++ std routines
    By siavoshkc in forum C++ Programming
    Replies: 33
    Last Post: 07-28-2006, 12:13 AM
  3. Including lib in a lib
    By bibiteinfo in forum C++ Programming
    Replies: 0
    Last Post: 02-07-2006, 01:28 PM
  4. debug to release modes
    By DavidP in forum Game Programming
    Replies: 5
    Last Post: 03-20-2003, 02:01 PM
  5. Unresolved external symbols in OGL
    By Shadow12345 in forum Game Programming
    Replies: 4
    Last Post: 08-04-2002, 09:46 PM

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