Author Topic: Linking to win32 libarys using C::B  (Read 8830 times)

michaeltwozero

  • Guest
Linking to win32 libarys using C::B
« on: June 30, 2007, 06:26:16 pm »
Hi all,

I am trying to use a windows libary namely: PSAPI.DLL

How do I link to it to resovle the external dependencies, in MSVC++ I go to Project -> settings and add "psapi.lib" to the list Link tab.

An example error is:
.objs\main.o:main.cpp:(.text+0x1d0): undefined reference to `GetModuleBaseNameA@16

Many thanks,
Mike.

Offline raph

  • Almost regular
  • **
  • Posts: 242
Re: Linking to win32 libarys using C::B
« Reply #1 on: June 30, 2007, 06:53:35 pm »
Go to Project->Build options and go to Linker settings, there you can add the required libraries.

michaeltwozero

  • Guest
Re: Linking to win32 libarys using C::B <modified>
« Reply #2 on: June 30, 2007, 07:22:19 pm »
raph,

I have tried to do this, I have added PSAPI.Lib, but I still get the errors:

.objs\main.o:main.cpp:(.text+0x19f): undefined reference to `EnumProcessModules@16'
.objs\main.o:main.cpp:(.text+0x1d0): undefined reference to `GetModuleBaseNameA@16'
.objs\main.o:main.cpp:(.text+0x27f): undefined reference to `EnumProcesses@12'
collect2: ld returned 1 exit status
Process terminated with status 1 (0 minutes, 1 seconds)
0 errors, 0 warnings

Ahhh, Sorry just added "PSAPI" I had browsed to the file in MS SDK,

Thanks for your help, sorry for not reading the answers properly.

Mike.
« Last Edit: June 30, 2007, 07:28:01 pm by michaeltwozero »