Errors building JUCE 1.8 with vcexpress


#1

I tried to build JUCE 1.8 with the latest Visual C++ EXpress (Feb 2005 release) and got many errors related to strings. I switched back to JUCE 1.7 and got the same errors with the new VC, any idea what to do, can JUCE be fixed or is it a problem with the new VC?

1.8 Erros
------ Build started: Project: JUCE, Configuration: Debug Win32 ------
Compiling…
juce_String.cpp
d:\Dev\juce\src\juce_core\text\juce_String.cpp(301) : error C2664: ‘wcslen’ : cannot convert parameter 1 from 'const juce_wchar *const ’ to 'const wchar_t *'
Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
d:\Dev\juce\src\juce_core\text\juce_String.cpp(307) : error C2664: ‘wcstombs’ : cannot convert parameter 2 from 'const juce_wchar *const ’ to 'const wchar_t *'
Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
d:\Dev\juce\src\juce_core\text\juce_String.cpp(359) : error C2664: ‘wcstombs’ : cannot convert parameter 2 from 'const juce_wchar *const ’ to 'const wchar_t *'
Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
d:\Dev\juce\src\juce_core\text\juce_String.cpp(578) : error C2664: ‘mbstowcs’ : cannot convert parameter 1 from ‘juce_wchar *’ to 'wchar_t *'
Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
d:\Dev\juce\src\juce_core\text\juce_String.cpp(608) : error C2664: ‘mbstowcs’ : cannot convert parameter 1 from 'juce_wchar *const ’ to 'wchar_t *'
Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
juce_win32_FileChooser.cpp
d:\Dev\juce\build\win32\platform_specific_code\juce_win32_FileChooser.cpp(56) : error C2679: binary ‘=’ : no operator found which takes a right-hand operand of type ‘LPCWSTR’ (or there is no acceptable conversion)
d:\Dev\juce\src\juce_core\text\juce_String.h(105): could be 'const JUCE::String &JUCE::String::operator =(const tchar *const ) throw()'
d:\Dev\juce\src\juce_core\text\juce_String.h(108): or 'const JUCE::String &JUCE::String::operator =(const JUCE::String &) throw()'
while trying to match the argument list '(JUCE::String, LPCWSTR)'
juce_win32_Fonts.cpp
d:\Dev\juce\build\win32\platform_specific_code\juce_win32_Fonts.cpp(49) : error C2664: ‘JUCE::String::String(const JUCE::String &) throw()’ : cannot convert parameter 1 from ‘WCHAR [32]’ to 'const JUCE::String &'
Reason: cannot convert from ‘WCHAR [32]’ to 'const JUCE::String’
No constructor could take the source type, or constructor overload resolution was ambiguous
juce_win32_Midi.cpp
d:\Dev\juce\build\win32\platform_specific_code\juce_win32_Midi.cpp(312) : error C2665: ‘JUCE::String::String’ : none of the 11 overloads could convert all the argument types
d:\Dev\juce\src\juce_core\text\juce_String.h(66): could be 'JUCE::String::String(const char *const ,const int) throw()'
d:\Dev\juce\src\juce_core\text\juce_String.h(77): or 'JUCE::String::String(const juce_wchar *const ,const int) throw()'
d:\Dev\juce\src\juce_core\text\juce_String.h(767): or 'JUCE::String::String(const float,const int) throw()'
d:\Dev\juce\src\juce_core\text\juce_String.h(779): or 'JUCE::String::String(const double,const int) throw()'
d:\Dev\juce\src\juce_core\text\juce_String.h(947): or 'JUCE::String::String(const int,const int) throw()'
while trying to match the argument list '(WCHAR [32], unsigned int)'
d:\Dev\juce\build\win32\platform_specific_code\juce_win32_Midi.cpp(424) : error C2665: ‘JUCE::String::String’ : none of the 11 overloads could convert all the argument types
d:\Dev\juce\src\juce_core\text\juce_String.h(66): could be 'JUCE::String::String(const char *const ,const int) throw()'
d:\Dev\juce\src\juce_core\text\juce_String.h(77): or 'JUCE::String::String(const juce_wchar *const ,const int) throw()'
d:\Dev\juce\src\juce_core\text\juce_String.h(767): or 'JUCE::String::String(const float,const int) throw()'
d:\Dev\juce\src\juce_core\text\juce_String.h(779): or 'JUCE::String::String(const double,const int) throw()'
d:\Dev\juce\src\juce_core\text\juce_String.h(947): or 'JUCE::String::String(const int,const int) throw()'
while trying to match the argument list '(WCHAR [32], unsigned int)'
d:\Dev\juce\build\win32\platform_specific_code\juce_win32_Midi.cpp(467) : error C2665: ‘JUCE::String::String’ : none of the 11 overloads could convert all the argument types
d:\Dev\juce\src\juce_core\text\juce_String.h(66): could be 'JUCE::String::String(const char *const ,const int) throw()'
d:\Dev\juce\src\juce_core\text\juce_String.h(77): or 'JUCE::String::String(const juce_wchar *const ,const int) throw()'
d:\Dev\juce\src\juce_core\text\juce_String.h(767): or 'JUCE::String::String(const float,const int) throw()'
d:\Dev\juce\src\juce_core\text\juce_String.h(779): or 'JUCE::String::String(const double,const int) throw()'
d:\Dev\juce\src\juce_core\text\juce_String.h(947): or 'JUCE::String::String(const int,const int) throw()'
while trying to match the argument list '(WCHAR [32], unsigned int)'
d:\Dev\juce\build\win32\platform_specific_code\juce_win32_Midi.cpp(467) : error C2228: left of ‘.containsIgnoreCase’ must have class/struct/union
juce_win32_Misc.cpp
d:\Dev\juce\build\win32\platform_specific_code\juce_win32_Misc.cpp(83) : error C2664: ‘void JUCE::String::copyToBuffer(char *const ,const int) throw() const’ : cannot convert parameter 1 from 'wchar_t *const ’ to 'char *const '
Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
d:\Dev\juce\build\win32\platform_specific_code\juce_win32_Misc.cpp(111) : error C2665: ‘JUCE::String::String’ : none of the 11 overloads could convert all the argument types
d:\Dev\juce\src\juce_core\text\juce_String.h(66): could be 'JUCE::String::String(const char *const ,const int) throw()'
d:\Dev\juce\src\juce_core\text\juce_String.h(77): or 'JUCE::String::String(const juce_wchar *const ,const int) throw()'
d:\Dev\juce\src\juce_core\text\juce_String.h(767): or 'JUCE::String::String(const float,const int) throw()'
d:\Dev\juce\src\juce_core\text\juce_String.h(779): or 'JUCE::String::String(const double,const int) throw()'
d:\Dev\juce\src\juce_core\text\juce_String.h(947): or 'JUCE::String::String(const int,const int) throw()'
while trying to match the argument list '(const wchar_t *const , int)'
juce_win32_PlatformUtils.cpp
d:\Dev\juce\build\win32\platform_specific_code\juce_win32_PlatformUtils.cpp(245) : error C2664: ‘void JUCE::String::copyToBuffer(char *const ,const int) throw() const’ : cannot convert parameter 1 from ‘WCHAR *’ to 'char *const '
Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
Generating Code…
Build log was saved at "file://d:\Dev\juce\bin\intermediate_win32\staticdebug\BuildLog.htm"
JUCE - 14 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

