It is currently Tue Jul 25, 2017 1:51 am

All times are UTC - 5 hours




 Page 1 of 1 [ 7 posts ] 
Author Message
 Post subject: errors in release build
PostPosted: Sat Apr 26, 2008 3:26 pm 

Joined: Fri Jan 04, 2008 2:11 pm
Posts: 72
we build and make the exe in debug mode but the executable doesn't run on pc's where vstudio isn't installed so i tried making a release build but i got some errors i didn't get in the debug build..
debug compilation...
1>------ Build started: Project: SceneLib, Configuration: Debug Win32 ------
1>Compiling...
1>Scene.cpp
1>Creating library...
1>Build log was saved at "file://c:\Documents and Settings\ir2pi\My Documents\Visual Studio 2005\OpenGL-G.E\OpenGL-G.E\SceneLib\_Debug\BuildLog.htm"
1>SceneLib - 0 error(s), 0 warning(s)
2>------ Build started: Project: OpenGL-G.E, Configuration: Debug Win32 ------
2>Linking...
2>Embedding manifest...
2>Build log was saved at "file://c:\Documents and Settings\ir2pi\My Documents\Visual Studio 2005\OpenGL-G.E\OpenGL-G.E\_Debug\BuildLog.htm"
2>OpenGL-G.E - 0 error(s), 0 warning(s)
========== Build: 2 succeeded, 0 failed, 2 up-to-date, 0 skipped ==========



release compilation..
1>------ Build started: Project: OpenGL-G.E, Configuration: Release Win32 ------
1>Compiling...
1>GameOGL.cpp
1>.\GameOGL\GameOGL.cpp(147) : error C2440: '=' : cannot convert from 'char *' to 'LPCWSTR'
1>        Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
1>.\GameOGL\GameOGL.cpp(190) : error C2664: 'CreateWindowExW' : cannot convert parameter 2 from 'char *' to 'LPCWSTR'
1>        Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
1>.\GameOGL\GameOGL.cpp(359) : error C2664: 'UnregisterClassW' : cannot convert parameter 1 from 'char *' to 'LPCWSTR'
1>        Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
1>.\GameOGL\GameOGL.cpp(374) : warning C4311: 'type cast' : pointer truncation from 'LPVOID' to 'long'
1>.\GameOGL\GameOGL.cpp(379) : warning C4312: 'type cast' : conversion from 'LONG' to 'GameOGL *' of greater size
1>.\GameOGL\GameOGL.cpp(989) : error C2664: 'SetWindowTextW' : cannot convert parameter 2 from 'char *' to 'LPCWSTR'
1>        Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
1>Mutex.cpp
1>.\Main\Mutex.cpp(14) : error C2664: 'CreateMutexW' : cannot convert parameter 3 from 'char [12]' to 'LPCWSTR'
1>        Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
1>.\Main\Mutex.cpp(22) : error C2664: 'MessageBoxW' : cannot convert parameter 2 from 'const char [29]' to 'LPCWSTR'
1>        Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
1>ErrorHandler.cpp
1>.\Core\ErrorHandler.cpp(111) : error C2664: 'MessageBoxW' : cannot convert parameter 2 from 'char [1024]' to 'LPCWSTR'
1>        Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
1>.\Core\ErrorHandler.cpp(118) : error C2664: 'MessageBoxW' : cannot convert parameter 2 from 'char [1024]' to 'LPCWSTR'
1>        Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
1>.\Core\ErrorHandler.cpp(125) : error C2664: 'MessageBoxW' : cannot convert parameter 2 from 'char [1024]' to 'LPCWSTR'
1>        Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
1>.\Core\ErrorHandler.cpp(132) : error C2664: 'MessageBoxW' : cannot convert parameter 2 from 'char [1024]' to 'LPCWSTR'
1>        Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
1>.\Core\ErrorHandler.cpp(139) : error C2664: 'MessageBoxW' : cannot convert parameter 2 from 'char [1024]' to 'LPCWSTR'
1>        Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
1>.\Core\ErrorHandler.cpp(146) : error C2664: 'MessageBoxW' : cannot convert parameter 2 from 'char [1024]' to 'LPCWSTR'
1>        Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
1>.\Core\ErrorHandler.cpp(153) : error C2664: 'MessageBoxW' : cannot convert parameter 2 from 'char [1024]' to 'LPCWSTR'
1>        Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
1>.\Core\ErrorHandler.cpp(160) : error C2664: 'MessageBoxW' : cannot convert parameter 2 from 'char [1024]' to 'LPCWSTR'
1>        Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
1>.\Core\ErrorHandler.cpp(167) : error C2664: 'MessageBoxW' : cannot convert parameter 2 from 'const char [18]' to 'LPCWSTR'
1>        Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
1>Main.cpp
1>.\Main\Main.cpp(46) : error C2664: 'MessageBoxW' : cannot convert parameter 2 from 'const char [24]' to 'LPCWSTR'
1>        Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
1>Build log was saved at "file://c:\Documents and Settings\ir2pi\My Documents\Visual Studio 2005\OpenGL-G.E\OpenGL-G.E\Release\BuildLog.htm"
1>OpenGL-G.E - 16 error(s), 2 warning(s)
========== Build: 0 succeeded, 1 failed, 3 up-to-date, 0 skipped ==========


