-1

I have followed below step to compile code in 64 bit. all steps also mention in How to compile a 64-bit application using Visual C++ 2010 Express? link

1) Download and install the Windows Software Development Kit version 7.1. Visual C++ 2010 Express does not include a 64 bit compiler, but the SDK does. A link to the SDK: http://msdn.microsoft.com/en-us/windowsserver/bb980924.aspx

2 ) Change your project configuration. Go to Properties of your project. On the top of the dialog box there will be a "Configuration" drop-down menu. Make sure that selects "All Configurations." There will also be a "Platform" drop-down that will read "Win32." Finally on the right there is a "Configuration Manager" button - press it. In the dialog that comes up, find your project, hit the Platform drop-down, select New, then select x64. Now change the "Active solution platform" drop-down menu to "x64." When you return to the Properties dialog box, the "Platform" drop-down should now read "x64."

3) Finally, change your toolset. In the Properties menu of your project, under Configuration Properties | General, change Platform Toolset from "v100" to "Windows7.1SDK".

I am also compiling code in x64 mode

Still I am getting below error

error C2664: cannot convert parameter 1 from 'LPCTSTR' to 'const CHAR *'

please help me to solve problem.

my requirement is that need to enable character set : Use Unicode character set (project->General). so this i can't able to set character set as NOT set. as mention below link cannot convert parameter 1 from 'char' to 'LPCWSTR'

  • Possible duplicate of [cannot convert parameter 1 from 'char' to 'LPCWSTR'](https://stackoverflow.com/questions/3924926/cannot-convert-parameter-1-from-char-to-lpcwstr) (see the second answer, not the one marked asslution) – GPhilo Aug 08 '18 at 12:48
  • Can you share code the problematic line? Without it it is hard to say anything precise. – R2RT Aug 08 '18 at 12:51
  • here problem is that my code is build successfully with same "charter set": Use UNICODE set while i build code win32 but if i build code in x64 then getting above mention error – pratik solanki Aug 08 '18 at 12:56

2 Answers2

0

Are you using UNICODE? In that case, LPCTSTR char type is wchar_t

chris
  • 398
  • 2
  • 11
  • what is the type of CHAR? and can you show the line where you get the error? – chris Aug 08 '18 at 12:54
  • I can able to build win32 successfully but while i am trying to build with x64 at that time i am facing type casting error as mention in question – pratik solanki Aug 08 '18 at 13:00
  • what is the type of CHAR? I suspect WCHAR is one type, and CHAR is another. Which just matched on 32 bit, but not on 64 bit. – chris Aug 08 '18 at 13:03
  • yes you are right . is it any way to solve problem without using explicit type casting ? – pratik solanki Aug 08 '18 at 13:07
0

Visual Studio allows different configurations for x64 and x32, it also allows different configurations for debug and release mode. Each of these configuration can have a different character encoding. You have to manually change the configuration so that they all use the same character encoding.

In the main menu, click Project->Properties.

You should see "Configuration: Debug/Release", Platform: Win32/x64"

You also see "Character set: Unicode/Not-set"

Unicode is recommended. Make sure all of the 4 configurations are using

"Character set: Unicode"
Barmak Shemirani
  • 30,904
  • 6
  • 40
  • 77