Allegro CL: creating a standalone binary? - build

I want to save a third-party lisp library to a standalone binary? Is this possible to do in Allegro CL (I can't seem to find anything about this in the documentation)?

Looks like Allegro has some documentation on the subject here and here depending on what you are trying to do.
You might also want to check out CLiki's page on the subject if you want to use any other implementations.

Related

Using a UWP library in a C++ console app

I understand that this isn't a really common use case, but my team has built a C++ UWP static library and I'd like to link it into an existing C++ console app. However, I can't find anywhere that says that this is possible, or even anyone that's asked this question. If I try naively adding a reference, it just says that "the two platforms are incompatible" (I'd imagine one is targeting UWP and the other just targets Windows).
Does anyone know if this is possible? Would save me a pretty big rewrite.
Thanks!
If your library is not portable is not possible.
If you have access code to the code of the UWP library try to port al the code to portable library and try it again.
Best Regards

Link c++ object during runtime?

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()

How to call Matlab functions from Visual studio mfc project?

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().

Designing IDE in Qt; is there an already made compiler package I could use?

I am designing a simple IDE just as a side project.
I don't want to design a compiler for something that is just a side project that I will only be working on ever once in awhile.
So, is there some sort of pre-made, open source package I could use and link with my IDE?
Right now all I care about compiling is c and c++ but I want to add support for other languages (Java, C#, Perl, etc...) at some point, if I'm still working on the project.
Thanks. Again, just to clarify, I am looking for a c/c++ compiler(compilers for other languages would also help) to link with my Qt made IDE project to compile the code written in my application.
You just need to call command line GCC and capture output (stdout) to display in your application window.
It is simply a matter of invoking the desired compiler as an external process. You will need to pass the correct command line arguments, and presumably capture the output of the compiler and display it to the user in the GUI.
Since you are using Qt, I would suggest looking at QProcess. QProcess provides a simple and platform-neutral way of invoking a process and communicating with it.
Apart from that, all you need is a way of generating the correct command line arguments for each compiler you wish to integrate with your IDE.

cross compiling c++ to iphone arm

I've scanned over the (outdated) article that is the first hit on google about ARM cross-compiling. I've also seen the article about compiling OpenCV to the iPhone and the general cross compiling instructions there. My question is can I call the apparently already configured gcc/g++ in the iPhone developer package (which I already have installed) like in the latter article? A lot of the OpenCV stuff seems superfluous to my needs.
If I can, what would the calls look like? Should I create a Makefile to make things easier?
Also, I need -lncurses library. Can I call them like normal, or do I need to specify it's path because I'm not calling the default gcc/g++?
If you're using the official SDK, compiling C++ for the iPhone is as simple as including cpp files in your project and hitting "build". Of course you can still go in and tweak the compiler switches - well, most of them.
As for ncurses, I'm not sure why you'd want to use that - but the only limitation you should have is that you can't link against dynamic libraries - so you'd have to linked the object code in.
A script that you can use as a basis for crosscompiling your libraries for iOs development.
Unfortunately the [n]curses package is not going to do you any good for the iPhone.
[n]curses is designed to be used with a terminal window. This is just not available for the iPhone you will need to learn how to use Coco to develop a GUI interface.