You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
cd(@__DIR__)
Pkg.activate(".")
using CxxWrap
write("hello.cpp",
"""#include <string>#include "jlcxx/jlcxx.hpp"std::string greet(){ return "hello, world";}JLCXX_MODULE define_julia_module(jlcxx::Module& mod){ mod.method("greet", &greet);}""")
cxx_include_path =joinpath(CxxWrap.prefix_path(),"include")
julia_include_path =joinpath(Sys.BINDIR,"..","include","julia")
# Compile
cmd =`g++ -shared -fPIC -o libhello.so -I $julia_include_path -I $cxx_include_path hello.cpp`run(cmd)
# Generate the function for Julia@wrapmodule(() ->joinpath(pwd(),"libhello"))
# Call greet and show the result@showgreet()
I think it could be useful to start the documentation/readme with something on this line because of its reproducibility (in Linux at least) and focus on the sole CxxWrap API, without mixing it with the issues on how to compile it with CMake, that could be discussed later on....
Hello, I am trying to replicate the example in the readme on a Linux Ubuntu system with gcc/cmake installed but I am getting the following error:
When I run the command from the terminal I get
make: invalid option -- 'D'
I have tried to remove the D and to use two hypens (
--
), but still no success...By the way, if the examples are given as made from within Julia (using write/run), they would be easier to replicate....
The text was updated successfully, but these errors were encountered: