SDK compatibility issues in VS2019 C++ project with std::string

Discussion related to the LuxCore functionality, implementations and API.
MMatteini
Posts: 6
Joined: Fri Mar 19, 2021 10:55 am

Re: SDK compatibility issues in VS2019 C++ project with std::string

Post 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:

Code: Select all

test1.prop1[0] => aa
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 8-) 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!
Ernest
Posts: 9
Joined: Sun Mar 31, 2019 11:30 am

Re: SDK compatibility issues in VS2019 C++ project with std::string

Post 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
Settings.PNG
This should hopefully solve your problem.
MMatteini
Posts: 6
Joined: Fri Mar 19, 2021 10:55 am

Re: SDK compatibility issues in VS2019 C++ project with std::string

Post by MMatteini »

Ernest wrote: Tue Mar 23, 2021 4:28 pm /D_ITERATOR_DEBUG_LEVEL=0
yep, this also solve the problem, thank you!
acasta69
Developer
Developer
Posts: 472
Joined: Tue Jan 09, 2018 3:45 pm
Location: Italy

Re: SDK compatibility issues in VS2019 C++ project with std::string

Post 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.
Support LuxCoreRender project with salts and bounties

Windows 10 64 bits, i7-4770 3.4 GHz, RAM 16 GB, GTX 970 4GB v445.87
Post Reply