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

Compiling issues on Windows (Visual Studio) #51

Open
Memorix101 opened this issue Jan 15, 2017 · 4 comments
Open

Compiling issues on Windows (Visual Studio) #51

Memorix101 opened this issue Jan 15, 2017 · 4 comments

Comments

@Memorix101
Copy link

Memorix101 commented Jan 15, 2017

see title

#19

Output

Severity	Code	Description	Project	File	Line	Suppression State
Error	C2664	'int WideCharToMultiByte(UINT,DWORD,LPCWCH,int,LPSTR,int,LPCCH,LPBOOL)': cannot convert argument 3 from 'const char *' to 'LPCWCH'	cAudio	c:\users\memor\desktop\caudio-master\caudio\include\cAudioString.h	53	
Error	C2664	'int MultiByteToWideChar(UINT,DWORD,LPCCH,int,LPWSTR,int)': cannot convert argument 5 from 'char *' to 'LPWSTR'	cAudio	c:\users\memor\desktop\caudio-master\caudio\include\cAudioString.h	64	
Error	C2664	'int WideCharToMultiByte(UINT,DWORD,LPCWCH,int,LPSTR,int,LPCCH,LPBOOL)': cannot convert argument 3 from 'const char *' to 'LPCWCH'	cAudio	C:\Users\memor\Desktop\cAudio-master\cAudio\include\cAudioString.h	53	
Error	C2664	'int MultiByteToWideChar(UINT,DWORD,LPCCH,int,LPWSTR,int)': cannot convert argument 5 from 'char *' to 'LPWSTR'	cAudio	C:\Users\memor\Desktop\cAudio-master\cAudio\include\cAudioString.h	64	
Error	C2664	'int WideCharToMultiByte(UINT,DWORD,LPCWCH,int,LPSTR,int,LPCCH,LPBOOL)': cannot convert argument 3 from 'const char *' to 'LPCWCH'	cAudio	c:\users\memor\desktop\caudio-master\caudio\include\cAudioString.h	53	
Error	C2664	'int MultiByteToWideChar(UINT,DWORD,LPCCH,int,LPWSTR,int)': cannot convert argument 5 from 'char *' to 'LPWSTR'	cAudio	c:\users\memor\desktop\caudio-master\caudio\include\cAudioString.h	64	
Error	C2664	'int WideCharToMultiByte(UINT,DWORD,LPCWCH,int,LPSTR,int,LPCCH,LPBOOL)': cannot convert argument 3 from 'const char *' to 'LPCWCH'	cAudio	c:\users\memor\desktop\caudio-master\caudio\include\cAudioString.h	53	
Error	C2664	'int MultiByteToWideChar(UINT,DWORD,LPCCH,int,LPWSTR,int)': cannot convert argument 5 from 'char *' to 'LPWSTR'	cAudio	c:\users\memor\desktop\caudio-master\caudio\include\cAudioString.h	64	
Error	C2664	'int WideCharToMultiByte(UINT,DWORD,LPCWCH,int,LPSTR,int,LPCCH,LPBOOL)': cannot convert argument 3 from 'const char *' to 'LPCWCH'	cAudio	C:\Users\memor\Desktop\cAudio-master\cAudio\include\cAudioString.h	53	
Error	C2664	'int MultiByteToWideChar(UINT,DWORD,LPCCH,int,LPWSTR,int)': cannot convert argument 5 from 'char *' to 'LPWSTR'	cAudio	C:\Users\memor\Desktop\cAudio-master\cAudio\include\cAudioString.h	64	
Error	C2664	'int WideCharToMultiByte(UINT,DWORD,LPCWCH,int,LPSTR,int,LPCCH,LPBOOL)': cannot convert argument 3 from 'const char *' to 'LPCWCH'	cAudio	C:\Users\memor\Desktop\cAudio-master\cAudio\include\cAudioString.h	53	
Error	C2664	'int MultiByteToWideChar(UINT,DWORD,LPCCH,int,LPWSTR,int)': cannot convert argument 5 from 'char *' to 'LPWSTR'	cAudio	C:\Users\memor\Desktop\cAudio-master\cAudio\include\cAudioString.h	64	
Error	C2664	'int WideCharToMultiByte(UINT,DWORD,LPCWCH,int,LPSTR,int,LPCCH,LPBOOL)': cannot convert argument 3 from 'const char *' to 'LPCWCH'	cAudio	C:\Users\memor\Desktop\cAudio-master\cAudio\include\cAudioString.h	53	
Error	C2664	'int MultiByteToWideChar(UINT,DWORD,LPCCH,int,LPWSTR,int)': cannot convert argument 5 from 'char *' to 'LPWSTR'	cAudio	C:\Users\memor\Desktop\cAudio-master\cAudio\include\cAudioString.h	64	
Error	C2664	'int WideCharToMultiByte(UINT,DWORD,LPCWCH,int,LPSTR,int,LPCCH,LPBOOL)': cannot convert argument 3 from 'const char *' to 'LPCWCH'	cAudio	c:\users\memor\desktop\caudio-master\caudio\include\cAudioString.h	53	
Error	C2664	'int MultiByteToWideChar(UINT,DWORD,LPCCH,int,LPWSTR,int)': cannot convert argument 5 from 'char *' to 'LPWSTR'	cAudio	c:\users\memor\desktop\caudio-master\caudio\include\cAudioString.h	64	
Error	C2664	'int WideCharToMultiByte(UINT,DWORD,LPCWCH,int,LPSTR,int,LPCCH,LPBOOL)': cannot convert argument 3 from 'const char *' to 'LPCWCH'	cAudio	C:\Users\memor\Desktop\cAudio-master\cAudio\include\cAudioString.h	53	
Error	C2664	'int MultiByteToWideChar(UINT,DWORD,LPCCH,int,LPWSTR,int)': cannot convert argument 5 from 'char *' to 'LPWSTR'	cAudio	C:\Users\memor\Desktop\cAudio-master\cAudio\include\cAudioString.h	64	
Error	C2664	'int WideCharToMultiByte(UINT,DWORD,LPCWCH,int,LPSTR,int,LPCCH,LPBOOL)': cannot convert argument 3 from 'const char *' to 'LPCWCH'	cAudio	C:\Users\memor\Desktop\cAudio-master\cAudio\include\cAudioString.h	53	
Error	C2664	'int MultiByteToWideChar(UINT,DWORD,LPCCH,int,LPWSTR,int)': cannot convert argument 5 from 'char *' to 'LPWSTR'	cAudio	C:\Users\memor\Desktop\cAudio-master\cAudio\include\cAudioString.h	64	
Error	C2664	'int WideCharToMultiByte(UINT,DWORD,LPCWCH,int,LPSTR,int,LPCCH,LPBOOL)': cannot convert argument 3 from 'const char *' to 'LPCWCH'	cAudio	c:\users\memor\desktop\caudio-master\caudio\include\cAudioString.h	53	
Error	C2664	'int MultiByteToWideChar(UINT,DWORD,LPCCH,int,LPWSTR,int)': cannot convert argument 5 from 'char *' to 'LPWSTR'	cAudio	c:\users\memor\desktop\caudio-master\caudio\include\cAudioString.h	64	
Error	C2664	'int WideCharToMultiByte(UINT,DWORD,LPCWCH,int,LPSTR,int,LPCCH,LPBOOL)': cannot convert argument 3 from 'const char *' to 'LPCWCH'	cAudio	c:\users\memor\desktop\caudio-master\caudio\include\cAudioString.h	53	
Error	C2664	'int MultiByteToWideChar(UINT,DWORD,LPCCH,int,LPWSTR,int)': cannot convert argument 5 from 'char *' to 'LPWSTR'	cAudio	c:\users\memor\desktop\caudio-master\caudio\include\cAudioString.h	64	
Error	C2664	'int WideCharToMultiByte(UINT,DWORD,LPCWCH,int,LPSTR,int,LPCCH,LPBOOL)': cannot convert argument 3 from 'const char *' to 'LPCWCH'	cAudio	c:\users\memor\desktop\caudio-master\caudio\include\cAudioString.h	53	
Error	C2664	'int MultiByteToWideChar(UINT,DWORD,LPCCH,int,LPWSTR,int)': cannot convert argument 5 from 'char *' to 'LPWSTR'	cAudio	c:\users\memor\desktop\caudio-master\caudio\include\cAudioString.h	64	
Error	C2664	'int WideCharToMultiByte(UINT,DWORD,LPCWCH,int,LPSTR,int,LPCCH,LPBOOL)': cannot convert argument 3 from 'const char *' to 'LPCWCH'	cAudio	c:\users\memor\desktop\caudio-master\caudio\include\cAudioString.h	53	
Error	C2664	'int MultiByteToWideChar(UINT,DWORD,LPCCH,int,LPWSTR,int)': cannot convert argument 5 from 'char *' to 'LPWSTR'	cAudio	c:\users\memor\desktop\caudio-master\caudio\include\cAudioString.h	64	
Error	C2664	'int WideCharToMultiByte(UINT,DWORD,LPCWCH,int,LPSTR,int,LPCCH,LPBOOL)': cannot convert argument 3 from 'const char *' to 'LPCWCH'	cAudio	c:\users\memor\desktop\caudio-master\caudio\include\cAudioString.h	53	
Error	C2664	'int MultiByteToWideChar(UINT,DWORD,LPCCH,int,LPWSTR,int)': cannot convert argument 5 from 'char *' to 'LPWSTR'	cAudio	c:\users\memor\desktop\caudio-master\caudio\include\cAudioString.h	64	
Error	C2664	'int WideCharToMultiByte(UINT,DWORD,LPCWCH,int,LPSTR,int,LPCCH,LPBOOL)': cannot convert argument 3 from 'const char *' to 'LPCWCH'	cAudio	c:\users\memor\desktop\caudio-master\caudio\include\cAudioString.h	53	
Error	C2664	'int MultiByteToWideChar(UINT,DWORD,LPCCH,int,LPWSTR,int)': cannot convert argument 5 from 'char *' to 'LPWSTR'	cAudio	c:\users\memor\desktop\caudio-master\caudio\include\cAudioString.h	64	
Error	C2664	'int WideCharToMultiByte(UINT,DWORD,LPCWCH,int,LPSTR,int,LPCCH,LPBOOL)': cannot convert argument 3 from 'const char *' to 'LPCWCH'	cAudio	c:\users\memor\desktop\caudio-master\caudio\include\cAudioString.h	53	
Error	C2664	'int MultiByteToWideChar(UINT,DWORD,LPCCH,int,LPWSTR,int)': cannot convert argument 5 from 'char *' to 'LPWSTR'	cAudio	c:\users\memor\desktop\caudio-master\caudio\include\cAudioString.h	64	
Error	C2664	'int WideCharToMultiByte(UINT,DWORD,LPCWCH,int,LPSTR,int,LPCCH,LPBOOL)': cannot convert argument 3 from 'const char *' to 'LPCWCH'	cAudio	c:\users\memor\desktop\caudio-master\caudio\include\cAudioString.h	53	
Error	C2664	'int MultiByteToWideChar(UINT,DWORD,LPCCH,int,LPWSTR,int)': cannot convert argument 5 from 'char *' to 'LPWSTR'	cAudio	c:\users\memor\desktop\caudio-master\caudio\include\cAudioString.h	64	
````
@bkeys
Copy link
Contributor