how do i get rid of these??


Offline
 Profile  
 
 Post subject:
PostPosted: Sat Apr 26, 2008 9:09 pm 
Site Admin

Joined: Sun Feb 11, 2007 8:59 am
Posts: 1102
Location: Ontario Canada
seems to me you are using Unicode in your release build.

VMK45 will show you how to setup your project properly:
http://www.marek-knows.com/downloadSect ... GameDev138


Offline
 Profile  
 
 Post subject:
PostPosted: Sun Apr 27, 2008 10:54 am 

Joined: Thu Oct 25, 2007 9:49 pm
Posts: 33
ur using Visual Studio Xpress or Standard? 2008 or 2005? with all VS apps, you need to install a VC_Redist on to the target machine. (check microsoft for the correct VC_Redist)


Offline
 Profile  
 
 Post subject:
PostPosted: Sun Apr 27, 2008 12:30 pm 

Joined: Sat Apr 19, 2008 6:26 am
Posts: 62
Change UnregisterClassW (in code you see UnregisterClass ) to UnregisterClassA. CreateWindowEx to CreateWindowExA, MessageBoX to MessageBoxA etc.

The compiler near so he will name written (UnregisterClass ) he has to choose ((UnregisterClassW, UnregisterClassA etc.) ) and he chooses first). You have him to help.


Offline
 Profile  
 
 Post subject: Help with Mutex
PostPosted: Mon Jan 04, 2010 11:52 am 

Joined: Wed Dec 30, 2009 3:54 pm
Posts: 2
i have watched VM45 and I am using Visual c++ 2008 but I still get these errors. Any help would be appreciated:

Mutex.cpp
1>.\Main\Mutex.cpp(14) : error C2664: 'CreateMutexW' : cannot convert parameter 3 from 'char [12]' to 'LPCWSTR'
1> Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
1>.\Main\Mutex.cpp(22) : error C2664: 'MessageBoxW' : cannot convert parameter 2 from 'const char [29]' to 'LPCWSTR'
1> Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast


Offline
 Profile  
 
 Post subject:
PostPosted: Mon Jan 04, 2010 12:13 pm 
Site Admin

Joined: Sun Feb 11, 2007 8:59 am
Posts: 1102
Location: Ontario Canada
Click on Project->Properties
Configuration Properties->General
What do you have set in the Project Defaults section for the Character Set value?


Offline
 Profile  
 
 Post subject: Character Set issues
PostPosted: Mon Jan 04, 2010 2:03 pm 

Joined: Wed Dec 30, 2009 3:54 pm
Posts: 2
Yes under project->Properties->Configuration Properties->General you need to change the character set from Unicode to Multi-Byte otherwise you will get these errors. I changed that and bamn they went away! :P


Offline
 Profile  
 
Display posts from previous:  Sort by  
 Page 1 of 1 [ 7 posts ] 

All times are UTC - 5 hours


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Jump to:  

cron