MVT
MVT

Reputation: 137

error comping c to (windows)exe on linux with mingw

I installed the mingw stuff from yaourt on arch linux but when i type

x86_64-w64-mingw32-gcc tom.c ncurses_functions.c terminal_functions.c list_functions.c -o -lpdcurses tom_windows.exe

I get:

x86_64-w64-mingw32-gcc: error: tom_windows.exe: No such file or directory

It must be something simple but I don't know what!

Upvotes: 1

Views: 61

Answers (2)

The argument after -o is the output filename. In your case, you've told it to output to a file called -lpdcurses. Then you've told it to compile tom_windows.exe (as if it was a source file).

Swap the order of -o and -lpdcurses.

Upvotes: 1

Lukasz K
Lukasz K

Reputation: 162

Try:

x86_64-w64-mingw32-gcc tom.c ncurses_functions.c terminal_functions.c list_functions.c -o tom_windows.exe -lpdcurses

Upvotes: 1

Related Questions