Author Topic: Trouble linking with functions defined in winuser.h  (Read 247 times)

beethoven3567

• Member
• Posts: 2
Trouble linking with functions defined in winuser.h
« on: July 23, 2020, 07:12:06 am »
I've run into a problem while trying to compile a project called PDCurses, which provides functionality that is similar to that of the Linux curses library.
I'm getting 12 errors regarding unresolved symbols that are clearly defined in winuser.h.
For example,
POLINK: error: Unresolved external symbol '__imp_OpenClipboard' - referenced from 'C:\Users\todde\OneDrive\Documents\Pelles C Projects\CursesTest2\output\pdcclip.obj'.

pdcclip.c includes the header file "pdcwin.h" which in turn includes windows.h , which in turn includes winuser.h
I've attached pdcclip.c and pdfcwin.h

I've tried various compiler and linker options with no luck. I've also tried including winuser.h directly into pdfcwin.h, but same errors.
Thank you in advance for your help.

AlexN

• Global Moderator
• Member
• Posts: 391
Re: Trouble linking with functions defined in winuser.h
« Reply #1 on: July 23, 2020, 10:25:59 am »
Have you tried to add user32.lib to the linker?
best regards
Alex

beethoven3567

• Member
• Posts: 2
Re: Trouble linking with functions defined in winuser.h
« Reply #2 on: July 23, 2020, 06:26:47 pm »
It works!!! Thank you Alex!!!