Include ROOT 6.22 in Visual Studio 2019

Good, I’ll look into them. Thank you again for your kind help!

All the best,
Filippo

No problem. Let me know if you have more questions

Good news: today it works!
Bad news: I have no clue why

I started again to work the GUI alone (I had to redo it because I had messed up with the code). So, New Project -> C++ CLR Empty Project (.NET Framework).
Turns out that some project option are different, so I try to load the libraries and add #include <TROOT.h> and #include <TF1.h>.
I even tried to define a TF1 in the main function. It works!

I’m looking now at the differences between the two projects, the one who compiles (A) and the one who does not (B). I thought it might be interesting for you to check the differencies as well:

Configuration Properties

C++/CLI Properties

A
Common Language Runtime Support: Common Language Runtime Support (/clr)
.NET Target Framework Version: v4.6.1
Enable Managed Incremental Build: Yes

B
Common Language Runtime Support: No Common Language Runtime Support
.NET Target Framework Version:
Enable Managed Incremental Build: No

C/C++

General

A
Debug Information Format: Program Database (/Zi)
Support Just My Code for Debugging: No
Common Language Runtime Support: Common Language Runtime Support (/clr)

SDL checks:

B
Debug Information Format: Program Database for Edit And Continue (/ZI)
Support Just My Code for Debugging: Yes
Common Language Runtime Support:

SDL checks: Yes (/sdl)

Preprocessor:

A
Preprocessor Definitions: WIN32;_DEBUG;%(PreprocessorDefinitions)

B
Preprocessor Definitions: WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)

Code Generation:

A
Enable Minimal Rebuild:
Enable C++ Exceptions: Yes with SEH Exception (/EHa)
Basic Runtime Checks: Default
Runtime Library: Multi-threaded Debug DLL (/MDd) <- fails if I change it to MD

B
Enable Minimal Rebuild: No (/Gm-)
Enable C++ Exceptions: Yes (/EHsc)
Basic Runtime Checks: Both (/RTC1)
Runtime Library:

Advanced:

A
Calling Convention:

B
Calling Convention: __cdecl(/Gd)

Linker

General:

A
Ignore Import Library: Yes

B
Ignore Import Library: No

Manifest Tool

A
Output Manifest File:
Manifest Resource File:

B

Output Manifest File: (IntDir)(TargetName)(TargetExt).embed.manifest Manifest Resource File: (IntDir)(TargetName)(TargetExt).embed.manifest.res

Any idea on what might be the culprit(s)? Or should I try and change these parameters one by one?

No idea, I’ll have to set-up a project myself and check. Will do it next week and I’ll let you know