Привет, я новичок в qt и CMake, это, вероятно, легко исправить, но я боролся с этим весь день.
Я пытаюсь использовать GeographicLib в Qtпроект. Я установил CMake и загрузил файлы с https://geographiclib.sourceforge.io/html/intro.html. На веб-сайте Geographiclib есть руководство по Сборка библиотеки для использования с Qt . Есть пара команд, которые вы должны выполнить:
export PATH="`cygpath -m c:/QtSDK/mingw/bin`:$PATH"
mkdir BUILD
cd BUILD
cmake -G "MinGW Makefiles" -D CMAKE_INSTALL_PREFIX="C:/Program Files/GeographicLib" ..
mingw32-make
mingw32-make install
после выполнения вышеизложенного я получаю следующее:
C:\Users\koos> export PATH="`cygpath -m c:/QtSDK/mingw/bin`:$PATH"
'export' is not recognized as an internal or external command,
operable program or batch file.
C:\Users\koos> mkdir BUILD
A subdirectory or file BUILD already exists.
C:\Users\koos> cd BUILD
C:\Users\koos\BUILD> cmake -G "MinGW Makefiles" -D CMAKE_INSTALL_PREFIX="C:/Program
Files/GeographicLib" ..
CMake Error: The source directory "C:/Users/koos" does not appear to contain CMakeLists.txt.
Specify --help for usage, or press the help button on the CMake GUI.
веб-сайт сказал, что если cmakeжалуется, что вы должны запустить следующее:
env PATH="$( echo $PATH | tr : '\n' |
while read d; do test -f "$d/sh.exe" || echo -n "$d:"; done |
sed 's/:$//' )" \
cmake -G "MinGW Makefiles" -D CMAKE_INSTALL_PREFIX="C:/Program Files/GeographicLib" ..
тогда я получаю:
C:\Users\koos\BUILD> env PATH="$( echo $PATH | tr : '\n' |
'env' is not recognized as an internal or external command,
operable program or batch file.
C:\Users\koos\BUILD> while read d; do test -f "$d/sh.exe" || echo -n "$d:"; done |
The syntax of the command is incorrect.
C:\Users\koos\BUILD> sed 's/:$//' )" \
'sed' is not recognized as an internal or external command,
operable program or batch file.
C:\Users\koos\BUILD> cmake -G "MinGW Makefiles" -D CMAKE_INSTALL_PREFIX="C:/Program
Files/GeographicLib" ..
Я использую Desktop Qt 13.0 MinGw 64-bit. Я думаю, что есть проблема со следующим: "" mingw32-make "" (будучи 32 вместо 64, но я попытался изменить его и не получил, где). Может кто-нибудь, пожалуйста, объясните мне, как мне следует установить библиотеку Geographic lib в Qt (возможно, как использовать cmake qui для выполнения этой задачи, потому что я не очень разбираюсь в cmake)
Edit:
Итак, я установил Cygwin, и теперь он дает мне следующее:
koos@computer ~
$ mkdir BUILD
export PATH="`cygpath -m C:\Qt\Tools\mingw730_64\bin`:$PATH"
cd BUILD
cmake -G "MinGW Makefiles" -D CMAKE_INSTALL_PREFIX="C:/Program
Files/GeographicLib" ..
mingw32-make
mingw32-make install
koos@computer ~
$ mkdir BUILD
koos@computer ~
$ cd BUILD
koos@computer ~/BUILD
$ cmake -G "MinGW Makefiles" -D CMAKE_INSTALL_PREFIX="C:/Program
Files/GeographicLib" ..
CMake Error: The source directory "C:/cygwin64/home/koos" does not appear
to contain CMakeLists.txt.
Specify --help for usage, or press the help button on the CMake GUI.
koos@computer ~/BUILD
$ mingw32-make
-bash: mingw32-make: command not found
koos@computer ~/BUILD
$ mingw32-make install
-bash: mingw32-make: command not found
После запуска из каталога верхнего уровня GeographicLib я получаю следующие ошибки:
CMake Error: CMake was unable to find a build program corresponding to
"MinGW Makefiles". CMAKE_MAKE_PROGRAM is not set. You probably need to
select a different build tool.
CMake Error: CMake was unable to find a build program corresponding to
"MinGW Makefiles". CMAKE_MAKE_PROGRAM is not set. You probably need to
select a different build tool.
CMake Error: CMAKE_C_COMPILER not set, after EnableLanguage
CMake Error: CMAKE_CXX_COMPILER not set, after EnableLanguage
-- Configuring incomplete, errors occurred!
Путь C:\Qt\Tools\mingw730_64\bin
содержит mingw32-make.
Спасибо за ваше терпение!
С уважением, Коос