Home>

How can I correctly pass parameters to the TCC compiler on the Windows command line indicating the search paths for files from the PDCurses library?

Hellocurses.c code:

#include <curses.h>int main(void){
    initscr();
    addstr("Hello PDCurses from tcc!\n");
    refresh();
    getch();
    endwin();
    return 0;
}

I'm doing:

tcc hellocurses.c -o hellocurses

Compiler message:

hellocurses.c:1: error: include file 'curses.h' not found

I'm doing:

tcc hellocurses.c -IC:\PDCurses -o hellocurses

Compiler message:

tcc: error: undefined symbol 'initscr'
tcc: error: undefined symbol 'addstr'
tcc: error: undefined symbol 'refresh'
etc.

I'm doing:

tcc hellocurses.c -IC:\PDCurses -LC:\PDCurses\wincon -o hellocurses

The compiler message is the same.

The C:\PDCurses folder contains the header filescurses.h, curspriv.h and panel.hThe C:\PDCurses\wincon folder contains the object code of all library functions and the filepdcurses.lib

-lpdcurses add... or just tcc hellocurses.c C:\PDCurses\wincon\pdcurses.lib -IC:\PDCurses...

Fat-Zer2022-02-06 12:39:41

Did. Now the compiler writes tcc: error: library 'pdcurses' not found

Ipsum2022-02-06 12:42:39

yes, I forgot that on win the format of static libraries is different for different compilers ... as far as I understand, * .lib is a static msvc library, and gcc /tcc are looking for static libraries * .a ... actually the question is: how exactly did you build pdcurses /where did it come from took?

Fat-Zer2022-02-06 12:58:26

Using nmake from the Visual Studio package

Ipsum2022-02-06 13:02:51

um... that's the problem: you need to build it with tcc...

Fat-Zer2022-02-06 13:03:59