I have been trying to replicate the example given in a different post, to which I can’t link, but here’s the relative URL: /t/can-someone-provide-a-simple-example-of-using-cxxwrap/115908/6
I’m on Windows (because there doesn’t seem to be a Debian package), and I’ve installed the MinGW compiler, which has successfully compiled a simple “Hello World” program.
I get a multitude of error messages ascertaining the lack of certain references (of the type undefined reference to `__imp_jl_compute_fieldtypes' or similar).
The file that I’m trying to compile looks like this:
Thanks, I (vaguely) knew of that, but on Windows, I got the Chocolatey Julia package, which is being kept up to date automatically, whence I’m working under Windows.
A very bad reason to use Windows. I at least often need different versions of Julia, and with juliaup you can install any number of versions in parallel and switch easily per project. And programming on Linux is so much faster and more convenient, in particular if it comes to C++. But also Julia is much faster on Linux, building system images works in parallel on Linux (not on Windows), and operations on many small files are also much faster on Linux.
I can confirm that your code and the one from the post you referred to also does not work for me on Windows. The CMake example from the CxxWrap.jl github page did work without any issues though.
I’m certainly no expert on these matters, but it seems on Windows you need to explicitly link to the binaries:
It also supports Windows (and I assume also 1.11, it’s at least tested up to 1.10).
I’m on Linux, not Windows, so I can’t test, but assumed calling from Julia to C++ also worked with CppWrap (at least no less than from Linux, major upgrades have sometimes broken CxxWrap, I think so far always fixed, but haven’t looked into if .11 is an issue).
Well, you should use the folder where Julia is installed on your machine. Similar to in @sylvaticus 's post, you can obtain this via Sys.BINDIR and a modification where you replace bin by include\julia.
Same for the CxxWrap.jl directory, via
using CxxWrap
CxxWrap.prefix_path()
with \bin and \include appended (e.g. via joinpath).