Question Locked

How to install a library on mingw in linux

0 helpful
1 reply
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

I am trying to compile my c++ code for windows with this command :

x86_64-w64-mingw32-g++ main.cpp -lSDL2 -lSDL2_image -lSDL2_ttf -o windows32.exe

but I get #include <SDL2/SDL.h> which I don't get when compiling with g++.

How can I install these libraries for mingw in linux?

1 reply

by techguy98

download zlib-1.2.5.tar.gz.
tar -zxvf zlib-1.2.5.tar.gz.
cd zlib-1.2.5.
./configure –prefix=/mingw.
make.
make install.
gcc -shared -o /mingw/bin/zlib1.dll -Wl,–out-implib=/mingw/lib/libz.dll.a [!em]*.o.

This may help.

This discussion is closed to new replies.