Code::Blocks

User forums => General (but related to Code::Blocks) => Topic started by: Alfred96 on November 06, 2018, 03:38:23 pm

Title: Linking to win32 libarys using C::B
Post by: Alfred96 on November 06, 2018, 03:38:23 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,
Title: Re: Linking to win32 libarys using C::B
Post by: BlueHazzard on November 06, 2018, 04:57:06 pm
Project->Build otpions->Select the project name on the left->Linker settings->link libraries->add

But keep in mind that the library has to match the compiler....