'How do I avoid the stray error when compiling a c program with the library pdcurses?

I was working on a c program with code blocks on windows when I realized i needed the pdcurses library so downloaded it and build it but after importing it into code blocks, when I ran a test code, I got these errors :

enter image description here

the code is:

#include <stdio.h>

#include <stdlib.h>

#include <pdcurses.a>

int main(){

    initsrc();

    printw("Hello world!\n");
    refresh();
    getch();

    endwin();
    return 0;
}

can someone help me resolve this please?



Solution 1:[1]

A file with an extension of ".a" is a library file, which is binary. You don't include that in your code with #include.

What you should do instead is #include the header file(s) associated with this library, then link in the library file in the project configuration.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 dbush