I'm currently working on a project, where I need to include few of Octave functions (exactly Griddata). My question is, if it's possible to use my octave code as a c++ library, which I just can include to my Objective-C project and give the input to the library, which computes the result and return the output to my project.
I already searched the web, but I couldn't find anything :/
The function i'm looking for is: https://octave.sourceforge.io/octave/function/griddata.html
Thanks
You can embed the Octave interpreter into your program and then call your Octave-function using octave::feval.
Related
I have a project written in C++ and I want to call some functions of it from Maple. Searching about possible solutions, I found the one to create .dylib from the C++ files and then call this .dylib from Maple.
I was able to create a .dylib from a single C++ file and use its functions from Maple, following this: How do I create a dynamic library (dylib) with Xcode?
Now, I'm wondering if I can do it with a full project. I saw that maybe I could do it using Xcode (I have the version 6.4), but I don't know how...
Someone could help me? Any help is appreciate, thank you in advance!
maybe the title is not the most helpful but wasn't sure how to put it with a few words.
So this is my problem.
I have some C++ projects in Eclipse and I want to use for a part of my project some Julia code.
I have downloaded and installed properly the latest version of Julia on my machine and what I want to do is embed Julia inside my C++ project in Eclipse, so that I will be able to write directly some julia code inside the C++ project.
Such an option is possible and there is this guidance on how to do it.
I do properly in eclipse both the path to include julia.h and the julia library, and I can actually build the project, but when I try to run I receive the following error:
"System image file "/home/kostav/workspace/juli/Debug/../lib/x86_64-linux-gnu/julia/sys.ji" not found
"
Now this file does exist and its path is included in Eclipse, so I really don't understand why I do receive this error and what should I do in order to fix it.
Any suggestion would be really helpful to me.
jl_init_with_image
jl_init_with_image("pathtosysji", "sys.ji");
The path must be the abs path.
ie: /home/kostav/workspace/juli/Debug/../lib/x86_64-linux-gnu/julia/sys.ji
I'm trying to write my first game in c++, and I want it to dynamically load everything from files. This includes the enemies, and I was wondering if there was a way to dynamically include their code at runtime, instead of linking the on compile, so that the levels are easily interchangeable. Lua might be an option but I have no clue where to start, and dll seems to be Windows-only (and I wouldn't know where to start there anyway). Can anyone help with this?
tl;dr I want to link in code to my c++ game at runtime.
For the Lua approach you first need to choose the version first. Right now there is the major version 5.1 and 5.2. My previous work was using 5.1 and for my new project I decided to update to 5.2, however I found that my favorite script wrapping tool (SWIG) does not work with 5.2. Just something to decide at the beginning, because you do not want to get a version working and then have to change it.
Lua comes with makefile build environment. My first experience of trying to build on Windows was a bit of a nightmare, did not appear to just run out-of-the-box, so I opted to create my own Visual Studio project at the time, and just include all the .C files in the project. There are two files which need to selectively included/excluded depending on how you intend to compile: lua.c and luac.c. If you are planning to embed Lua in your app, then exclude both of these files; they both contain a main() function and are designed to build console apps. Include all the rest of the C files in your project.
You should be able to compile easy from this point.
When you include the headers of Lua, keep in mind that the functions are C functions so if you are including them from C++ you need to wrap the file inclusion inside of: extern "C" {} - example: C++ Lua 5.1 Issue
Wrapping your interfaces in another topic and there are lots of resources available. My favorite is SWIG but there are lots of options, including hand coding the conversion of your C/C++ -> LUA -> C/C++ code. Would recommend just focusing on getting the first part working first, get the interpreter embedded so that you can run a "hello, world!" script from Lua inside your app.
So going by your requirement of crossplatform use and dynamic linking, what you're probably looking for is an environment like QT which has QLibrary: https://stackoverflow.com/a/9675063/453673
But https://softwareengineering.stackexchange.com/questions/88685/why-arent-more-desktop-apps-written-with-qt
MingW is the open-source equivalent for Visual C++, so it can help you writing code for Windows (though if I had a choice, I'd directly use Visual C++). The way dll's are loaded in Windows is somewhat similar to the way they're loaded in Linux, so you'll be able to write code with #ifdef's to do conditional compilation. I've written one such program a couple of years back.
To load a shared library(always with .so as suffix) under Linux, you could use dlopen(), dlsym() and dlclose()
I'm currently working on a project for my university, where I have to develop an iOS app. For this I would like to work with octave. My question is, if it's possible to use my octave code as a c++ library without having octave installed, which I just can include to my Objective-C project and give the input to the library, which computes the result and return the output to my project.
I already searched the web, but I couldn't find anything :/
Best regards,
Carsten
What I have done is following the guidline in this
website
Now, I want to use some functions like rgb2gray() and imresize()... but I dont know how to use them, or I dont know which header file should I include in my project?
I have tried other way by creating a C++ shared-library in Matlab, then used it in VS 2012, but I could not add the DLL file to my project when I added new references. it is like that:
Please help me!
thanks in advance.
If you really want to call Matlab inside visual-studio, there are two ways:
Distribute MATLAB into independent shared library: check out my blog-post on how to do this (with detail steps and example).
Call MATLAB Engine directly: Refer to another blog of mine for more info.
On the other hand, it seems that you don't need to call Matlab to achieve your goal. OpenCV library will offer functions similar to rgb2gray() and imresize().