compile and run c++ code runtime

后端 未结 2 966
南方客
南方客 2021-01-25 15:26

Does anyone know how to compile your c++ code wich you write while your program is already running?

And later i would like to run that code.

I want to do this be

2条回答
  •  余生分开走
    2021-01-25 15:59

    You have to call the compiler to compile and link the user-entered code. This has to be made either into an executable that is then run from another process you create, or as a library that you dynamically load and call.

    How this is done is different on POSIX platforms (like Linux and OSX) and Windows.

提交回复
热议问题