1.7 Errors
------ Build started: Project: JUCE, Configuration: Debug Win32 ------
Compiling…
juce_String.cpp
d:\Dev\juce\src\juce_core\text\juce_String.cpp(301) : error C2664: ‘wcslen’ : cannot convert parameter 1 from 'const juce_wchar *const ’ to 'const wchar_t *'
Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
d:\Dev\juce\src\juce_core\text\juce_String.cpp(307) : error C2664: ‘wcstombs’ : cannot convert parameter 2 from 'const juce_wchar *const ’ to 'const wchar_t *'
Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
d:\Dev\juce\src\juce_core\text\juce_String.cpp(359) : error C2664: ‘wcstombs’ : cannot convert parameter 2 from 'const juce_wchar *const ’ to 'const wchar_t *'
Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
d:\Dev\juce\src\juce_core\text\juce_String.cpp(578) : error C2664: ‘mbstowcs’ : cannot convert parameter 1 from ‘juce_wchar *’ to 'wchar_t *'
Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
d:\Dev\juce\src\juce_core\text\juce_String.cpp(608) : error C2664: ‘mbstowcs’ : cannot convert parameter 1 from 'juce_wchar *const ’ to 'wchar_t *'
Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
juce_win32_PlatformUtils.cpp
d:\Dev\juce\build\win32\platform_specific_code\juce_win32_PlatformUtils.cpp(228) : error C2664: ‘void JUCE::String::copyToBuffer(char *const ,const int) throw() const’ : cannot convert parameter 1 from ‘WCHAR *’ to 'char *const '
Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
Generating Code…
Build log was saved at "file://d:\Dev\juce\bin\intermediate_win32\staticdebug\BuildLog.htm"
JUCE - 6 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========


#2

ah, I didn’t know there was a new VC version out. I’ll have a go asap…


#3

Its not a new public beta but a developer preview release from Feb 2005. Look below the beta version for the link. The previous Preview (Oct 2004) was very bad so I removed it but this one works great except for these errors. Since it works ok with other projects I suspect it relates to JUCE maybe.

thanks


#4

ok, I’ve got the latest one now. Easy to fix this: in platformdefs.h, line 132, get rid of all this:

  typedef wchar_t           juce_wchar;

  /** A platform-independent unicode character type. */
  typedef unsigned short    juce_wchar;

…and replace it with just:

  typedef wchar_t           juce_wchar;

#5

Thanks! It now compiles and works on both debug and release :slight_smile:


#6

Visual C++ Express Edition Beta 2 is out now

http://lab.msdn.microsoft.com/express/visualc/default.aspx


#7

:smiley:


#8