Cross platform C++ libraries

Overview

CopperSpice

Introduction

CopperSpice is a set of individual libraries which can be used to develop cross platform software applications in C++. It is a totally open source project released under the LGPL V2.1 license and was initially derived from the Qt framework. Over the last several years CopperSpice has completely diverged, with a goal of providing a first class GUI library to unite the C++ community.

Our motivation for developing CopperSpice was to change the fundamental design and turn the existing framework into a set of libraries for C++ developers. We are accomplishing this by leveraging modern C++ functionality, new technology, and modern tooling. CopperSpice currently requires C++17 or newer.

The libraries avaiable in CopperSpice include:

  • CsCore
  • CsGui
  • CsMultimedia
  • CsNetwork
  • CsOpenGL
  • CsScript
  • CsSql
  • CsSvg
  • CsWebKit
  • CsXml
  • CsXmlPatterns

There are also several open source BSD licensed libraries which are used by CopperSpice and available as stand alone libraries for anyone developing C++ applications.

  • CsPrint
  • CsSignal
  • CsString
  • CsLibGuarded

System Requirements

To use the CopperSpice libraries a C++17 compiler and a C++17 standard library are required.

CopperSpice CMake build files are provided with the source distribution. We recommend your projects should also use CMake for the build system.

For additional information about building from source, refer to our CopperSpice Overview Documentation or the KitchenSink demo application for sample CMake project files.

Building

The CopperSpice libraries are built using the CMake build system.

Documentation

Overview

The CopperSpice Overview documentation includes information on building CopperSpice, downloading prebuilt binary files, package requirements, setting up an application which links with CopperSpice, migrating to CopperSpice, and general configuration information.

www.copperspice.com/docs/cs_overview/index.html

API

The API contains full class documentation and multiple tutorials for CopperSpice and is available directly on our website and from our download page.

URL Description
www.copperspice.com/docs/cs_api/index.html CopperSpice 1.7
https://download.copperspice.com/copperspice/documentation Overview and API (tar and zip formats)
Major Enhancements

Reflection

  • No Meta-Object Compiler is required for generating meta data, all references were removed
  • The functionality provided by moc was replaced with compile time templates
  • CopperSpice automatically generates meta data for processing Signals/ Slots and Introspection
  • A template class can now inherit from QObject with no restrictions on types
  • Complex data types such as QMap<QString, int> can be used for signal or slot arguments

Enhanced Functionality

  • CopperSpice makes extensive use of modern C++ features

    • constexpr, variadic templates, SFINAE, lambda expressions, tuple, move semantics, and type traits
  • Redesigned all container classes to use the C++ standard library containers, iterators, and algorithms

  • CopperSpice includes a majority of the Qt 5 classes

  • New platform independent plugin system based on C++

  • High DPI Support

  • Integration of CsSignal

    • Improved thread aware Signal/Slot delivery
    • Increased efficiency while maintaining the full Signal/Slot API
    • Deadlocks in Signal/Slot processing have been eliminated
  • Integration of CsString

    • Improved storage to properly represent Unicode strings
    • QString8 (UTF-8) and QString16 (UTF-16) classes
    • Added QStringView and QStringParser
  • Integration of CsLibGuarded

    • Used to manage shared data

Using the Libraries

  • Any C++ application using CopperSpice can be built with CMake or any build system which imports CMake files
  • CopperSpice can be linked directly into any standard C++ application

Presentations

Our YouTube channel contains videos about C++, graphics, build systems, CopperSpice, DoxyPress, and other topics related to software development.

https://www.youtube.com/copperspice

Links to technical presentations recorded at CppCon, CppNow, embBO++, MeetingC++, and code::dive, can be found on our presentation page.

www.copperspice.com/presentations.html

Authors / Key Contributors

  • Ansel Sermersheim
  • Barbara Geller
  • Jan Wilmans
  • Tim van Deurzen
  • Peter Bindels
  • Jeff Cohen
  • Mortaro Marcello
  • Adam Mensel
  • Robin Mills
  • Ivailo Monev
  • Adam Mensel
  • Matan Nassaw
  • Daniel Pfeifer
  • Zbigniew Skowron

License

This library is released under the LGPL V2.1 license. For more information refer to the LICENSE file provided with this project.

References

