Use cmake to compile c++ under windows

I haven't updated my blog for a long time

I'm doing c++ related work recently, and it's really painful to compile.

So on a whim, keep updating

Mainly some cross-platform libraries, such as zlib, libpng, opencv, ffmpeg

The compilation tool uses mingw as the main compilation environment support and msys for compilation.

1. Download mingw64:

MinGW-w64 - for 32 and 64 bit Windows download | SourceForge.net

After the installation is complete, you need to configure the environment variable to point to the bin in the installation directory

2. Download msys:

https://udomain.dl.sourceforge.net/project/mingwbuilds/external-binary-packages/msys%2B7za%2Bwget%2Bsvn%2Bgit%2Bmercurial%2Bcvs-rev13.7z

1. After the download is complete, unzip it and put it in the root directory of mingw

2. Copy fstab.simple and rename it to fstab

3. Modify the configuration of mingw in fstab

 4. Use msys.bat to start and enter the compilation environment. If there is a problem with permissions, right-click to open with administrator permissions

5. After the startup is complete:

6. It should be noted here that if you switch the drive letter, use cd /e/workspace instead of cd e:/workspace

The specific compilation command is determined by the compilation command required by the c++ source code itself

 

 Compilation links and download sources related to zlib, libpng, ffmpeg, opencv will be added later

One-click access for lazy people, mingw64 environment package including zlib and libpng:

https://download.csdn.net/download/DeleteElf/87905784

Guess you like

Origin blog.csdn.net/DeleteElf/article/details/131208196