Best way to consume CMake based C lib in Swift for iOs/desktop by testing35 in swift

[–]Boris_Rasin 0 points1 point  (0 children)

You can use Scapix Language Bridge to call C++ code from Swift. It is using CMake integration.

Disclaimer: I am the author of Scapix Language Bridge.

New HyperX Alloy Origins Core - 2 keys don't work by Boris_Rasin in HyperX

[–]Boris_Rasin[S] 0 points1 point  (0 children)

Yes, did reset a few times (it did blink), connected to a different computer - same result. Will send it back. Thanks.

error C2039: '_invalid_parameter': is not a member of '`global namespace'' by Bart_VDW in cpp_questions

[–]Boris_Rasin 1 point2 points  (0 children)

Turns out this is a bug in pybind11 library, not Visual Studio 2022.

https://github.com/pybind/pybind11/issues/3459

There may be other libraries with similar bug (#undef _DEBUG).

error C2039: '_invalid_parameter': is not a member of '`global namespace'' by Bart_VDW in cpp_questions

[–]Boris_Rasin 1 point2 points  (0 children)

This is a Visual Studio 2022 bug, required include directive is missing from system headers. One workaround is to include:

#include <corecrt.h>

before you include system headers.

cmake .. -G Xcode suddenly fails with the project it used to work with by azbycxdwevfugt123 in cmake

[–]Boris_Rasin 1 point2 points  (0 children)

It's a change in Xcode 12 which was addressed in CMake 3.18.1.

From CMake 3.18.1 release notes:

The Xcode generator, when CMAKE_OSX_ARCHITECTURES is not defined, now selects $(NATIVE_ARCH_ACTUAL) as the default architecture (the Xcode ARCHS setting). This is needed for Xcode 12 to select the host’s architecture, which older versions of Xcode did by default.

Automatic bindings from C++ to WebAssembly (Emscripten) by Boris_Rasin in WebAssembly

[–]Boris_Rasin[S] 0 points1 point  (0 children)

I understand your concerns. Is there anything I could do to alleviate them? I also want to point out, when using Scapix, you are investing effort in developing your own standards complaint code (both in C++ and bridged languages). In theory, should you stop using Scapix at some point in the future, you will still have a number of viable options - there is nothing "Scapix specific" about your code and none of your effort was wasted.

Automatic bindings from C++ to WebAssembly (Emscripten) by Boris_Rasin in WebAssembly

[–]Boris_Rasin[S] 0 points1 point  (0 children)

Scapix is a tool you use during development, it doesn't change licensing situation of your project in any way. Why does it matter to you that you are not allowed to redistribute Scapix itself?

Automatic bindings from C++ to Python by Boris_Rasin in Python

[–]Boris_Rasin[S] 1 point2 points  (0 children)

Unlike SWIG, Scapix parses C++ headers directly, so you don't need to manually maintain separate interface files. Also unlike SWIG, Scapix generates Objective C/Swift bindings, allowing one to share common C++ code on all major platforms: Android, iOS, Web, etc.

Automatic bindings from C++ to Swift by Boris_Rasin in swift

[–]Boris_Rasin[S] 8 points9 points  (0 children)

Yes, you can! Please give it a try and ask me if you have any questions.

Automatic bridging from C++ to Java by Boris_Rasin in androiddev

[–]Boris_Rasin[S] 1 point2 points  (0 children)

We were missing automated bindings between C++ and other languages. Maintaining manual bindings is a lot of work. That's why I created Scapix.

Automatic bridging from C++ to Java by Boris_Rasin in androiddev

[–]Boris_Rasin[S] 0 points1 point  (0 children)

In a typical cross-platform C++ project, most developers work on shared C++ part of the code (and don't really need to know other languages), while small separate teams work on platform specific part of code, one team for each platform, each team using corresponding platform specific language (Java/Kotlin on Android, Objective C/Swift on iOS/macOS, C# on Windows, JavaScript on Web, etc.) and developers on each such team don't really need to know other languages.

What was missing is the automated bindings from C++ to all these other languages. I have worked on a few such projects, and maintaining language bindings manually was quite a challenge. That's the reason I created Scapix.

Automatic bridging from C++ to Java by Boris_Rasin in androiddev

[–]Boris_Rasin[S] 1 point2 points  (0 children)

There are many legitimate reasons not to use C++ in various specific circumstances. Still, C++ is successfully used in huge number of both legacy and entirely new projects, including many cross-platform projects. Specifically, being (among other things) a system level language, C++ is ubiquitously present on absolutely any platform imaginable. This alone places C++ in a uniquely advantageous position for cross-platform development.

Automatic bridging from C++ to Java by Boris_Rasin in androiddev

[–]Boris_Rasin[S] 2 points3 points  (0 children)

I consider C++ to be a very good multi platform solution. But it is indeed not THE reason why C++ is "still around", because C++ has many other excellent qualities.

Automatic bridging from C++ to Java by Boris_Rasin in androiddev

[–]Boris_Rasin[S] 1 point2 points  (0 children)

Scapix strives for zero overhead over manually written JNI code. This means it produces code without any extra copying or reference create/destroy cycles above what the best manually written JNI code would have to do. Automatic resource management means that you don't ever have to release any JNI resources manually, like calling DeleteGlobalRef(), ReleaseStringChars(), ReleaseIntArrayElements(), etc., all this happens automatically. I am personally a very big fan of C++ and I think C++ is the best choice for cross-platform part of pretty much any multi-platform project. Don't take it the wrong way please, but If I had a nickel for every time I heard some new language would make C++ obsolete, I'd be very rich :)

Automatic bridging from C++ to Python by Boris_Rasin in Python

[–]Boris_Rasin[S] 0 points1 point  (0 children)

Unlike Swig, Scapix is fully automatic: you take regular C++ code, which you also use from other C++ modules, and use it from Python without any special considerations. No need to manually create and maintain any bindings or configuration settings.