0
int main() 
{ 
  int x, y, sum, mul, avg;
  cout << "A program which adds two integers\n";
  cout << "Enter 1st integer: ";
  cin >> x;
  cout << "Enter 2nd integer: ";
  cin >> y;
  sum = x + y;
  cout << "Sum is " << sum << endl;

  getch();

    return 0; 
}

already developed the 32 bit dll using vs2008. and i need to compile the the same solution by same vs 2008. but now i need two dlls ..one run under 32 bit os.. another under 64 bit os.

Cœur
  • 37,241
  • 25
  • 195
  • 267
  • To compile a 64-bit exe or dll, you must be running VS2008 on a 64-bit Windows. It's not clear from your question whether or not you are running a 32-bit Windows OS or not. If you *do* have 64-bit OS, [see this question for guidance](http://stackoverflow.com/q/5979675/2065121). – Roger Rowland Nov 25 '14 at 13:53
  • i just use 32 bit windows os. in the same os i need to compile the same solution. but the o/p dll must in 64 bit... i will run the 64 bit dll on 64 bit windows os... are you cleared now – Bharu Shakthi Nov 26 '14 at 11:55
  • Yes, that's clear and that's your problem. You cannot compile a 64-bit DLL from a 32-bit system. VS2008 only offers the choice of installing the 64-bit compiler if your OS is also 64-bit. Maybe you can use a 64-bit OS through a VM or dual-boot your system. – Roger Rowland Nov 26 '14 at 12:09
  • but 2010 can create both 64 bit and 32 bit dlls(activex),,,under 64 bit os....they are registered too.. but they can not call through html page...error keep comming like automation server can't create object – Bharu Shakthi Nov 28 '14 at 11:46
  • Are you asking about VS2010 then? Your question specified VS2008. [It says quite clearly here](http://msdn.microsoft.com/en-us/library/ms246588%28v=vs.90%29.aspx) that *"Visual C++ gives the option of installing the x64 compiler and tools on Windows 64-bit computers"* and you *don't* have a Windows 64-bit computer, right? – Roger Rowland Nov 28 '14 at 11:51
  • hey roger i couldn't compile 64 bit dll on vs2008 under 32bit os. i can only build 32 bit dll. so i went to vs2010. there ony i build 64 bit and 32 bit dlls under 64 bit machine... but both of htem were not able to register...any suggestion – Bharu Shakthi Nov 28 '14 at 13:09
  • I think you need to ask a separate question - this one is now done. – Roger Rowland Nov 28 '14 at 13:20
  • thnks roger ...and i asked another question ....it will greatful if you answere this question too......error:Creating an instance of the COM component with CLSID from the IClassFactory failed due to the following error: 80040111 – Bharu Shakthi Nov 29 '14 at 04:42

0 Answers0