cAudio icon indicating copy to clipboard operation
cAudio copied to clipboard

Compiling issues on Windows (Visual Studio)

Open Memorix101 opened this issue 8 years ago • 4 comments

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	
````

Memorix101 avatar Jan 15 '17 12:01 Memorix101

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.

bkeys avatar Mar 11 '17 04:03 bkeys

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.

PucklaJ avatar Apr 12 '17 10:04 PucklaJ

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.

netpipe avatar Jun 06 '17 00:06 netpipe

@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.

ghost avatar Mar 22 '20 07:03 ghost