Link to home
Start Free TrialLog in
Avatar of PMH4514
PMH4514

asked on

how do I install unicode libraries with Visual Studio 6.0?

I need to create unicode configurations and didn't install it first time through installing visual studio 6.0. I put the Disc 1 of Visual Studio 6.0 in and tried to modify the configuration, but I see no way to add unicode libraries. What am I missing?

thanks!
Avatar of Axter
Axter
Flag of United States of America image

Hi PMH4514,
> I need to create unicode configurations and didn't install it first
> time through installing visual studio 6.0. I put the Disc 1 of Visual
> Studio 6.0 in and tried to modify the configuration, but I see no way
> to add unicode libraries. What am I missing?

I don't believe you're missing anything.  The Unicode library should install by default.
You probably just need to change the property settings of your project.
Change your project to UNICODE via project property settings, and it should then using unicode library.

David Maisonave (Axter)
Cheers!
Avatar of AlexFM
AlexFM

Run Visual Studio Installation, select Add - Remove components. In the components dialog you need to select Unicode libraries. The simplest way is to hightlight C++ line and click "Select all". Or open C++ components, then MFC libraries (I don't remember exactly, you can find this), and then select MFC Libraries for Unicode.
Avatar of PMH4514

ASKER

David - all comments I have read in past threads here on EE say that the unicode libraries are NOT installed by default, that they have to be manually installed. Which is what led me to put the visual studio installation discs in.  Setup then searches for installed components, I click Add/Remove.

Alex - I clicked Select All, and I clicked on Change Option for all that are listed, but I don't see anything like "MFC Libraries for Unicode" - regardless I did select all and let it run it's install. I'm still getting these compile errors on my project:

error C2664: 'wcscpy' : cannot convert parameter 2 from 'char [2]' to 'const unsigned short *'
        Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast

- the errors in a 3rd party API source. The vendor tells me these errors are because I'm not compiling with UNICODE enabled.

I created new configurations, using existing configurations as the source to copy, and  replaced _MBCS with _UNICODE but nothing seems to change.
This is not because Unicode libraries are missing. This is compilation error.
You made some mistake converting MBCS configuration to Unicode. Unfortunately, I don't have VC++ 6.0 installed, wait for somebody who can tell exact instructions.
Avatar of PMH4514

ASKER

>>You made some mistake converting MBCS configuration to Unicode.

by "converting" are you referring to my changes in the project link properties or something with code itself? I have not attempted any code changes.

I went to Build->Configurations and clicked  Add

I made a new name UnicodeDebug and copied the settings from the existing Win32 Debug configuration.

I then followed the directions from, well, it was your post actually, found here (accepted answer):

https://www.experts-exchange.com/questions/20987805/Creation-application-Unicode-Visual-Studio.html?query=install+unicode+visual+studio&clearTAFilter=true

That is the extend of what I have done thus far.
Try something simple first

1) Create a new hello world console application
2) Edit project settings - Under C++/General, change _MBCS to _UNICODE
3) Change the content of the main program to
#include "stdafx.h"
#include <tchar.h>
int main(int argc, TCHAR* argv[])
{
      _tprintf(_T("Hello World! %d\n"), sizeof (TCHAR));
      return 0;
}

4) Run the program.  You should get

Hello World! 2

If that works, compare it with what you have and see what is different.
Avatar of PMH4514

ASKER

It worked, but it returned "Hello World! 1"  instead of '2'

Avatar of PMH4514

ASKER

whoops, I tested the app after making the release build, hadn't changed to _UNICODE on the release config.. This did return "Hello World! 2"

So what then does this tell me? Ok, I must have the libraries installed, but it is 3rd party code that is not compiling, and they are telling me that this is because I must not have them installed.. ??
ASKER CERTIFIED SOLUTION
Avatar of cup
cup

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of PMH4514

ASKER

hmm.. well a brand new project set UNICODE and including the 3rd party header w/ nothing else compiles.. no idea why linking in the same modules and including the same headers in my acutal project would produce all those compiler errors, but it must be something relating to my  project configuration.. .no idea what though.
1) You have to set _UNICODE: not UNICODE.  It has to have a leading underscore and it should be con the command line: not #defined somewhere.
2) The project is probably consistent within itself.  If they use declarations like TCHAR and routines like _tcscpy, they will build with both MBCS and UNICODE.  If however, they have two variants of each routine which are pointed to by macros, then there will only be one libarary.