N
N
NQUARE2021-01-17 22:44:33
C++ / C#
NQUARE, 2021-01-17 22:44:33

Why isn't the Ultralight library built?

Here I am trying to compile the Ultralight Bible, on Windows:
I download the archive , unpack it of course.
Then in the console:

cd S:\Ultralight-1.2.1\Ultralight-1.2.1
cmake-gui

After that, in cmake-gui I set everything like this:
600492a62f83a885135270.png
And I click Configure > Finish > Generate (all options are unchecked).
Well, I run make:
mingw32-make
I wait and get
conclusion
$ 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

Everything seems to be except for examples, but I don’t need them, it compiles.
After that, there are 4 more folders in the SDK folder, bin, lib, include, inspecror. I share the last rhinestone.
There are 4 files in the lib:
AppCore.lib
Ultralight.lib
UltralightCore.lib
WebCore.lib
Here is the catch, I need not .lib but .a files, I use MinGW-W64.
Okay, maybe he supports them,
spoiler
походу нет
.
I rename them to:
libAppCore.lib.a
libUltralight.lib.a
libUltralightCore.lib.a
libWebCore.lib.a
What the linker could find, otherwise it doesn’t work with the -l command
Okay, I copy the bin folders (there are 4 dlls with the same names ), include and lib in
bin - S:\MinGW\bin
include/lib - S:\MinGW\local\include -/- lib
And compile
example
#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;
}
command:
g++ main.cpp -o main -IS:\MinGW\local\include -LS:\MinGW\local\lib -lAppCore.lib -lUltralightCore.lib -lUltralight.lib -lAppCore.lib

And I get
this
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

Maybe g++ doesn't support .lib? Then how to convert .lib to .a?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question