Comments
  • Crash when using LineEdit

    Crash when using LineEdit

    The program below crashes with access violation. Move/hover the cursor on the LineEdit. The below example is specific to LineEdit but I am noticing similar crashes in other controls too.

    #include <QtGui/QApplication>
    #include <QtGui/QMainWindow>
    #include <QtGui/QLineEdit>
    #include <Windows.h>
    
    int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, PSTR lpCmdLine, INT nCmdShow)
    {
      QApplication a(__argc, __argv);
    
      QWidget *widget = new QWidget();
      QLineEdit *lineEdit = new QLineEdit(widget);
    
      QMainWindow mw;
      mw.setCentralWidget(widget);
      mw.show();
    
      return a.exec();
    }
    

    Here's the callstack -

    CsGui.dll!qobject_cast<QWindowsVistaAnimation *>(QObject * object) Line 455	C++
    CsGui.dll!QWindowsVistaStyle::drawPrimitive(QStyle::PrimitiveElement element, const QStyleOption * option, QPainter * painter, const QWidget * widget) Line 525	C++
    CsGui.dll!QWindowsVistaStyle::drawPrimitive(QStyle::PrimitiveElement element, const QStyleOption * option, QPainter * painter, const QWidget * widget) Line 520	C++
    CsGui.dll!QLineEdit::paintEvent(QPaintEvent * __formal) Line 1438	C++
    CsGui.dll!QWidget::event(QEvent * event) Line 6660	C++
    CsGui.dll!QLineEdit::event(QEvent * e) Line 1022	C++
    CsGui.dll!QApplicationPrivate::notify_helper(QObject * receiver, QEvent * e) Line 2823	C++
    CsGui.dll!QApplication::notify(QObject * receiver, QEvent * e) Line 2785	C++
    CsCore.dll!QCoreApplication::notifyInternal(QObject * receiver, QEvent * event) Line 670	C++
    CsCore.dll!QCoreApplication::sendSpontaneousEvent(QObject * receiver, QEvent * event) Line 269	C++
    CsGui.dll!QWidgetPrivate::sendPaintEvent(const QRegion & toBePainted) Line 4023	C++
    CsGui.dll!QWidgetPrivate::drawWidget(QPaintDevice * pdev, const QRegion & rgn, const QPoint & offset, int flags, QPainter * sharedPainter, QWidgetBackingStore * backingStore) Line 3961	C++
    CsGui.dll!QWidgetPrivate::paintSiblingsRecursive(QPaintDevice * pdev, const QList<QObject *> & siblings, int index, const QRegion & rgn, const QPoint & offset, int flags, QPainter * sharedPainter, QWidgetBackingStore * backingStore) Line 4187	C++
    CsGui.dll!QWidgetPrivate::drawWidget(QPaintDevice * pdev, const QRegion & rgn, const QPoint & offset, int flags, QPainter * sharedPainter, QWidgetBackingStore * backingStore) Line 4010	C++
    CsGui.dll!QWidgetPrivate::paintSiblingsRecursive(QPaintDevice * pdev, const QList<QObject *> & siblings, int index, const QRegion & rgn, const QPoint & offset, int flags, QPainter * sharedPainter, QWidgetBackingStore * backingStore) Line 4187	C++
    CsGui.dll!QWidgetPrivate::drawWidget(QPaintDevice * pdev, const QRegion & rgn, const QPoint & offset, int flags, QPainter * sharedPainter, QWidgetBackingStore * backingStore) Line 4010	C++
    CsGui.dll!QWidgetBackingStore::doSync() Line 1544	C++
    CsGui.dll!QWidgetBackingStore::sync() Line 1284	C++
    CsGui.dll!QWidgetPrivate::syncBackingStore() Line 1339	C++
    CsGui.dll!QWidget::event(QEvent * event) Line 6841	C++
    CsGui.dll!QMainWindow::event(QEvent * event) Line 1082	C++
    CsGui.dll!QApplicationPrivate::notify_helper(QObject * receiver, QEvent * e) Line 2823	C++
    CsGui.dll!QApplication::notify(QObject * receiver, QEvent * e) Line 2785	C++
    CsCore.dll!QCoreApplication::notifyInternal(QObject * receiver, QEvent * event) Line 670	C++
    CsCore.dll!QCoreApplication::sendEvent(QObject * receiver, QEvent * event) Line 261	C++
    CsCore.dll!QCoreApplicationPrivate::sendPostedEvents(QObject * receiver, int event_type, QThreadData * data) Line 1125	C++
    CsCore.dll!QEventDispatcherWin32::sendPostedEvents() Line 1150	C++
    CsGuiWin.dll!QWindowsGuiEventDispatcher::sendPostedEvents() Line 49	C++
    CsCore.dll!qt_internal_proc(HWND__ * hwnd, unsigned int message, unsigned __int64 wp, __int64 lp) Line 247	C++
    
    opened by hs-apotell 23
  • CMake build error

    CMake build error

    CMake Error at D:/Libraries/CopperSpice/copperspice-1.7.0/release/cmake/CopperSpice/CopperSpiceLibraryTargets.cmake:159 (message): The imported target "CopperSpice::CsCore" references the file

     "D:/Libraries/CopperSpice/copperspice-1.7.0/release/release/lib/CsCore1.7.lib"
    

    but this file does not exist. Possible reasons include:

    • The file was deleted, renamed, or moved to another location.

    • An install or uninstall procedure did not complete successfully.

    • The installation package was faulty and contained

    I had to copy the files manually to release/release for it work properly. I think the windows installer might not be copying the files to the correct location.

    opened by bjaraujo 21
  • CsString & utf8

    CsString & utf8

    Now that c++20 is here, are you anticipating that the design of CsString would be updated to account for std::u8string?

    If not, what advantages would CsString have over std::u8string?

    Thanks in advance!

    opened by VikingExplorer 20
  • Compiling with gstreamer 1.0

    Compiling with gstreamer 1.0

    gstreamer 0.10 is not available any longer in current Debian sid, only gstreamer 1.0 is. This leads however (not really unexpected) to compile errors, e.g.,

    src/3rdparty/phonon/gstreamer/artssink.cpp:77:58: error: ‘GstRingBufferSpec’ has not been declared
    

    Are there plans to get copperspice to work with gstreamer 1.0?

    More important to me: Can gstreamer be disabled using ./configure? (I just want a minimal copperspice to run doxypress. I bet I don't need gstreamer support for that.)

    opened by sbeyer 20
  • Build fails with Clang on Windows (VS2019)

    Build fails with Clang on Windows (VS2019)

    I'm trying to build head with the Clang that comes with VS 2019. This is the output I get:

    C:\PROGRA~2\MICROS~1\2019\PROFES~1\VC\Tools\Llvm\bin\clang-cl.exe  /nologo -TP   @src\core\CMakeFiles\CsCore.dir\kernel\qpointer.cpp.obj.rsp /showIncludes /Fosrc\core\CMakeFiles\CsCore.dir\kernel\qpointer.cpp.obj /Fdsrc\core\CMakeFiles\CsCore.dir\ -c ..\..\..\src\core\kernel\qpointer.cpp
      In file included from ..\..\..\src\core\kernel\qpointer.cpp:24:
      In file included from ..\..\..\src\core\kernel\qpointer.h:27:
      In file included from ..\..\..\src\core\tools\qsharedpointer.h:24:
      In file included from ..\..\..\src\core\global\qnamespace.h:28:
      In file included from ..\..\..\src\core\kernel\csobject_macro.h:27:
      In file included from include\QtCore\cs_signal.h:33:
      In file included from include\QtCore\cs_slot.h:29:
    C:\Users\jamie.kenyon\Downloads\copperspice-master\out\build\x64-Debug\include\QtCore\rcu_guarded.hpp(141,7): error : no matching constructor for initialization of 'libguarded::rcu_list<CsSignal::SignalBase::ConnectStruct, std::mutex, std::allocator<CsSignal::SignalBase::ConnectStruct> >'
          : m_obj(std::forward<Us>(data)...)
            ^     ~~~~~~~~~~~~~~~~~~~~~~
      C:\Users\jamie.kenyon\Downloads\copperspice-master\out\build\x64-Debug\include\QtCore\cs_signal.h(82,22): note: in instantiation of function template specialization 'libguarded::rcu_guarded<libguarded::rcu_list<CsSignal::SignalBase::ConnectStruct, std::mutex, std::allocator<CsSignal::SignalBase::ConnectStruct> > >::rcu_guarded<libguarded::rcu_guarded<libguarded::rcu_list<CsSignal::SignalBase::ConnectStruct, std::mutex, std::allocator<CsSignal::SignalBase::ConnectStruct> > > &>' requested here
      class LIB_SIG_EXPORT SignalBase
                           ^
      C:\Users\jamie.kenyon\Downloads\copperspice-master\out\build\x64-Debug\include\QtCore\rcu_list.hpp(74,14): note: candidate constructor not viable: no known conversion from 'libguarded::rcu_guarded<libguarded::rcu_list<CsSignal::SignalBase::ConnectStruct, std::mutex, std::allocator<CsSignal::SignalBase::ConnectStruct> > >' to 'const std::allocator<CsSignal::SignalBase::ConnectStruct>' for 1st argument
          explicit rcu_list(const Alloc &alloc);
                   ^
      C:\Users\jamie.kenyon\Downloads\copperspice-master\out\build\x64-Debug\include\QtCore\rcu_list.hpp(76,5): note: candidate constructor not viable: no known conversion from 'libguarded::rcu_guarded<libguarded::rcu_list<CsSignal::SignalBase::ConnectStruct, std::mutex, std::allocator<CsSignal::SignalBase::ConnectStruct> > >' to 'const libguarded::rcu_list<CsSignal::SignalBase::ConnectStruct, std::mutex, std::allocator<CsSignal::SignalBase::ConnectStruct> >' for 1st argument
          rcu_list(const rcu_list &) = delete;
          ^
      C:\Users\jamie.kenyon\Downloads\copperspice-master\out\build\x64-Debug\include\QtCore\rcu_list.hpp(77,5): note: candidate constructor not viable: no known conversion from 'libguarded::rcu_guarded<libguarded::rcu_list<CsSignal::SignalBase::ConnectStruct, std::mutex, std::allocator<CsSignal::SignalBase::ConnectStruct> > >' to 'libguarded::rcu_list<CsSignal::SignalBase::ConnectStruct, std::mutex, std::allocator<CsSignal::SignalBase::ConnectStruct> >' for 1st argument
          rcu_list(rcu_list &&)      = delete;
          ^
      C:\Users\jamie.kenyon\Downloads\copperspice-master\out\build\x64-Debug\include\QtCore\rcu_list.hpp(73,5): note: candidate constructor not viable: requires 0 arguments, but 1 was provided
          rcu_list();
          ^
      1 error generated.
    

    NB: I had to reorder CMakeLists.txt, L71 first, like this:

    if(MSVC)
       enable_language(ASM_MASM)
       set(target "MSVC")
    
    elseif(CMAKE_CXX_COMPILER_ID MATCHES "(GNU|Clang|AppleClang)")
       execute_process(
          COMMAND ${CMAKE_CXX_COMPILER} -dumpmachine
          OUTPUT_VARIABLE DUMPMACHINE_OUTPUT
          RESULT_VARIABLE DUMPMACHINE_EXITCODE
          OUTPUT_STRIP_TRAILING_WHITESPACE
       )
    
    opened by TheRealJokerMan 19
  • Crash when opening submenu

    Crash when opening submenu

    Application crashes when opening a submenu. This was presumably fixes in 5.0.1 release but looks like CS never carried it forward and I can't seem to locate the specific change that fixes the issue. Appreciate any help I can get.

    Here's the callstack -

    CsGui1.5.dll!std::vector<QRect,std::allocator >::operator[](const unsigned __int64 Pos) Line 1733 C++ CsGui1.5.dll!QVector::data() Line 126 C++ CsGui1.5.dll!flushRow(const QRegionSpan * spans, int y, int numSpans, QRegionPrivate * reg, int * lastRow, int * extendTo, bool * needsExtend) Line 2944 C++ CsGui1.5.dll!PtsToRegion(int numFullPtBlocks, int iCurPtBlock, POINTBLOCK * FirstPtBlock, QRegionPrivate * reg) Line 3033 C++ CsGui1.5.dll!PolygonRegion(const QPoint * Pts, int Count, int rule) Line 3273 C++ CsGui1.5.dll!QRegion::QRegion(const QPolygon & a, Qt::FillRule fillRule) Line 3407 C++ CsGui1.5.dll!QMenu::internalDelayedPopup() Line 3024 C++ CsGui1.5.dll!QMenu::timerEvent(QTimerEvent * e) Line 2896 C++ CsCore1.5.dll!QObject::event(QEvent * e) Line 588 C++ CsGui1.5.dll!QWidget::event(QEvent * event) Line 6491 C++ CsGui1.5.dll!QMenu::event(QEvent * e) Line 2398 C++ CsGui1.5.dll!QApplicationPrivate::notify_helper(QObject * receiver, QEvent * e) Line 3900 C++ CsGui1.5.dll!QApplication::notify(QObject * receiver, QEvent * e) Line 3862 C++ CsCore1.5.dll!QCoreApplication::notifyInternal(QObject * receiver, QEvent * event) Line 630 C++ CsCore1.5.dll!QCoreApplication::sendEvent(QObject * receiver, QEvent * event) Line 246 C++ CsCore1.5.dll!QEventDispatcherWin32Private::sendTimerEvent(int timerId) Line 482 C++ CsCore1.5.dll!QEventDispatcherWin32::event(QEvent * e) Line 1049 C++ CsGui1.5.dll!QApplicationPrivate::notify_helper(QObject * receiver, QEvent * e) Line 3900 C++ CsGui1.5.dll!QApplication::notify(QObject * receiver, QEvent * e) Line 3254 C++ CsCore1.5.dll!QCoreApplication::notifyInternal(QObject * receiver, QEvent * event) Line 630 C++ CsCore1.5.dll!QCoreApplication::sendEvent(QObject * receiver, QEvent * event) Line 246 C++ CsCore1.5.dll!QCoreApplicationPrivate::sendPostedEvents(QObject * receiver, int event_type, QThreadData * data) Line 1070 C++ CsCore1.5.dll!qt_internal_proc(HWND * hwnd, unsigned int message, unsigned __int64 wp, __int64 lp) Line 300 C++

    opened by ghost 15
  • Compiling copperspice on MacOS M1 is failing with

    Compiling copperspice on MacOS M1 is failing with "#error Unable to detect system architecture, contact CopperSpice development"

    I try to compile copperspice on my MacOS 12.1 (arm64 processor) by specifying SDK version. But it gives compile error as "#error Unable to detect system architecture, contact CopperSpice development".

    Compile commands:

    • cmake -G "Ninja" -DCMAKE_BUILD_TYPE=Release -DCMAKE_OSX_DEPLOYMENT_TARGET=11.3 -DCMAKE_INSTALL_PREFIX=../cs_lib ../cs_source
    • ninja

    Does coppersice have macos m1 support and if it has, how can I build it?

    opened by yucelalbar 14
  • QT_PLUGIN_PATH environment variable causes CS application to crash

    QT_PLUGIN_PATH environment variable causes CS application to crash

    This line of error message appears when I execute any CopperSpice executable, even the prebuilt binaries like Diamond Editor.

    Error Message

    kitchensink

    adding QXcbScreen(0x1ccb580, name=:0.0-32, geometry=1920x1080+0+0, availableGeometry=1920x1045+0+0, devicePixelRatio=1.0, logicalDpi=QPair(96.0,96.0), physicalSize=508.0x285.0mm, screenNumber=0, virtualSize=3840x1080 (3840.0x1080.0mm), orientation=0, depth=24, refreshRate=60.0, root=537, windowManagerName=Mutter (Muffin)) (Primary: false )
    adding QXcbScreen(0x1cdb160, name=:0.0-40, geometry=1920x1080+1920+0, availableGeometry=1920x1045+1920+0, devicePixelRatio=1.0, logicalDpi=QPair(96.0,96.0), physicalSize=508.0x285.0mm, screenNumber=0, virtualSize=3840x1080 (3840.0x1080.0mm), orientation=0, depth=24, refreshRate=60.0, root=537, windowManagerName=Mutter (Muffin)) (Primary: false )
    primary output is :0.0-32
    Choosing xcb gl-integration based on following priority
     (xcb_glx, xcb_egl)
    Failed to create xcb gl-integration
    [1]    5349 segmentation fault (core dumped)  ./out/kitchensink
    

    System Info

    System:    Kernel: 5.6.13-200.fc31.x86_64 x86_64 bits: 64 compiler: gcc v: 9.3.1
               Desktop: Cinnamon 4.4.8 wm: muffin dm: LightDM Distro: Fedora release 31 (Thirty One)
    CPU:       Topology: 6-Core model: AMD Ryzen 5 2600 bits: 64 type: MT MCP arch: Zen+ rev: 2
               L2 cache: 3072 KiB
               flags: avx avx2 lm nx pae sse sse2 sse3 sse4_1 sse4_2 sse4a ssse3 svm bogomips: 81589
               Speed: 1367 MHz min/max: 1550/3400 MHz Core speeds (MHz): 1: 1437 2: 1473 3: 1549
               4: 1549 5: 1382 6: 1383 7: 1379 8: 1383 9: 1549 10: 1549 11: 1549 12: 1550
    Graphics:  Device-1: AMD Ellesmere [Radeon RX 470/480/570/570X/580/580X/590]
               vendor: Micro-Star MSI driver: amdgpu v: kernel bus ID: 1c:00.0 chip ID: 1002:67df
               Display: x11 server: Fedora Project X.org 1.20.6 driver: ati,modesetting
               unloaded: fbdev,vesa alternate: amdgpu resolution: 1: 1920x1080~60Hz 2: 1920x1080~60Hz
               s-dpi: 96
               OpenGL:
               renderer: Radeon RX 580 Series (POLARIS10 DRM 3.36.0 5.6.13-200.fc31.x86_64 LLVM 9.0.0)
               v: 4.5 Mesa 19.2.8 direct render: Yes
    

    How I build and install CopperSpice

    cmake -GNinja -Bbuild \
    -DCMAKE_BUILD_TYPE=Release \
    -DCMAKE_JOB_POOLS:STRING="compile=8;link=10" \
    -DCMAKE_JOB_POOL_COMPILE:STRING=compile \
    -DCMAKE_JOB_POOL_LINK:STRING=link \
    -DWITH_WEBKIT=OFF \
    -DWITH_MYSQL_PLUGIN=OFF \
    -DWITH_PSQL_PLUGIN=OFF \
    -DWITH_ODBC_PLUGIN=OFF
    
    cmake --build build/
    sudo cmake --build build/ --target install
    

    How I build and run kitchensink

    cmake -GNinja -Bbuild -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=out
    cmake --build build/
    cmake --build build/ --target install
    ./out/kitchensink
    

    Additional Info

    I have another machine running Fedora 31 with KDE desktop. It shows the adding QXcbScreen ... Failed to create xcb gl-integration message while executing CS executables, too. Except the applications run normally without crashing.

    opened by kogiokka 14
  • Build issues with v1.6

    Build issues with v1.6

    I had QCustomPlot working with v1.5 but having a hard time getting it to work with the newest v1.6 release. Lots of errors along the lines of the following -

    csmeta.h(314,46): error C2338: Requested type name has not been registered. (compiling source file qcustomplot.cpp)

    Has something changed in context to class/type registration in this release? Also, is the template registration for QSharedPointer missing in csmeta.h?

    Appreciate some help on getting this to work again.

    opened by hs-apotell 14
  • Performance degradation

    Performance degradation

    I just pulled down master @ 32f8144507834fcea042fe943284c8acfc85e8ee and noticing some severe performance degradation. Unfortunately, my last pull was almost 3 months back so can't really confirm as to what during this period might have introduced the issue.

    What I am noticing is that the application takes much longer (10+ seconds) to launch compared to 3+ seconds with previous build. I am also noticing some controls misbehaving like for instance, QLineEdit doesn't reflect typed characters for 5+ seconds.

    opened by hs-apotell 13
  • Vc++ compilation errors

    Vc++ compilation errors

    https://github.com/janwilmans/copperspice-gettingstarted/issues/11#issue-568731974

    How did you build 1.6 ? I trying to build using cmake and VS2019, get ton of errors because of winsock2.h . As you know this conflicts with winsock.h in windows.h (and dshow.h which indirectly includes windows.h)- which is used profusely in copperspice code base.

    opened by mediabuff 13
  • Using OpenSSL on Windows

    Using OpenSSL on Windows

    This is a question posted by a user who's account has been deleted by github. Sadly this also removed the issue. We are reposting the key question and including a solution.

    (User) OpenSSL has many binary distributions on Windows. Which one should I use?

    The CopperSpice supported versions of OpenSSL are 1.0.1g or later and the 1.1.x and 3.x series. On most platforms use your vendor package management command to download and install the OpenSSL development package.

    On Windows you will need to build OpenSSL from source since they do not provide pre-built binary files. The following page in our CS Overview documentation provides the steps required to build for MSVC and MinGW.

    https://www.copperspice.com/docs/cs_overview/openssl.html

    If anyone has any questions please let us know.

    opened by bgeller 0
  • Wrong `QLocale` behavior, possible wrong data in qlocale_data_p.h

    Wrong `QLocale` behavior, possible wrong data in qlocale_data_p.h

    When setting a Locale manually, and converting a float to a string afterwards, the conversion uses wrong characters for the group and decimal symbols:

      // System locale: in this case, de_DE
      const QLocale loc0;
    
      [[maybe_unused]] const QString goodFirst = loc0.toString(1234.56f); // 1.234,56 -> OK
      [[maybe_unused]] const QString  goodSecond = loc0.toString(1234567);  // 1.234.567 -> OK
    
      // Now, set the german locale explicitly
      QLocale::setDefault(QLocale::German);
    
      // Locale which was manually set to german
      const QLocale loc;
    
      [[maybe_unused]] const QString  badFirst = loc.toString(1234.56f); // 1,234.56 -> NOK
      [[maybe_unused]] const QString  badSecond = loc.toString(1234567);  // 1,234,567 -> NOK
    

    I reproduced this by setting the locale to de_DE and fr_FR, but I fear it affects all locales.

    I found out that when creating a locale which is not the system locale, CopperSpice actually performs a lookup in a static table, static const QLocaleData locale_data[].

    The source of this table - which, according to the comments, is generated - starts here: https://github.com/copperspice/copperspice/blob/master/src/core/locale/qlocale_data_p.h#L1198

    If you look at its data, you'll notice the 4th (decimal) and 5th (group) columns always define 44 (comma) and 46 (period) respectively.

    If I interpret this correctly, the data in qlocale_data_p.h is wrong: de_DE, fr_Fr, and many other locales use a comma as a decimal symbol, and a period as a grouping symbol.

    PS: I only verified decimal and grouping symbols, I haven't verified other data like date formats yet.

    opened by informeti 1
  • Fixed compilation using gcc-11

    Fixed compilation using gcc-11

    When linking an application to copperspice 1.7.4 using gcc-11, it gives an error on the specialized template for the ThreadEngineStarter. (See attached image)

    image

    This was caused by the repeated template argument at the constructor. I've removed this, and now it works with my application. I've also tested using the kitchensink application, which also compiles and links.

    opened by timherreijgers 2
  • Copperspice failed to msbuild with fatal error C1189: #error:  Unable to detect system architecture, contact CopperSpice development with MSVC on windows arm64

    Copperspice failed to msbuild with fatal error C1189: #error: Unable to detect system architecture, contact CopperSpice development with MSVC on windows arm64

    Hi All,

    Environment: VS 2019 + Windows Server 2019

    Copperspice failed to msbuild with fatal error C1189: #error: Unable to detect system architecture, contact CopperSpice development with MSVC on windows arm64. Does Copperspice support windows arm64? Could you please help look at this issue?

    Repro steps:

    1. git clone https://github.com/copperspice/copperspice.git F:\gitP\copperspice\copperspice
    2. "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\Common7\Tools\VsDevCmd.bat" -host_arch=amd64 -arch=arm64
    3. set CL=/wd4251 /wd4244 /wd4291 /wd4018 /wd4275 /wd4250 /wd4996
    4. cd F:\gitP\copperspice\copperspice && mkdir build_arm64
    5. cd build_arm64
    6. cmake -G "Visual Studio 16 2019" -DCMAKE_SYSTEM_NAME=Windows -DCMAKE_SYSTEM_PROCESSOR=aarch64 -A arm64 -DCMAKE_SYSTEM_VERSION=10.0.18362.0 -DCMAKE_BUILD_TYPE=Release ..
    7. msbuild /m /p:Platform=arm64 /p:Configuration=Release copperspice.sln /t:Rebuild

    Build log: build_arm64.zip

    Errors: 26>F:\gitP\copperspice\copperspice\src\core\global\qglobal.h(132,1): fatal error C1189: #error: Unable to detect system architecture, contact CopperSpice development (compiling source file F:\gitP\copperspice\copperspice\src\core\concurrent\qfutureinterface.cpp) [F:\gitP\copperspice\copperspice\build_arm64\src\core\CsCore.vcxproj] 26>F:\gitP\copperspice\copperspice\src\core\global\qglobal.h(132,1): fatal error C1189: #error: Unable to detect system architecture, contact CopperSpice development (compiling source file F:\gitP\copperspice\copperspice\src\core\codecs\qtextcodec.cpp) [F:\gitP\copperspice\copperspice\build_arm64\src\core\CsCore.vcxproj] qrunnable.cpp 26>F:\gitP\copperspice\copperspice\src\core\global\qglobal.h(132,1): fatal error C1189: #error: Unable to detect system architecture, contact CopperSpice development (compiling source file F:\gitP\copperspice\copperspice\src\core\concurrent\qfuturewatcher.cpp) [F:\gitP\copperspice\copperspice\build_arm64\src\core\CsCore.vcxproj] qtconcurrentexception.cpp 26>F:\gitP\copperspice\copperspice\src\core\global\qglobal.h(132,1): fatal error C1189: #error: Unable to detect system architecture, contact CopperSpice development (compiling source file F:\gitP\copperspice\copperspice\src\core\codecs\qisciicodec.cpp) [F:\gitP\copperspice\copperspice\build_arm64\src\core\CsCore.vcxproj] 26>F:\gitP\copperspice\copperspice\src\core\global\qglobal.h(132,1): fatal error C1189: #error: Unable to detect system architecture, contact CopperSpice development (compiling source file F:\gitP\copperspice\copperspice\src\core\codecs\qlatincodec.cpp) [F:\gitP\copperspice\copperspice\build_arm64\src\core\CsCore.vcxproj]

    opened by spacelg 1
  • Fails to build with LTO enabled

    Fails to build with LTO enabled

    Copperspice 1.7.3 fails to build for me with LTO enabled. Disabling LTO makes it to build fine. Error log:

    [  7%] Linking CXX shared library ../../lib/libCsSql1.7.so
    
    ...
    
    /usr/bin/ld: /tmp/ccGk6fNj.ltrans0.ltrans.o:(.data.rel.ro+0x20): undefined reference to `QObject::metaObject() const'
    /usr/bin/ld: /tmp/ccGk6fNj.ltrans0.ltrans.o:(.data.rel.ro+0x788): undefined reference to `QObject::metaObject() const'
    /usr/bin/ld: /tmp/ccGk6fNj.ltrans0.ltrans.o:(.data.rel.ro+0x8a0): undefined reference to `QAbstractItemModel::metaObject() const'
    /usr/bin/ld: /tmp/ccGk6fNj.ltrans0.ltrans.o:(.data.rel.ro+0xac8): undefined reference to `QAbstractTableModel::metaObject() const'
    /usr/bin/ld: /tmp/ccGk6fNj.ltrans0.ltrans.o:(.data.rel.ro+0x17a0): undefined reference to `QAbstractItemModel::metaObject() const'
    /usr/bin/ld: /tmp/ccGk6fNj.ltrans0.ltrans.o:(.data.rel.ro+0x19c8): undefined reference to `QAbstractTableModel::metaObject() const'
    /usr/bin/ld: /tmp/ccGk6fNj.ltrans0.ltrans.o:(.data.rel.ro+0x27b8): undefined reference to `QObject::metaObject() const'
    collect2: error: ld returned 1 exit status
    make[2]: *** [src/sql/CMakeFiles/CsSql.dir/build.make:339: lib/libCsSql1.7.so] Error 1
    make[2]: Leaving directory '/build/copperspice/src/build'
    make[1]: *** [CMakeFiles/Makefile2:738: src/sql/CMakeFiles/CsSql.dir/all] Error 2
    make[1]: *** Waiting for unfinished jobs....
    
    ...
    
    [ 13%] Linking CXX shared library ../../lib/libCsScript1.7.so
    make[2]: Leaving directory '/build/copperspice/src/build'
    [ 13%] Built target lupdate
    [ 13%] Linking CXX shared library ../../lib/libCsNetwork1.7.so
    /usr/bin/ld: /tmp/ccGP8vHp.ltrans0.ltrans.o: in function `ctiVMThrowTrampoline':
    <artificial>:(.text+0x4c): undefined reference to `cti_vm_throw'
    /usr/bin/ld: /tmp/ccGP8vHp.ltrans0.ltrans.o:(.data.rel.ro+0x8998): undefined reference to `QObject::metaObject() const'
    /usr/bin/ld: /tmp/ccGP8vHp.ltrans1.ltrans.o:(.data.rel.ro+0x3a8): undefined reference to `QObject::metaObject() const'
    /usr/bin/ld: /tmp/ccGP8vHp.ltrans8.ltrans.o:(.data.rel.ro+0x20): undefined reference to `QObject::metaObject() const'
    /usr/bin/ld: /tmp/ccGP8vHp.ltrans39.ltrans.o:(.data.rel.ro+0x70): undefined reference to `QObject::metaObject() const'
    /usr/bin/ld: /tmp/ccGP8vHp.ltrans39.ltrans.o:(.data.rel.ro+0x188): undefined reference to `QThread::metaObject() const'
    /usr/bin/ld: /tmp/ccGP8vHp.ltrans39.ltrans.o:(.data.rel.ro+0x508): undefined reference to `QThread::metaObject() const'
    collect2: error: ld returned 1 exit status
    make[2]: *** [src/script/CMakeFiles/CsScript.dir/build.make:2931: lib/libCsScript1.7.so] Error 1
    make[2]: Leaving directory '/build/copperspice/src/build'
    make[1]: *** [CMakeFiles/Makefile2:712: src/script/CMakeFiles/CsScript.dir/all] Error 2
    /usr/bin/ld: /tmp/ccaAfqHs.ltrans0.ltrans.o:(.data.rel.ro+0x1080): undefined reference to `QIODevice::metaObject() const'
    /usr/bin/ld: /tmp/ccaAfqHs.ltrans0.ltrans.o:(.data.rel.ro+0x4cd8): undefined reference to `QObject::metaObject() const'
    /usr/bin/ld: /tmp/ccaAfqHs.ltrans1.ltrans.o:(.data.rel.ro+0x788): undefined reference to `QObject::metaObject() const'
    /usr/bin/ld: /tmp/ccaAfqHs.ltrans1.ltrans.o:(.data.rel.ro+0xb38): undefined reference to `QObject::metaObject() const'
    /usr/bin/ld: /tmp/ccaAfqHs.ltrans4.ltrans.o:(.data.rel.ro+0x3d0): undefined reference to `QObject::metaObject() const'
    /usr/bin/ld: /tmp/ccaAfqHs.ltrans4.ltrans.o:(.data.rel.ro+0x6a0): undefined reference to `QObject::metaObject() const'
    /usr/bin/ld: /tmp/ccaAfqHs.ltrans4.ltrans.o:(.data.rel.ro+0x990): more undefined references to `QObject::metaObject() const' follow
    /usr/bin/ld: /tmp/ccaAfqHs.ltrans14.ltrans.o:(.data.rel.ro+0x148): undefined reference to `QIODevice::metaObject() const'
    /usr/bin/ld: /tmp/ccaAfqHs.ltrans14.ltrans.o:(.data.rel.ro+0x3a8): undefined reference to `QIODevice::metaObject() const'
    /usr/bin/ld: /tmp/ccaAfqHs.ltrans15.ltrans.o:(.data.rel.ro+0x90): undefined reference to `QObject::metaObject() const'
    /usr/bin/ld: /tmp/ccaAfqHs.ltrans16.ltrans.o:(.data.rel.ro+0x58): undefined reference to `QObject::metaObject() const'
    /usr/bin/ld: /tmp/ccaAfqHs.ltrans17.ltrans.o:(.data.rel.ro+0x1a0): undefined reference to `QObject::metaObject() const'
    /usr/bin/ld: /tmp/ccaAfqHs.ltrans22.ltrans.o:(.data.rel.ro+0x20): undefined reference to `QObject::metaObject() const'
    /usr/bin/ld: /tmp/ccaAfqHs.ltrans22.ltrans.o:(.data.rel.ro+0x138): undefined reference to `QNonContiguousByteDevice::metaObject() const'
    /usr/bin/ld: /tmp/ccaAfqHs.ltrans25.ltrans.o:(.data.rel.ro+0x1a0): undefined reference to `QObject::metaObject() const'
    /usr/bin/ld: /tmp/ccaAfqHs.ltrans25.ltrans.o:(.data.rel.ro+0x2b8): undefined reference to `QObject::metaObject() const'
    /usr/bin/ld: /tmp/ccaAfqHs.ltrans27.ltrans.o:(.data.rel.ro+0x80): undefined reference to `QThreadPool::metaObject() const'
    /usr/bin/ld: /tmp/ccaAfqHs.ltrans32.ltrans.o:(.data.rel.ro+0x38): undefined reference to `QObject::metaObject() const'
    /usr/bin/ld: /tmp/ccaAfqHs.ltrans32.ltrans.o:(.data.rel.ro+0x2c0): undefined reference to `QObject::metaObject() const'
    /usr/bin/ld: /tmp/ccaAfqHs.ltrans35.ltrans.o:(.data.rel.ro+0x80): undefined reference to `QObject::metaObject() const'
    /usr/bin/ld: /tmp/ccaAfqHs.ltrans35.ltrans.o:(.data.rel.ro+0x198): undefined reference to `QSocketNotifier::metaObject() const'
    /usr/bin/ld: /tmp/ccaAfqHs.ltrans35.ltrans.o:(.data.rel.ro+0x580): undefined reference to `QSocketNotifier::metaObject() const'
    /usr/bin/ld: /tmp/ccaAfqHs.ltrans35.ltrans.o:(.data.rel.ro+0x6e0): undefined reference to `QSocketNotifier::metaObject() const'
    /usr/bin/ld: /tmp/ccaAfqHs.ltrans35.ltrans.o:(.data.rel.ro+0x840): undefined reference to `QSocketNotifier::metaObject() const'
    collect2: error: ld returned 1 exit status
    make[2]: *** [src/network/CMakeFiles/CsNetwork.dir/build.make:1317: lib/libCsNetwork1.7.so] Error 1
    make[2]: Leaving directory '/build/copperspice/src/build'
    make[1]: *** [CMakeFiles/Makefile2:659: src/network/CMakeFiles/CsNetwork.dir/all] Error 2
    make[1]: Leaving directory '/build/copperspice/src/build'
    make: *** [Makefile:156: all] Error 2
    make: Leaving directory '/build/copperspice/src/build'
    

    Build options:

    cmake -B build -S copperspice-cs-1.7.3 \
            -DCMAKE_BUILD_TYPE:STRING='None' \
            -DCMAKE_INSTALL_BINDIR:PATH='lib/copperspice/bin' \
            -DCMAKE_INSTALL_INCLUDEDIR:PATH='include/copperspice' \
            -DCMAKE_INSTALL_PREFIX:PATH='/usr' \
            -Wno-dev
    

    Build flags:

    CFLAGS: -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -flto
    CXXFLAGS: -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -Wp,-D_GLIBCXX_ASSERTIONS -flto
    LDFLAGS: -Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now -flto
    

    System information:

    • Arch Linux x86_64
    • gcc 11.1.0
    • CMake 3.22.1
    opened by dbermond 0
Releases(cs-1.8.0)
Cross platform C++ libraries

CopperSpice Introduction CopperSpice is a set of individual libraries which can be used to develop cross platform software applications in C++. It is

CopperSpice 830 Nov 23, 2022
Purely native C++ cross-platform GUI framework for Android and iOS development. https://www.boden.io

BODEN CROSS-PLATFORM FRAMEWORK Build purely native cross-platform experiences with Boden Website ⬡ Getting Started ⬡ API Reference ⬡ Guides ⬡ Twitter

Ashampoo Systems GmbH & Co KG 1.6k Nov 24, 2022
A single-header ANSI C immediate mode cross-platform GUI library

Nuklear This is a minimal-state, immediate-mode graphical user interface toolkit written in ANSI C and licensed under public domain. It was designed a

Immediate Mode UIs, Nuklear, etc. 6.3k Dec 2, 2022
A library for creating native cross-platform GUI apps

Yue A library for creating native cross-platform GUI apps. Getting started Documentations FAQ Development Examples Sample apps (with screenshots) Muba

Yue 2.8k Nov 25, 2022
Cross-platform malware development library for anti-analysis techniques

The Anti-Analysis Menagerie Cross-platform malware development library for anti-analysis techniques. Design Goals Provide a rich and convenient interf

Alan 21 Sep 16, 2022
DeskGap is a framework for building cross-platform desktop apps with web technologies (JavaScript, HTML and CSS).

A cross-platform desktop app framework based on Node.js and the system webview

Wang, Chi 1.8k Nov 27, 2022
Taitank is a cross platform lightweight flex layout engine implemented in C++.

Taitank is a cross platform lightweight flex layout engine implemented in C++.

Tencent 443 Nov 23, 2022
Open Source, cross platform C++ library providing integration of VulkanSceneGraph with Qt windowing

Open Source, cross platform C++ library providing integration of VulkanSceneGraph with Qt windowing. Supports Windows, Linux and macOS.

Vulkan made easy 14 Nov 23, 2022
A cross-platform GUI for jzIntv

jzIntvImGui Welcome to jzIntvImGui! It's an all-in-one powerful Dear ImGui interface which allows you to manage your collection of Intellivision games

null 6 Nov 24, 2022
Yoga is a cross-platform layout engine which implements Flexbox

Yoga Building Yoga builds with buck. Make sure you install buck before contributing to Yoga. Yoga's main implementation is in C++, with bindings to su

Meta 15.7k Nov 30, 2022
Electron framework lets you write cross-platform desktop applications using JavaScript, HTML and CSS.

?? Available Translations: ???? ???? ???? ???? ???? ???? ???? ???? . View these docs in other languages at electron/i18n. The Electron framework lets

Electron 104.7k Dec 1, 2022
Cross-platform GUI library

Harbour Nuklear backend This backend provides support for Nuklear. It works on on all supported platforms with an OpenGL backend, including iOS and An

Rafał Jopek 2 Jan 19, 2022
FLTK - Fast Light Tool Kit - a cross-platform C++ GUI toolkit for UNIX(r)/Linux(r) (X11)

FLTK - Fast Light Tool Kit - a cross-platform C++ GUI toolkit for UNIX(r)/Linux(r) (X11)

The FLTK Team 1k Dec 3, 2022
wxWidgets is a free and open source cross-platform C++ framework for writing advanced GUI applications using native controls.

About wxWidgets is a free and open source cross-platform C++ framework for writing advanced GUI applications using native controls. wxWidgets allows y

null 4.7k Dec 3, 2022
Tiny cross-platform webview library for C/C++/Golang. Uses WebKit (Gtk/Cocoa) and Edge (Windows)

A tiny cross-platform webview library for C/C++/Golang to build modern cross-platform GUIs. Also, there are Rust bindings, Python bindings, Nim bindings, Haskell, C# bindings and Java bindings available.

webview 10.7k Nov 26, 2022
NanoGUI is a minimalistic cross-platform widget library for OpenGL 3.x/DirectX11[12]/Vulkan

NanoGUI NanoGUI is a minimalistic cross-platform widget library for OpenGL 3.x/DirectX11[12]/Vulkan. It supports automatic layout generation, stateful

dalerank 71 Nov 21, 2022
Build performant, native and cross-platform desktop applications with Node.js and CSS like styling. 🚀

NodeGui Build performant, native and cross-platform desktop applications with Node.js and CSS like styling. ?? NodeGUI is powered by Qt5 ?? which make

NodeGui 8.1k Nov 29, 2022
Simple and portable (but not inflexible) GUI library in C that uses the native GUI technologies of each platform it supports.

libui: a portable GUI library for C This README is being written. Status It has come to my attention that I have not been particularly clear about how

Pietro Gagliardi 10.4k Dec 2, 2022
A minimalist andf platform-agnostic application layer for writing graphical applications, with a strong emphasis on simplicity and ease of use.

SlimApp A minimalist(*) and platform-agnostic application layer for writing graphical applications. Available as either a single header file or a dire

Arnon Marcus 33 Oct 5, 2022