bkeys commented Mar 11, 2017

I can concur that this also happens on Linux when you try to cross compile cAudio. It would be really nice to see this feature fixed.

@PucklaJ
Copy link

PucklaJ commented Apr 12, 2017

Yes, I am getting the same error. I have changed a few things
`static const char* toUTF8(const cAudioString& str)
{
static int id = 0;
static char buffer[8][1024];
id = ++id & 0x7;

    std::wstring widestr(str.begin(),str.end());
    
    int buff_size = WideCharToMultiByte(CP_UTF8, 0, widestr.c_str(), (int)(str.size() < 1023 ? str.size() : 1023), buffer[id], 1023, 0, false);
    buffer[id][buff_size] = 0;
    buffer[id][1023] = 0;
    return buffer[id];
}

static cAudioString fromUTF8(const char* str)
{
    int str_len = (int)strlen(str);
    int buf_size = MultiByteToWideChar(CP_UTF8, 0, str, str_len, 0, 0);
    cAudioString s(buf_size, L'\0');
    std::wstring widestr(s.begin(),s.end());
    MultiByteToWideChar(CP_UTF8, 0, str, str_len, &widestr[0], buf_size);
    s = std::string(widestr.begin(),widestr.end());
    return s;
}`

I convert the cAudioString to a std::wstring. I compiles. but the examples crash. I have also a problem that __try and __except aren't defined. I have looked up the except.h file and there aren't __try and __except.

@netpipe
Copy link

netpipe commented Jun 6, 2017

there is a fork of a 2.3.0 branch that compiles nicely, my only issue was with 64 bit openal sdk dll's was wondering if caudio could incorperate freealut or openal-soft into the sourcecode.

@ghost
Copy link

ghost commented Mar 22, 2020

@tecan i tried looking for the fork, and i found it, but it doesn't seem to build with cmake, it says:
Cannot set "CAUDIO_INCLUDE_DIR": current scope has no parent. what steps did you use to build it?
Also the command install_all_targets doesn't exist.

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

4 participants