Compiling T2D 64 bit Window - unicows.lib issue
by Dan McLaughlin · in Torque 2D Beginner · 07/31/2014 (6:07 am) · 8 replies
OK onward to a 64 bit compile in Windows. I've already done a Mac 64 bit compile which was easy.
I created a x64 configuration (why isn't this standard as part of the solution?) in both systems - Win 7/VS Professional and Win 8.1/VS Express. In both, after creating a x64 build, they compile fine but I get a link error
"Can't find unicows.lib"
Digging into this but meanwhile, any thoughts?
I created a x64 configuration (why isn't this standard as part of the solution?) in both systems - Win 7/VS Professional and Win 8.1/VS Express. In both, after creating a x64 build, they compile fine but I get a link error
"Can't find unicows.lib"
Digging into this but meanwhile, any thoughts?
About the author
#2
No problem, I'll figure it out and put in pull requests.
07/31/2014 (6:53 am)
Ah, that explains why a x64 build appears in my VS 2010 project file but not the VS 2013. No problem, I'll figure it out and put in pull requests.
#3
So you can safely remove unicows support from your copy of T2D as T3D doesn't use it anyway.
07/31/2014 (12:34 pm)
unicows.lib/.dll hasn't been necessary since Windows 98/ME support was discontinued long ago. That library was used to handle unicode compatibility issues on Windows 9x OSs since those OSs didn't support unicode natively.So you can safely remove unicows support from your copy of T2D as T3D doesn't use it anyway.
#4
I'll pull all this together and submit a pull request.
07/31/2014 (2:18 pm)
Thanks for the reminder Nathan, I realized that and thought about pulling all the Unicows stuff. I would guess that the library wasn't ported to 64 bit because there was no need. I'll pull all this together and submit a pull request.
#5
Anyhow getting rid of the Unicows and adding a x64 bit compile is easy. Now I'm having an issue with the NASM build, they have to be 64 bit. T2D is using an ancient version of nasm, so I updated that and the build settings (win64 output for 64 and win32 for 32). However the assembly is all written in 32 bit, now it needs to be written in 64. Okay ... register renaming (ebp->rbp), and probably making use of the new 64 bit register r10-r15.
So ... %ifdef WIN64 %endif
FYI - it's not turning out to be a trivial amount of work.
08/01/2014 (6:25 am)
Hmm, there's more than meets the eye. Actually it doesn't appear that anybody has done a 64 bit Windows compile, as far as I can see. I think the code was ported to 64 bit and probably tested under OS X (compiles 64 bit flawlessly) or Linux. Anyhow getting rid of the Unicows and adding a x64 bit compile is easy. Now I'm having an issue with the NASM build, they have to be 64 bit. T2D is using an ancient version of nasm, so I updated that and the build settings (win64 output for 64 and win32 for 32). However the assembly is all written in 32 bit, now it needs to be written in 64. Okay ... register renaming (ebp->rbp), and probably making use of the new 64 bit register r10-r15.
So ... %ifdef WIN64 %endif
FYI - it's not turning out to be a trivial amount of work.
#6
I originally did the 64bit compile code and was able to build a 64bit windows build, so likely something has been missed in the project files.
For 64bit you should not be compiling the nasm files (unless you want to rewrite the code in 64bit asm). Instead only compile the relevant cpp files.
Unicows of course should be removed. There is absolutely no need for it, especially in a 64bit build.
Never tried building the linux version as a 64bit app, so I have no idea what state that is in.
08/01/2014 (6:33 am)
@DanI originally did the 64bit compile code and was able to build a 64bit windows build, so likely something has been missed in the project files.
For 64bit you should not be compiling the nasm files (unless you want to rewrite the code in 64bit asm). Instead only compile the relevant cpp files.
Unicows of course should be removed. There is absolutely no need for it, especially in a 64bit build.
Never tried building the linux version as a 64bit app, so I have no idea what state that is in.
#7
What version of VisualStudio did you use? I did a grep for x64, 64 bit in all the project files and came up with nothing.
On the assembler I had that thought, however when I compile in 64 bit at link time it barks that X32 build from the assembler files is incompatible, so it seemed to indicate that it wanted a 64 bit.
NASM only has a -f (win32|win64) format setting, is there another flag on either NASM or VS I need?
08/01/2014 (6:39 am)
Thanks for checking in James!What version of VisualStudio did you use? I did a grep for x64, 64 bit in all the project files and came up with nothing.
On the assembler I had that thought, however when I compile in 64 bit at link time it barks that X32 build from the assembler files is incompatible, so it seemed to indicate that it wanted a 64 bit.
NASM only has a -f (win32|win64) format setting, is there another flag on either NASM or VS I need?
#8
In my case I had to exclude the nasm files (and anything else which didn't compile in the math / platform code) from the build. From what I recall compiler defines should be setup correctly to use either the inline ASM or the C code.
08/01/2014 (7:07 am)
@Dan Visual Studio 2010 Express with the Windows 7.1 SDK ( see http://stackoverflow.com/questions/1865069/how-to-compile-a-64-bit-application-using-visual-c-2010-express )In my case I had to exclude the nasm files (and anything else which didn't compile in the math / platform code) from the build. From what I recall compiler defines should be setup correctly to use either the inline ASM or the C code.
Associate Mike Lilligreen
Retired T2Der
github.com/GarageGames/Torque2D/commit/437535e40c090346bcba886eb27933b597d46d2c
In any case, with 6 different platforms and 3 versions of Visual Studio just for Windows available - we're really dependent on the community to help test and keep all the compiler project files up to date. Pull requests are greatly appreciated for any x64 configurations.