2

I am a non-admin user on a Windows 7 (32 bit) computer, and also an admin user on a Windows 7 64-bit computer. I am trying to build the Vim text editor from source code to install on the 32-bit machine (to a place I have access, like C:\Vim).

Now, I have successfully built both a 64-bit and 32-bit version of Vim on my 64-bit computer. Both of them run fine on the 64-bit computer. I can verify with "dumpbin.exe" as detailed here that the 32-bit build really actually is a 32-bit build. Doing ":version" within Vim while running the 32-bit build also confirms this.

But when I try running that same executable on the 32-bit machine, I see "This version of gvim.exe is not compatible with the version of Windows you're running. Check you computer's system information to see whether you need a x86 (32-bit) or x64 (64-bit) version of the program, and then contact the software publisher." For kicks, I tried the 64-bit build of Vim and got the same message. I tried setting compatibility mode on the executable before running it, but get the same result. Additionally, only "Windows Server 2008" and a few version of "Windows Vista" appear in the list of compatibility modes: I was going to try Windows XP but it does not appear in the list.

Now, when I download an installer from cream.sf.net instead of trying to build my own Vim, Vim installs fine and then launches fine. I can see the full list I originally expected in the compatibility mode list of the installed executable. So I must be doing something wrong when I build.

The only difference I can think of, is that I'm compiling on a 64-bit machine, and using Visual Studio 2010 rather than Cygwin to build. But it is very strange that neither the 32-bit nor the 64-bit build works; I would always expect at least one of them to work! What could I be doing wrong?

Ben
  • 8,725
  • 1
  • 30
  • 48
  • I see there is a "close" vote for "off-topic" for programming. Care to elaborate? I am having a problem building an executable from source code. Is that not on-topic for programming? If not, can you suggest a site where the question should migrate to? – Ben May 05 '14 at 18:50
  • "What could I be doing wrong?" Simple, you are asking the wrong people on the wrong site. Use the vim_dev mailing list. – romainl May 05 '14 at 21:17
  • This question is not off-topic here. However, you might be more likely to find someone who knows the answer on a Vim-specific forum or mailing list, so I'd recommend asking there *as well* as here. If you get an answer, you could even post it here in answer to your own question. – Harry Johnston May 06 '14 at 01:56
  • Perhaps the problem isn't the executable but one of its dependencies? Process Monitor (available from the MS web site) might help diagnose this. – Harry Johnston May 06 '14 at 01:58
  • @romainl, I was under the impression this was a more general problem than just Vim. I've built Vim fine using the exact same setup before. I'm building Vim fine now. There is just one computer where it doesn't work. I'll try the Vim list though. I was trying to attract more Windows/Visual Studio experts than I've seen most of the time on vim_dev. – Ben May 06 '14 at 02:41
  • If the problem occurs on only one computer, it may be that there is a problem with that computer rather than your build; at any rate, identifying the differences between that computer and the others may be a productive line of attack. For example, are any of the DLLs the executable depends on different versions, or perhaps just corrupt? – Harry Johnston May 08 '14 at 04:59
  • Sadly for the sake of this question, I can no longer reproduce the error on the computer in question. I was given admin access, which might have something to do with it, but I also created a new non-admin user and could not reproduce on that account either. I do not know whether some update to the computer or settings change may have fixed the issue while I was not logged in. – Ben May 09 '14 at 18:06

1 Answers1

1

It's not related to Vim. Recent versions of MSVC use a new format for 32-bit binaries, which is not compatible with XP. You can change back to the old format in MSVC with a flag/config option. I'm certain this works with VS 2013 (compiling on a 64-bit machine) and 2012 SP1. According to this post it's also possible with 2010 if you define NTDDI_<version> and _WIN32_WINNT.

Community
  • 1
  • 1
Justin M. Keyes
  • 6,679
  • 3
  • 33
  • 60
  • Thanks! I'll take a look at what compiler flags are in the makefile. – Ben May 08 '14 at 03:39
  • Interesting, but I'm not sure where XP fits into the picture? – Harry Johnston May 08 '14 at 04:56
  • I think I have the opposite problem here. The Vim makefile currently defines WINVER and _WIN32_WINNT to 0x0400, which is so old it doesn't even appear in the MSDN link you gave! I updated to use the values for Windows XP and to also define NTDDI_VERSION appropriately. It seems to be working, but I also gained admin access in between testing. I am going to test the old build again later to make sure the admin access didn't accidentally provide the fix instead. I'll accept the answer if the old build is still broken. Thanks a lot! – Ben May 08 '14 at 15:45
  • Unfortunately, I could no longer reproduce the issue, either on my account or a newly added non-admin account, using the old makefile. I have no idea what was causing the problem or what fixed it in the end. – Ben May 09 '14 at 18:07