A
A
Asya2019-10-04 23:27:08
Qt
Asya, 2019-10-04 23:27:08

How to compile a library for Qt from under windows?

Let 's say there is a C++ library - openbabel I need
to compile it to include it in the qt project
I downloaded it and unzipped it ( openbabel-openbabel-2-4-0.zip) this one , but still it didn't help me figure it out . It needs to work for the following platforms: Which compiler should I choose in cmake? if Which values ​​need to be changed and how? There are such errors:
5d97a3931d394510249267.jpeg
5d97a58d6ea96316152419.jpeg

5d97a8de08159789927276.jpeg
5d97a65c870a6388004188.jpeg

The C compiler identification is unknown
The CXX compiler identification is unknown
CMake Error at CMakeLists.txt:6 (project):
  No CMAKE_C_COMPILER could be found.



CMake Error at CMakeLists.txt:6 (project):
  No CMAKE_CXX_COMPILER could be found.



Configuring incomplete, errors occurred!
See also "E:/libs/openbabel-openbabel-2-4-0/build/CMakeFiles/CMakeOutput.log".
See also "E:/libs/openbabel-openbabel-2-4-0/build/CMakeFiles/CMakeError.log".

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
res2001, 2019-10-05
@asyaevloeva

You don't need to compile the library for Qt, you just need to compile it. How it will be used in the future (with or without Qt) does not matter.
For mingw, the easiest way is to use not pure mingw, but msys2 + mingw. msys2 has a package manager and there is already a lot of ready-to-use software in its turnips. I think that openbabel is there as well. Just install the openbabel package in the same way as in Linux and use it in your project. By the way, there is also qtcreator and Qt and much more.
for msvc. Why don't you use already built library binaries? They, in my opinion, are available for download on the official website.
If you still need to build, then here is the instruction: openbabel.org/docs/dev/Installation/install.html#w...
I recommend building on the command line, not in the GUI. Use the pre-configured msvc command line (links to it are in the Start menu after installing msvs). msvs already comes with cmake. If you really want a GUI, then run cmake GUI from the same msvc command line, then cmake will be able to find the Microsoft compiler.
You need to choose the cmake generator which version of msvc you have installed on the system.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question