I'm trying this tutorial using the get system metrics functions so what i did was to include the windows.h preprocessor directive although when i'm trying to compile my program i get th e error "undefined symbol '_GetSystemMetrics@4'. I'm using TCC as my compiler.

Did you link with user32.lib as well, or just include windows.h? Headers contain the necessary declarations for your code to compile, but for the code to link, you need the corresponding definitions as well. Those definitions are usually stored in an static object library file, or a dynamically linked library file.

How do we link a .dll file?...

If it has a corresponding .lib file, add that to your additional dependencies in the linker input. Otherwise, try something like LoadLibrary.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.