Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VS2012 Spout2 compile error #5

Closed
alfaleader opened this issue Apr 27, 2015 · 4 comments
Closed

VS2012 Spout2 compile error #5

alfaleader opened this issue Apr 27, 2015 · 4 comments

Comments

@alfaleader
Copy link

Hi

When compiling Spout on VS2012 I get this error:
"1>..\SpoutGLDXinterop.cpp(433): error C2664: 'errno_t wcstombs_s(size_t *,char *,size_t,const wchar_t *,size_t)' : cannot convert parameter 4 from 'CHAR [128]' to 'const wchar_t *'
1> Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast"

Can be solved with
MultiByteToWideChar(CP_ACP, 0, p, -1, (LPWSTR)pwcsName, nChars);
;
(But don't know if it is because a bad conversion to 2012 or not.

@sheridanis
Copy link

from memory you need to change your project to use multi code, either that or to not use multicode

@leadedge
Copy link
Owner

Yes I came across this recently with another project and fixed it by casting. For this particular project it was due to to the "Configuration properties -> character set" not being set to anything. Other Spout projects are set to Unicode. In this project the rest of the code causes errors for Unicode so it has to be left not set, but your project might work OK with Unicode.

For some reason wcstombs_s does not like "DisplayDevice.DeviceKey" which is WCHAR but it works OK with "adapterinfo.Description" which is also WCHAR.

In fact for your project you could try to leave out the "GetAdapterInfo" function. I am working on a release that removes the auto-detection of Intel graphics because this does not seem to work as expected and is causing problems. The new release will have an installer with options for DirectX 9 or DirectX 11.

Then in "OpenDirectX" make the following change :

 ---

// Open DX11    
if(OpenDirectX11()) {
    bUseDX9 = false; // Set to indicate intialized as DX11
    // Return here if OK - Intel auto detection removed 21.04.15
    return true;
}

return false;


/*
    // Get adapter info using both DirectX and Windows functions

comment out the rest

----

After that you should specifically set to use DirectX 9 or DirectX 11 with SetDX9() because DirectX 9 will be the default for the next release. At the moment the default is DirectX 11. Everything except the Unity plugin should work with DirectX9.

@alfaleader
Copy link
Author

Thx guys!

@leadedge
Copy link
Owner

leadedge commented Apr 3, 2016

Changes implemented for 2.005

@leadedge leadedge closed this as completed Apr 3, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants