chaos_networking library not found or failed to initialize

Hallo

I am very new to the VRAY SDK. I am using the SDK in a c++ (Visual Studio 2022) and when running the code below, I can only ever get one instance if the renderer to work. The next time I call it, the above error is displayed via an exception. Herewith a code snippet.

void runVRay()
{
VRayInit init(NULL, true);

if (!init)
{
xx = init.getSDKLibraryErrorString();
return;
}
try
{
VRayRenderer renderer;

//renderer.setOnLogMessage(logMessage);
renderer.setInteractiveSampleLevel(2);
renderer.setImageSize(1000, 1000);

// Start rendering.
renderer.startSync();

// Wait for rendering to end.
renderer.waitForRenderEnd();
}
catch (VRayException& e)
{
GTRACE(“VRay exception: %s”, e.what());
//// chaos_networking library not found or failed to initialize - this is the message received
}
catch (…)
{
}
}

What I am doing wrong?

Anton Heymann

Hallo

I resolved the issue, by only using one instance of VRayInit (which the documentation do mention). I needed to re-arrange how VRinit was created.

I do however have a further issue, related to using pre compiled headers in the project, but will raise a seperate issue about that.

Anton Heymann

Hi Anton,

I was about to reply but you already figured it out. Yes, there should be one and only one instance of VRayInit for the whole process lifetime (or at least as long as V-Ray is being used).