why I can't use "cin" or "cout" when I making a 64bit program?

I built a simple program with VC++6.0 and Microsoft Platform SDK,the code is :

#include <stdio.h>
#include <iostream.h>

int main()
{
 int r;
 double mj;
 cout<<"put in r:"<<endl;
 cin>>r;
 mj=3.1415926*r*r;
 printf("mj is%d",mj);
 getchar();
 return 0;
}

but I got an error message:

libcimtd.lib(iostrini.obj) : error LNK2001: unresolved external symbol "void * __cdecl operator new(unsigned __int64,int,char const *,int)" ( 2@YAPEAX_KHPEBDH@Z)
libcimtd.lib(streamb.obj) : error LNK2019: unresolved external symbol "void * __cdecl operator new[](unsigned __int64,int,char const *,int)" ( _U@YAPEAX_KHPEBDH@Z) referenced in function "protected: virtual int __cdecl streambuf::doallocate(void)"
( doallocate@streambuf@@MEAAHXZ)
Debug64/H.exe : fatal error LNK1120: 2 unresolved externals
Error executing link.exe.

When I delete the "cin" and "cout",I can link it very well. 
Why I have made a good opengl program under the same setup but also without "cin" or "cout".



Answer this question

why I can't use "cin" or "cout" when I making a 64bit program?

  • EPINAUD

    Hi: at first glance it appears that you may be missing a library on the link step. Are you linking against libcpmtd.lib

  • Redmanmc

    I use VC6.0 with the new SDK,there is a document introduced build a 64bit program with VC6.0, and I have made a real 64bit opengl program with VC6.0 successfully.
  • Dave_B

    but why I can make a good 64bit opengl program with this SDK and VC6.0
    I'm true it's a 64bit program.

  • Koob

    Also, I just checked with Jonathan. The PSDK is to build windows applications only but the CRT (e.g. iostream is) does not have any 64bit support.

    If you have msdn subscription, you can download the July CTP build of VS2005 where full support of 64bit development is present.

    Thanks,
      Ayman Shoukry
      VC++ Team.

  • DexySeeksHelp

    I downloaded the Microsoft Platform SDK for windows sever 2003 from  Microsoft's webs
  • dovotowork

    This works because you are using compilers + headers + libraries that all support 64bit development. Note: Visual C++ 6.0 on its own does not support 64bit development - it is the extra tools, headers, and libraries that you have got from the PSDK that enable this.

    Specifically the STL (and MFC/ATL) headers and libraries that ship with Visual C++ 6.0 do not support 64bit development: this is why you are seeing build errors.

  • HimanshuG

    I took a look at the link and it mentiones that the PSDK is not supported with VC6:

  • Development Tools. To build the C/C++ samples, you must have a C/C++ compiler. If you are using Microsoft Visual C/C++R, run it at least once before installing the SDK. This will ensure that the environment variables are correctly configured. To build the Visual Basic samples, you must have Microsoft Visual BasicR. This SDK does not support working with Microsoft Visual C/C++R, 6.0 as support for VC 6.0 has ended. The last SDK that will work with VC 6.0 is the February 2003 Edition, you can order a CD on the fulfillment site. Side by side installations are not supported.
  • Thanks,
      Ayman Shoukry
      VC++ Team



  • GSX0r

    Could you include a link from where exactly you installed it so that I can try to reproduce the error myself

    Also, how did you point to the 64bit compiler tools instead of the x86 ones in your case

    Thanks,
      Ayman Shoukry
      VC++ Team



  • DevGuy

    Hi: I actually just spotted that you are trying to compile for 64-bits: but Visual C++ 6.0 doesn't support compiling for 64-bits. You need to try a more recent compiler.

  • Sare1

    http://www.microsoft.com/downloads/details.aspx FamilyID=eba0128f-a770-45f1-86f3-7ab010b398a3&DisplayLang=en

    I only have a chinese docnment about built a 64bit project under VC6.0,but I think these must be have some english documents in microsoft's webs.

  • Danik

    I added the libcpmtd.lib, but I got the same error!
  • Lyners

    Where did you install the new (64bit) SDK from

    Thanks,
      Ayman Shoukry
      VC++ Team.

  • why I can't use "cin" or "cout" when I making a 64bit program?