T
T
The_Nex2019-01-28 18:28:01
C++ / C#
The_Nex, 2019-01-28 18:28:01

C++. Including and linking compiled files into a running instance of the program?

Good day to all.
I must say right away that I have been familiar with C ++ for about 2 months.
I am developing a 2D game engine (on SFML + Box2D with JSON & ImGUI included). At the end of the development, the question arose of developing various projects (games) on one instance of the engine. The solution, of course, is straightforward - the core of the engine in the form of a dynamic library. The editor is an application based on this core.
And here the question arose of how to get the ability to use a compiled file (script, also C ++) in the editor's runtime? And is it right to think that if the kernel dynamic library is loaded in memory, then running a script that somehow links to the kernel (and to its certain knowledge base about scripts) will give the desired effect in the editor (which links to the same copy of the kernel in RAM)?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
V
Vadim Mamonov, 2019-01-28
@dikysa

In C#, this is handled through reflection.
Maybe in c++ reflection will allow you to do this? Read about her.
Or use dynamic libraries.

T
The_Nex, 2019-01-28
@The_Nex

As a possible option (the question is still open!):
The editor application on command compiles the dyne. library from the game scripts and relinks to it (the very inclusion of the script in the editor).

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question