NQUARE
@NQUARE

Почему не собирается библиотека Ultralight?

Вот я пытаюсь собрать библу Ultralight, на винде:
Качаю архив, распаковываю разумеется.
Затем в консоли:
cd S:\Ultralight-1.2.1\Ultralight-1.2.1
cmake-gui

После в cmake-gui выставляю всё так:
600492a62f83a885135270.png
И нажимаю Configure > Finish > Generate (все галочки с опций сняты).
Ну и запускаю make:
mingw32-make
жду и получаю
вывод
$ mingw32-make
Scanning dependencies of target UltralightCoreBin
[ 1%] Creating directories for 'UltralightCoreBin'
[ 2%] Performing download step (download, verify and extract) for 'UltralightCoreBin'
-- Downloading...
dst='S:/Ultralight-1.2.1/Ultralight-1.2.1/samples/UltralightCoreBin-prefix/src/ultralightcore-bin-96fdb30c-win-x64.7z'
timeout='none'
inactivity timeout='none'
-- Using src='https://ultralightcore-bin.sfo2.cdn.digitaloceansp...'
-- Downloading... done
-- extracting...
src='S:/Ultralight-1.2.1/Ultralight-1.2.1/samples/UltralightCoreBin-prefix/src/ultralightcore-bin-96fdb30c-win-x64.7z'
dst='S:/Ultralight-1.2.1/Ultralight-1.2.1/samples/deps/UltralightCore'
-- extracting... [tar xfz]
-- extracting... [analysis]
-- extracting... [rename]
-- extracting... [clean up]
-- extracting... done
[ 4%] No update step for 'UltralightCoreBin'
[ 5%] No patch step for 'UltralightCoreBin'
[ 6%] No configure step for 'UltralightCoreBin'
[ 8%] No build step for 'UltralightCoreBin'
[ 9%] No install step for 'UltralightCoreBin'
[ 11%] Completed 'UltralightCoreBin'
[ 11%] Built target UltralightCoreBin
Scanning dependencies of target WebCoreBin
[ 12%] Creating directories for 'WebCoreBin'
[ 13%] Performing download step (download, verify and extract) for 'WebCoreBin' -- Downloading...
dst='S:/Ultralight-1.2.1/Ultralight-1.2.1/samples/WebCoreBin-prefix/src/webcore-bin-88630b80-win-x64.7z'
timeout='none'
inactivity timeout='none'
-- Using src='https://webcore-bin.sfo2.cdn.digitaloceanspaces.co...'
-- Downloading... done
-- extracting...
src='S:/Ultralight-1.2.1/Ultralight-1.2.1/samples/WebCoreBin-prefix/src/webcore-bin-88630b80-win-x64.7z'
dst='S:/Ultralight-1.2.1/Ultralight-1.2.1/samples/deps/WebCore'
-- extracting... [tar xfz]
-- extracting... [analysis]
-- extracting... [rename]
-- extracting... [clean up]
-- extracting... done
[ 15%] No update step for 'WebCoreBin'
[ 16%] No patch step for 'WebCoreBin'
[ 18%] No configure step for 'WebCoreBin'
[ 19%] No build step for 'WebCoreBin'
[ 20%] No install step for 'WebCoreBin'
[ 22%] Completed 'WebCoreBin'
[ 22%] Built target WebCoreBin
Scanning dependencies of target UltralightBin
[ 23%] Creating directories for 'UltralightBin'
[ 25%] Performing download step (download, verify and extract) for 'UltralightBin'
-- Downloading...
dst='S:/Ultralight-1.2.1/Ultralight-1.2.1/samples/UltralightBin-prefix/src/ultralight-bin-193592e1-win-x64.7z'
timeout='none'
inactivity timeout='none'
-- Using src='https://ultralight-bin.sfo2.cdn.digitaloceanspaces...'
-- [download 0% complete]
-- [download 100% complete]
-- Downloading... done
-- extracting...
src='S:/Ultralight-1.2.1/Ultralight-1.2.1/samples/UltralightBin-prefix/src/ultralight-bin-193592e1-win-x64.7z'
dst='S:/Ultralight-1.2.1/Ultralight-1.2.1/samples/deps/Ultralight'
-- extracting... [tar xfz]
-- extracting... [analysis]
-- extracting... [rename]
-- extracting... [clean up]
-- extracting... done
[ 26%] No update step for 'UltralightBin'
[ 27%] No patch step for 'UltralightBin'
[ 29%] No configure step for 'UltralightBin'
[ 30%] No build step for 'UltralightBin'
[ 31%] No install step for 'UltralightBin'
[ 33%] Completed 'UltralightBin'
[ 33%] Built target UltralightBin
Scanning dependencies of target AppCoreBin
[ 34%] Creating directories for 'AppCoreBin'
[ 36%] Performing download step (download, verify and extract) for 'AppCoreBin' -- Downloading...
dst='S:/Ultralight-1.2.1/Ultralight-1.2.1/samples/AppCoreBin-prefix/src/appcore-bin-b4326cd-win-x64.7z'
timeout='none'
inactivity timeout='none'
-- Using src='https://appcore-bin.sfo2.cdn.digitaloceanspaces.co...'
-- [download 0% complete]
-- [download 100% complete]
-- Downloading... done
-- extracting...
src='S:/Ultralight-1.2.1/Ultralight-1.2.1/samples/AppCoreBin-prefix/src/appcore-bin-b4326cd-win-x64.7z'
dst='S:/Ultralight-1.2.1/Ultralight-1.2.1/samples/deps/AppCore'
-- extracting... [tar xfz]
-- extracting... [analysis]
-- extracting... [rename]
-- extracting... [clean up]
-- extracting... done
[ 37%] No update step for 'AppCoreBin'
[ 38%] No patch step for 'AppCoreBin'
[ 40%] No configure step for 'AppCoreBin'
[ 41%] No build step for 'AppCoreBin'
[ 43%] No install step for 'AppCoreBin'
[ 44%] Completed 'AppCoreBin'
[ 44%] Built target AppCoreBin
Scanning dependencies of target CopySDK
[ 44%] Built target CopySDK
Scanning dependencies of target Sample1
[ 45%] Building CXX object samples/Sample 1 - Render to PNG/CMakeFiles/Sample1.dir/main.cpp.obj
In file included from S:/Ultralight-1.2.1/Ultralight-1.2.1/SDK/include/Ultralight/Ultralight.h:9,
from S:\Ultralight-1.2.1\Ultralight-1.2.1\samples\Sample 1 - Render to PNG\main.cpp:1:
S:/Ultralight-1.2.1/Ultralight-1.2.1/SDK/include/Ultralight/Bitmap.h:26:14: warning: 'dllimport' attribute ignored [-Wattributes]
enum UExport BitmapFormat {
^~~~~~~~~~~~
In file included from S:/Ultralight-1.2.1/Ultralight-1.2.1/SDK/include/Ultralight/Ultralight.h:24,
from S:\Ultralight-1.2.1\Ultralight-1.2.1\samples\Sample 1 - Render to PNG\main.cpp:1:
S:/Ultralight-1.2.1/Ultralight-1.2.1/SDK/include/Ultralight/platform/GPUDriver.h:71:14: warning: 'dllimport' attribute ignored [-Wattributes]
enum UExport VertexBufferFormat {
^~~~~~~~~~~~~~~~~~
S:/Ultralight-1.2.1/Ultralight-1.2.1/SDK/include/Ultralight/platform/GPUDriver.h:104:14: warning: 'dllimport' attribute ignored [-Wattributes]
enum UExport ShaderType {
^~~~~~~~~~
S:/Ultralight-1.2.1/Ultralight-1.2.1/SDK/include/Ultralight/platform/GPUDriver.h:164:14: warning: 'dllimport' attribute ignored [-Wattributes]
enum UExport CommandType {
^~~~~~~~~~~
S:\Ultralight-1.2.1\Ultralight-1.2.1\samples\Sample 1 - Render to PNG\main.cpp: In member function 'void MyApp::Run()':
S:\Ultralight-1.2.1\Ultralight-1.2.1\samples\Sample 1 - Render to PNG\main.cpp:140:12: error: 'std::this_thread' has not been declared
std::this_thread::sleep_for (std::chrono::milliseconds(10));
^~~~~~~~~~~
mingw32-make[2]: *** [samples\Sample 1 - Render to PNG\CMakeFiles\Sample1.dir\build.make:82: samples/Sample 1 - Render to PNG/CMakeFiles/Sample1.dir/main.cpp.obj] Error 1
mingw32-make[1]: *** [CMakeFiles\Makefile2:463: samples/Sample 1 - Render to PNG/CMakeFiles/Sample1.dir/all] Error 2
mingw32-make: *** [Makefile:102: all] Error 2

Вроде всё за исключением примеров, а они мне нафиг не нужны, компилится.
После этого в папке SDK лежат ещё 4 папки, bin, lib, include, inspecror. Последнею стразу делитаю.
В lib находится 4 файла:
AppCore.lib
Ultralight.lib
UltralightCore.lib
WebCore.lib
Вот тут то и загвоздка, мне нужны не .lib а .a файлы, я юзаю MinGW-W64.
Ну ладно, может он их поддерживает,
спойлер
походу нет
.
Ренеймаю их в:
libAppCore.lib.a
libUltralight.lib.a
libUltralightCore.lib.a
libWebCore.lib.a
Что бы линковщик мог найти, иначе не получается командой -l
Окей, копирую папки bin (там кста 4 dll с такими же названиями), include и lib в
bin - S:\MinGW\bin
include/lib - S:\MinGW\local\include -/- lib
И компилю
пример
#include <AppCore/App.h>
#include <AppCore/Window.h>
#include <AppCore/Overlay.h>
#include <AppCore/JSHelpers.h>
using namespace ultralight;
class UltralightMain {
  RefPtr<Overlay> overlay;
public:
  UltralightMain(Ref<Window> win) {
    overlay = Overlay::Create(win, win->width(), win->height(), 0, 0);
    overlay->view()->LoadURL("file:///main_window.html");
  }
virtual ~UltralightMain() {}
}
int main() {
auto app = App::Create();
auto window = Window::Create(app->main_monitor(), 450, 700, false,
kWindowFlags_Titled);
window->SetTitle("Hi Ultralight here!");
app->set_window(window);
UltralightMain my_app(window);
app->Run();

  return 0;
}
командой:
g++ main.cpp -o main -IS:\MinGW\local\include -LS:\MinGW\local\lib -lAppCore.lib -lUltralightCore.lib -lUltralight.lib -lAppCore.lib

И получаю
вот это
In file included from S:\MinGW\local\include/Ultralight/RenderTarget.h:16,
from S:\MinGW\local\include/Ultralight/View.h:21,
from S:\MinGW\local\include/Ultralight/Renderer.h:18,
from S:\MinGW\local\include/AppCore/App.h:17,
from main.cpp:1:
S:\MinGW\local\include/Ultralight/Bitmap.h:26:14: warning: 'dllimport' attribute ignored [-Wattributes]
enum UExport BitmapFormat {
^~~~~~~~~~~~
S:\Users\...\AppData\Local\Temp\ccoo3iBd.o:main.cpp:(.text+0x76): undefined reference to `__imp__ZN10ultralight3App6CreateENS_8SettingsENS_6ConfigE'
S:\Users\...\AppData\Local\Temp\ccoo3iBd.o:main.cpp:(.text+0xde): undefined reference to `__imp__ZN10ultralight6Window6CreateEPNS_7MonitorEjjbj'
S:\Users\...\AppData\Local\Temp\ccoo3iBd.o:main.cpp:(.text$_ZN10ultralight8SettingsC1Ev[_ZN10ultralight8SettingsC1Ev]+0x23): undefined reference to `__imp__ZN10ultralight6StringC1EPKc'
...куча таких..
collect2.exe: error: ld returned 1 exit status

Может g++ не поддерживает .lib? Тогда как конвертировать .lib в .a?
  • Вопрос задан
  • 50 просмотров
Пригласить эксперта
Ваш ответ на вопрос

Войдите, чтобы написать ответ

Войти через центр авторизации
Похожие вопросы
deeplay Новосибирск
от 150 000 ₽
2GIS Новосибирск
от 180 000 ₽
Stream Labs Москва
До 180 000 ₽
07 мар. 2021, в 23:34
5000 руб./за проект
07 мар. 2021, в 23:14
10000 руб./за проект