My compile environment is windows xp and vc 6.0.
Now I have a c source file(msgRout.c), def file(msgRout.def), link file(msgRout.link), then I use commands below to get a 32 bit dll:
1.cl /I ../include -c -W3 -Gs- -Z7 -Od -nologo -LD -D_X86_=1 -DWIN32 -D_WIN32 -D_MT -D_DLL msgRout.c
2.lib -out:msgRout.lib -def:msgRout.def -machine:i386
3.link /LIBPATH:../../Lib -nod -nologo -debug:full -dll @msgRout.link -out:msgRout.dll
But the dll I got cannot be loaded on X64 application. it required a 64 bit dll.
So here is my question:
Can I get a 64 bit dll with vc 6.0?
Using only above 3 commands alike, how can I get 64 bit dll?
Many GREAT THANKS!!!
Allan
Visual C++ 6.0 does not include 64-bit compiler/libraries. You will need either a more recent version of Visual C++ or a Windows Platform SDK that has the 64-bit support. The earliest one is the Windows Server 2003 Platform SDK.
Once you have that installed,
cl /?andlink /?will have info on how to build 64-bit apps.Update: If you have VS2005, you can build 64-bit binaries with the x86-amd64 cross-compiler (a 32-bit
cl.exethat produces 64-bit code) or with the x64 compiler (a 64-bitcl.exe). To do that, you need to:C:\Program Files\Microsoft Visual Studio 8\VC\Vcvarsall.bat x86_amd64orC:\Program Files\Microsoft Visual Studio 8\VC\Vcvarsall.bat amd64.Once you do that, you should be able to use the same command line as above (with tcouple small changes – for
clyou’ll have to define /D:X64=1 or /D_AMD64_ and forlinkyou’ll have to change the/machine:x86to/machine:x64) to produce 64-bit version of your program.Here are some links with more information:
Installing Visual Studio 64-bit Components
HowTo: Enable a 64-Bit Visual C++ Toolset at the Command Line
Use Visual Studio to build 64-bit application
64-bit Applications
Seven Steps of Migrating a Program to a 64-bit System