question

Lucas Klein avatar image
0 Likes"
Lucas Klein asked Phil BoBo commented

Running compiled model C++ in a pc without Visual Studio

Dear all,

I built a model in FlexSim using some functions in C++ in a computer that have Visual Studio 2013, the model compiles and run normally. Then I copied this model to another computer that does not have Visual Studio, when I pressed "Run", FlexSim asked me to compile my model first before run, and it could not be able to compile because detected some syntax errors, while the model in the other computer compiled with no problems.

How can I save a model already compiled in FlexSim to just reset and run in a computer without Visual Studio? There is any way, or it's needed to have VS installed to use C++ functions in a model?

c++functionsvisual studiocompile
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

1 Answer

Phil BoBo avatar image
2 Likes"
Phil BoBo answered Phil BoBo commented

If you want to distribute compiled C++ code, you need to build that code into a DLL that you distribute alongside your model.

See Creating DLLs that attach to Flexsim

· 6
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

Lucas Klein avatar image Lucas Klein commented ·

In case, I am using a big code that is executed many often, transforming it to DLL could increase the performance of the model, or using FlexScript I have a better performance?

1 Like 1 ·
Phil BoBo avatar image Phil BoBo ♦♦ Lucas Klein commented ·

You'll have better performance compiled into a DLL.

2 Likes 2 ·
Lucas Klein avatar image Lucas Klein Phil BoBo ♦♦ commented ·

@phil.bobo I tried to use DLL to execute my code, but when I tested the performance in the FlexScript Code Profile, it executed slowly than using FlexScript, follow attached the print of Code Profile log between FlexScript and DLL. The code changed to DLL was the "pintar_grupos". Also I'm attaching the code in a blank model for any eventual consults. code-model.fsm

0 Likes 0 ·
code-model.fsm (14.4 KiB)
dll-report.png (64.5 KiB)
Show more comments