203 questions
0
votes
2
answers
85
views
error calling C++ string constructor from swift
I am trying to use a c++- style string in swift (C++ interoperability mode). I get an unusual, platform - dependent behaviour. The following function:
public func readLine_CC(_ handle: ...
0
votes
0
answers
150
views
Update Xcode Project to Support Objective-C++/C++ Interop
Recently, in Swift 5.9 I think Apple released support for interoperability between Swift and Objective-C++/C++. I'm currently working on a project that has a lot of Swift, Objective-C and Objective-C++...
3
votes
0
answers
157
views
XCode 16 Swift Interoperability - Function type mismatch, declared as '@convention(thin)
I was using Swift CPP interoperability in XCode 15.
I used the code below to call and pass data from the CPP to the Swift side.
IN CPP:
class VideoPropertiesObserver {
public:
void (*...
3
votes
1
answer
203
views
Return a string array from a C++ function to Fortran
I am struggling with filling a string array in a C++ code. Here is what I tried to do:
main.f90:
program main
implicit none
character(len=100) arr(3)
call get_string_array(arr, 100, 3)
...
1
vote
0
answers
52
views
IntelliJ IDEA not recognizing classes in multi-language Maven project
I have a maven project that contains two subprojects, one contains Clojure source, and the second contains Java source.
This is the top level POM file:
<?xml version="1.0" encoding="...
1
vote
0
answers
85
views
How to create a Fortran Interface for a C function that takes a Fortran function as input using Fortran-C Interoperability?
I have a C library with a function Calculate_Integral that performs definite integration on a given C float function within specified limits and parameters. The signature of this C function looks ...
1
vote
1
answer
213
views
Kotlin interoperability issue with implementing interfaces
I'm working on migrating a web project from Java to Kotlin. During this process I'm faced with compilation issue that can make problems in the future, especially where the existing projects have to ...
1
vote
1
answer
267
views
AndroidView of compose gives:: error No view found for id 0x7f0a01d2
I have been using Jetpack Compose and koin. I am facing error as below
java.lang.IllegalArgumentException: No view found for id 0x7f0a01d2
(com.pyronixhc2.android.app:id/fragment_container_view) for ...
0
votes
1
answer
164
views
Passing and retrieving arbitrary data through a C void* from Fortran
I apologise in advance for the very long message.
I am seeking expertise in order to determine if what I am doing is safe/correct, or if alternatives exists.
I have a C library that can hold a user-...
0
votes
0
answers
278
views
Directly launch SwiftUI Main App in existing UIKit project
I revamp all my view controllers in SwiftUI. But still i am bound to use hostingVC for launching my SwiftUI views from scene delegate like below
let splashVCHostingController = UIHostingController(...
-2
votes
1
answer
355
views
VisionOS Support for Mixing Swift and C++ Interoperability
I'm exploring the possibilities of mixing Swift and C++ for a project that involves VisionOS. The Swift official documentation on Mixing Swift and C++ mentions that C++ interoperability is supported ...
1
vote
2
answers
308
views
Fortran C interface for program containing non-c-interoperable derived type
I have a large Fortran code base for which I am trying to write a Python interface. I decided I would go the Cython route. However, I have derived types that are not C-interoperable. As an example,
...
0
votes
1
answer
112
views
Is there any way to show error msg to user from worker thread in IOS from Appdelegate before root view controller is instantiated/created?
I want to show user a alert in case my application stop before creating a window to show root view controller and i want to do this from a worker thread which will be running in a cpp file and will be ...
1
vote
0
answers
69
views
Receive array from JavaScript in Go
I'm trying to receive an array from JavaScript in my Go code
func knapsackWrapper() js.Func {
knapsackFunc := js.FuncOf(func(this js.Value, args []js.Value) any {
capacity := args[0].Int()
...
3
votes
1
answer
203
views
How can I use a Java library that has a .to method in Kotlin as it assumes I mean to use the infix operator for creating a pair
I am using the Mailgun Java API which is used to send emails. There is a .to method on a message builder that you use to populate the recipient's details. However, when I try to use this it tells me ...
0
votes
0
answers
39
views
Value of Derived Type changes unexpectedly in C-Fortran Interoperability Code
In the following Fortran code which uses C library the value of tol changes unexpectedly. What might be the reason behind this behaviour?
PROGRAM ComplexIntegral
USE farblib
IMPLICIT NONE
TYPE(fmag_t)...
1
vote
1
answer
128
views
C# - F# interoperability, how to get result instead of FSharpFunc
I'm learning F# and would like to write simple F# library which can be consumed from C# application. It works as expected for trivial F# functions e.g.
let Square x = x * x
From C# I can consume it ...
1
vote
2
answers
2k
views
How to use Kotlin parameter callback interoperable with a java class
This question is about the parameter callback in Kotlin, which is by the way a very nice feature from my point of view!
I have a method written in Kotlin like this one which expects a callback as ...
3
votes
2
answers
995
views
Running C++ code asynchronously in a C# program
I wrote some backend code in C++ and I wrote a frontend for it in C#. What I want it to do is run the backend code in the background so I can do other things like update a progress bar, but when I ...
3
votes
1
answer
87
views
How can one access Kotlin's `backtickedFunctions` from Java?
TL;DR:
Is there a simple syntax in java to access kotlins backticked functions such as fun `if`(){...}
Long Version:
In Kotlin, one may write the following class.
class ShapeShifter {
fun speak() {...
1
vote
1
answer
1k
views
Instantiate VHDL entity with 2D array from SystemVerilog
There seems to be very little documentation on how to pass 2D arrays between VHDL and SystemVerilog. I have a port of the following type in VHDL:
package my_package is
type my_array_t is array (...
2
votes
0
answers
535
views
Java/Kotlin Interoperability Limitations
I recently faced a problem regarding interoperability between Java/Kotlin for suspend functions. See my question: How to Override a suspend function in java class. Both the answers seem to agree on ...
1
vote
2
answers
2k
views
How to Override a suspend function in java class
Consider the following interface in kotlin:
LoginRepository.kt
interface LoginRepository {
suspend fun login(): LoginResponse
}
LoginRepo.java
class LoginRepo implements LoginRepository {
...
1
vote
1
answer
605
views
Interoperability issue with COM events in Python and a COM object created in .NET Core 6.0
I am currently trying to create a COM object that is made in C# in .NET Core 6.0. The COM object itself works as intended. The issue that I am having is related to the custom events that the COM ...
0
votes
0
answers
222
views
Interoperability issue in Python/MATLAB with early bound COM object created in C# .NET Core 6
I am creating a COM object in C# .NET Core 6. The COM object has to enable both early and late binding.
I am using Visual Studio and a .NET Core 6 class library, where I created a COM object, a COM ...
2
votes
1
answer
851
views
.NET Core 6.0 COM interoperability issues with Python/Octave
I am currently trying to create a COM object in .NET Core 6. To achieve this I have made a class library and edited the project like this:
C#:
Project file (*.csproj):
<Project Sdk="Microsoft....
2
votes
1
answer
693
views
How to convert Objective-C NSData to Swift Data?
I have a NSData in Objective-C, the NSData has value 0x10, code like bellows:
@implementation BufUtil
+ (NSData *_Nonnull) getOCBuf {
std::vector<uint8_t> sendData = {0x10};
NSData * ...
2
votes
3
answers
1k
views
How to use from C# a Rust function that has another function as a parameter?
The following example illustrates what I am looking to do. The operation function receives a value and a function as a parameter, then returns the execution of the function. So far everything is ...
3
votes
1
answer
245
views
How to access struct members by name in scala native?
From the scala native docs at https://scala-native.readthedocs.io/en/latest/ this is how to access struct members:
type Vec = CStruct3[Double, Double, Double]
val vec = stackalloc[Vec] // allocate c ...
0
votes
1
answer
300
views
Interoperability issues in reading CSV files between Excel, R, and Python
I am working on a project that requires me to independently verify the results of my Python code using another person's R code and a third person's Excel spreadsheet. (Yeesh.) Python was able to read ...
6
votes
2
answers
457
views
How to store Fortran-style long character scalar in C++ data structure
I am working with a legacy Fortran library that requires a character scalar PATH as an argument to the subroutine. The original interface was:
SUBROUTINE MINIMAL(VAR1, ..., PATH)
CHARACTER (LEN=4096) ...
6
votes
1
answer
2k
views
How to wait a js async function from golang wasm?
I have written a little function await in order to handle async javascript function from go:
func await(awaitable js.Value) (ret js.Value, ok bool) {
if awaitable.Type() != js.TypeObject || ...
2
votes
2
answers
478
views
Protected variable in an objective c super class is inaccessible in a swift subclass
@interface MyObjectiveCmainClass
{
@protected
NSMutableArray* thisStringIsInaccessibleInSwiftSubclasses;//this I can't access in swift subclass
}
@property NSString* ...
0
votes
1
answer
3k
views
Decrypt AES/GCM/PKCS5Padding in PHP from Java payload
I want to do a simple encryption from SecureGMC java to be decrypted in PHP using AES/GCM/PKCS5Padding. The data I'm suppose to be decrypting derives from the local bank, which emphasizes on IV_SIZE=...
-3
votes
1
answer
833
views
Golang - Python interoperability
Is there any way to use python libraries like pandas, numpy, scipy, pytorch, ... from Go programming language?
I know that these libraries are not programmed in python but in c, so maybe it is easy to ...
2
votes
0
answers
2k
views
Using .NET Core 3.1 C# dll in C++ project
I'm a software developer in a generalist company. We are a small team and I inherit some 20 year old software (like in a lot of companies I guess)
This software is coded in C / C ++, with Visual ...
0
votes
1
answer
776
views
Passing a ctypes callback function around in C causes memory related problems
I've come across a slightly complicated bug in some C code that I'm porting to Python using ctypes. I've been able to reproduce the problem in a minimal working example and was hoping to get some help ...
1
vote
1
answer
353
views
Access violation when using ctypes callback feature
I'm trying to use the ctypes callback feature to pass a python function to a C function as a function pointer. Here's the C:
typedef void(*f1)();
void function_that_takes_a_function(f1* fn){
...
2
votes
1
answer
1k
views
How to create a C struct from Python using ctypes?
I have a similar problem to this question. I'm basically trying to create C structs from Python using ctypes.
In C I have:
typedef struct Point {
int x;
int y;
} Point ;
Point* makePoint(int ...
1
vote
1
answer
264
views
swift build errors from Objective-C app due to import of Objective-C static library that contains a .swift file
I'm importing an ObjC static lib into my ObjC app but get 95 swift-related build errors.
The ObjC static lib builds ok and contains .m .h and .swift source files.
Swift file imports CoreBluetooth.
...
1
vote
1
answer
224
views
C#/F# interoperability: cannot use C# types in F# code
I have a Visual Studio solution with 3 projects named BaseCs, UseCs and UseFs (all .net core 3.1 libraries).
BaseCs is in C# and has only one source file Definitions.cs containing a series of type ...
0
votes
0
answers
15
views
common javascript api between iOS & Droid / nativescript core
Just looking into Nativescript; the "core" bit of it seems really interesting in that you can call native APIs directly from JS, but it seems it is a completely different API for iOS and ...
0
votes
1
answer
257
views
Should signature of equals be equals(x: Any) or equals(x: AnyRef)
If the equals method in Scala is supposed to implement the original Java boolean Object.equals(Object x) method, I think it should be written def equals(that: AnyRef): Boolean.
IntelliJ generates ...
2
votes
2
answers
592
views
How to make Swift class conform to Objective-C protocol, without exposing it to Objective-C?
I have a Swift class called LoginCoordinator that performs a "Sign In with Apple" request. In order respond to callbacks it conforms to the ASAuthorizationControllerDelegate. Because of this ...
0
votes
1
answer
1k
views
Integrating IBM Rhapsody models into VS 2019
I am here for help in one of my tasks to integrate IBM Rhapsody models into VS 2019 C++ project.Here is what we are trying to do.
Please note: I am not an expert in IBM Rhapsody Systems Engg tool. My ...
1
vote
1
answer
1k
views
Subclassing an Objective C class using Swift in a framework target
I have a framework target in which most of the classes are written in Objective C. Recently we have started introducing Swift files in the code. We make private Objective C files available to swift ...
0
votes
1
answer
271
views
How to provide Java callbacks (with 'void' return type), to Scala?
I've made a library in Scala that has a Java API.
I'd like to provide such a callback (Java):
private static void onB(Stats stats) {
//... implementation does not matter
}
The Scala API has this ...
0
votes
1
answer
211
views
How to deal with the "platform specific dynamic library" problem with uploading to PyPI?
I have a Python package that depends on binaries. I've build the linux version and it is available on PyPI. The key was setting the package_data argument to ensure the *.so files were also uploaded to ...
2
votes
1
answer
830
views
How to use map_indexing_suite from Boost.Python with custom not std object?
Simple example of 'map_indexing_suite' usage is working fine:
class_<map<int, string> >("testMap")
.def(map_indexing_suite<std::map<int, string>, true>())
;
and on ...
1
vote
0
answers
322
views
How to call Scala implicit class method from Java class
I'm a beginner programmer working within a mixed Java/Scala codebase. I have a implicit class in Scala that provides extensions to a class within a third-party dependency. The implicit class is as so:
...