News:

Accounts with zero posts and zero activity during the last months will be deleted periodically to fight SPAM!

Main Menu

Linking to win32 libarys using C::B

Started by michaeltwozero, June 30, 2007, 06:26:16 PM

Previous topic - Next topic

michaeltwozero

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.

raph

Go to Project->Build options and go to Linker settings, there you can add the required libraries.

michaeltwozero

#2
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.