E
E
Egorithm2020-07-19 17:03:00
MinGW
Egorithm, 2020-07-19 17:03:00

How to link MinGW lib with MSVC? Or how to compile STL Filesystem with MinGW 8.1.0?

I'm trying to link FFmpeg with the project under Windows (via extern "C"). With MinGW 8.1.0 in the test project it turned out to be successfully linked, with MSVC - an error. The problem is that I'm using the STL Filesystem in the project, which doesn't seem to exist in MinGW, at least I can't compile with it. I'm using CMake and the 17th standard is installed through it, so that's not the issue. Tell me, how can I solve this problem? Thanks a lot.

PS: In general, in the dev assembly downloaded from here , are there def files that seem to solve this problem, or not?5f1455c928ca6254039539.png

Answer the question

In order to leave comments, you need to log in

1 answer(s)
E
Egorithm, 2020-07-19
@EgoRusMarch

It seems to have turned out, it was linked, there is no error. Here is what I did:

  • C :\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.26.28801\bin\{Hostx64\x64|Hostx32\x32} contains the lib.exe file . It needs to be added to the Path environment variable so that it can be run as a command from the console (although you can just write the entire path when you call it).
  • And do something like: lib /machine:x64 /def:your_lib.defor lib /machine:x32 /def:your_lib.def, after which it will display a message:
    Creating library your_lib.lib and object your_lib.exp

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question