r52 / quasar

Stylize your desktop
https://quasardoc.readthedocs.io
GNU General Public License v3.0
10 stars 2 forks source link

Compiling error #10

Closed shodanwashere closed 1 year ago

shodanwashere commented 2 years ago

Trying to build Quasar using CMake 3.16.3 (on Ubuntu 20.04 LTS) leads to the return of this error:

/home/shodan/Downloads/quasar/extension-api/dataextension.cpp: In member function ‘QJsonObject DataExtension::getMetadataJSON(bool)’:
/home/shodan/Downloads/quasar/extension-api/dataextension.cpp:417:31: error: conversion from ‘const int64_t’ {aka ‘const long int’} to ‘const QJsonValue’ is ambiguous
  417 |         rate["rate"]    = src.rate;
      |                               ^~~~
In file included from /usr/include/x86_64-linux-gnu/qt5/QtCore/qjsonarray.h:43,
                 from /usr/include/x86_64-linux-gnu/qt5/QtCore/QJsonArray:1,
                 from /home/shodan/Downloads/quasar/extension-api/dataextension.h:20,
                 from /home/shodan/Downloads/quasar/extension-api/dataextension.cpp:1:
shodanwashere commented 2 years ago

error fixed??? on line 417 in dataextension.cpp, cast src.rate as const qint64 before placing it inside rate["rate"], like so:

417: rate["rate"] = ((const qint64) src.rate);

new error, though:

/home/shodan/Downloads/quasar/extension-api/extension_support.cpp: In function ‘bool quasar_get_string(quasar_settings_t*, const char*, char*, size_t)’:
/home/shodan/Downloads/quasar/extension-api/extension_support.cpp:427:9: error: ‘strcpy_s’ was not declared in this scope; did you mean ‘strcpy’?
  427 |         strcpy_s(buf, size, ba.data());
      |         ^~~~~~~~
      |         strcpy
/home/shodan/Downloads/quasar/extension-api/extension_support.cpp: In function ‘bool quasar_get_selection(quasar_settings_t*, const char*, char*, size_t)’:
/home/shodan/Downloads/quasar/extension-api/extension_support.cpp:442:9: error: ‘strcpy_s’ was not declared in this scope; did you mean ‘strcpy’?
  442 |         strcpy_s(buf, size, ba.data());
      |         ^~~~~~~~
      |         strcpy
/home/shodan/Downloads/quasar/extension-api/extension_support.cpp: In function ‘bool quasar_get_storage_string(quasar_ext_handle, const char*, char*, size_t)’:
/home/shodan/Downloads/quasar/extension-api/extension_support.cpp:518:13: error: ‘strcpy_s’ was not declared in this scope; did you mean ‘strcpy’?
  518 |             strcpy_s(buf, size, ba.data());
      |             ^~~~~~~~
      |             strcpy

you're using functions dependent on Microsoft's UCRT, which makes this unable to be built for Linux at the moment. I'll see if the same methodology can be implemented by copying the memory directly.

shodanwashere commented 2 years ago

and now that i've fixed those memory copying issues, i've run into a problem with linking third party libraries from Tessil and his ordered map stuff that needs tinkering with CMake files, which i do not have experience with.

In file included from /home/shodan/Downloads/quasar/quasar/dataserver.cpp:3:
/home/shodan/Downloads/quasar/extension-api/dataextension.h:18:10: fatal error: tsl/ordered_map.h: No such file or directory
   18 | #include <tsl/ordered_map.h>
      |          ^~~~~~~~~~~~~~~~~~~

Edit: This compilation was attempted on a machine running Ubuntu 20.04.1 LTS.

r52 commented 1 year ago

and now that i've fixed those memory copying issues, i've run into a problem with linking third party libraries from Tessil and his ordered map stuff that needs tinkering with CMake files, which i do not have experience with.

In file included from /home/shodan/Downloads/quasar/quasar/dataserver.cpp:3:
/home/shodan/Downloads/quasar/extension-api/dataextension.h:18:10: fatal error: tsl/ordered_map.h: No such file or directory
   18 | #include <tsl/ordered_map.h>
      |          ^~~~~~~~~~~~~~~~~~~

Edit: This compilation was attempted on a machine running Ubuntu 20.04.1 LTS.

For the record:

https://github.com/r52/quasar/blob/783052b7589b568526173b4c2c4669e3feb8bcb5/extension-api/CMakeLists.txt#L8

This is the line in the CMake file that references the folder with the headers in the extension-api project. If the failure happens during the compilation of the main quasar project, perhaps it can be fixed by adding the same line to quasar/CMakeLists.txt.

For example:

cmake_minimum_required(VERSION 3.9)

project(quasar)

set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTOUIC ON)
set(CMAKE_AUTOUIC_SEARCH_PATHS ${CMAKE_SOURCE_DIR})
set(CMAKE_AUTORCC ON)

+include_directories(../include)

find_package(Qt5 5.12 COMPONENTS Core Gui Widgets Network NetworkAuth WebSockets WebEngine WebEngineCore WebEngineWidgets REQUIRED)
find_package(Git)
find_package(Threads REQUIRED)

Unfortunately I don't have a linux box on hand to test this on anymore so I can't give more than suggestions. Furthermore, I'm planning on rewriting large portions of this project with Qt6 (and other more modern libraries) as a base, hopefully in the near future, so I won't be touching the codebase for this current version anymore.

Good luck!