Page 2 of 2
Re: SDK compatibility issues in VS2019 C++ project with std::string
Posted: Tue Mar 23, 2021 4:02 pm
by MMatteini
acasta69 wrote: ↑Tue Mar 23, 2021 10:14 am
I also tried and it's working here, both VS2017 and VS2019.
Code:
Code: Select all
Property prop("test1.prop1", string("aa"));
cout << "test1.prop1[0] => " << prop.Get<string>(0) << "\n\n";
Output:
Ok, i got some improvements, now i'm getting the same results
The main thing was that when creating a new project in VS2017/VS2019, removing the _DEBUG definition was not enough to match runtimes, you also have to go into project properties and set
Configuration properties -> Advanced -> Use Debug Libraries to
No
The suggestion from Dave :
Dade wrote: ↑Mon Mar 22, 2021 4:49 pm
do you get the same error if you use something like "string("aa")" instead of "aa" ?
Solved the rest of issues so that
Code: Select all
Property prop("test1.prop1", string("aa"));
works fine while the line from the demo:
Code: Select all
Property prop("test1.prop1", "aa");
does not work.
So it looks like i can start my integration now
the only thing that would be left would be to re-compile a proper debug version of luxcore to be used with the debug configuration.
To fix your release so that it works correctly with /debug it should be a matter of adding _DEBUG and that "Use Debug Libraries" flag to the project...
Thanks again for your help!
Re: SDK compatibility issues in VS2019 C++ project with std::string
Posted: Tue Mar 23, 2021 4:28 pm
by Ernest
Hello MMatteini,
found the little missing piece to get your sample running. Please add the following to the compiler command line:
/D_ITERATOR_DEBUG_LEVEL=0
This should hopefully solve your problem.
Re: SDK compatibility issues in VS2019 C++ project with std::string
Posted: Tue Mar 23, 2021 4:56 pm
by MMatteini
Ernest wrote: ↑Tue Mar 23, 2021 4:28 pm
/D_ITERATOR_DEBUG_LEVEL=0
yep, this also solve the problem, thank you!
Re: SDK compatibility issues in VS2019 C++ project with std::string
Posted: Tue Mar 23, 2021 8:04 pm
by acasta69
MMatteini wrote: ↑Tue Mar 23, 2021 4:02 pm
The main thing was that when creating a new project in VS2017/VS2019, removing the _DEBUG definition was not enough to match runtimes, you also have to go into project properties and set
Configuration properties -> Advanced -> Use Debug Libraries to
No
Your project failed as you described also here. Then I noticed that it was compiled with /MDd. What you describe above should be same as using /MD, which solves that problem.
MMatteini wrote: ↑Tue Mar 23, 2021 4:02 pm
To fix your release so that it works correctly with /debug it should be a matter of adding _DEBUG and that "Use Debug Libraries" flag to the project...
I will look into that. What I don't know in this moment is if that's going to affect also the other LuxCore binary dependencies.
If we have to provide a debug version of all compiled dependencies, it's going to be a lot of stuff to add.