views:

1580

answers:

5

I am trying to compile my apps (which uses 3rd party libraries) for the x64 platform. However selecting x64 from Build Configuration Manager from my VS2008 Pro doesn't seem to work. The binary does get created but my client wasn't able to get it to run on x64.

I wonder if the 3rd party DLLs could be the cause. Anyone has any idea on this?

Thanks.

+3  A: 

Do you have x64 versions of the third party libraries? If not you are out of luck. A process must either be fully x86 or x64, you can't mix and match libraries. If the libraries are DLLs then you still need the export libraries from an x64 build.

In what way does selecting the x64 configuration in VS not work?

Updated: If your app is .NET and architecture neutral, then it will be loaded as 64 bit on 64 bit OS'es. However, if it relies on 32 bit DLLs then this will fail at run time. You can force your exe to always load 32 bit using the corflags utility.

Rob Walker
+1  A: 

As Rob Walker said. You can find out more by using the "depends" program by SysInternals on an x64 machine.

Lev
Depends is not from sysinternals. It used to be distributed with Visual Studio, but can now be found at http://www.dependencywalker.com/
crashmstr
A: 

"selecting x64 from Build Configuration Manager from my VS2008 Pro doesn't seem to work"
I'm not sure why you would be getting binaries at all but remember that the x64 tools are not installed by default. Go back and re-run your VC2008 installer, do a custom install, and, under the VC++ bit of the tree, make sure the checkbox for the 64-bit compiler is checked. If it is not, check it and run the install. Then try your build.

You do need the 64-bit versions of the 3rd party dlls and you do need to get all your include and lib paths right and your output folders straight, but having the tool installed is the first step.

A: 

My application does not has an installer. I created it in as a "portable app" with .NET2.0 as a pre-requisite.

I have posted the same request to the vendor. Still awaiting for them to revert if they have the x64 bit.

In the meantime I am in the process to purchase a copy of x64 Vista to personally test it out. I can't be sacrificing my users to test this out for me. I will keep this thread posted once I have new updates.

Thanks.

If your app is .net then see my updated answer
Rob Walker
A: 

Managed to pinpoint the source of the problem. It was one of the setting (Encrypt IL Code) in the source code obfuscating tool (Intellilock 1.1.0.4) that made the binary failed to run in x64 environment.

Disabling this setting fixed the issue.

You should accept your own answer.
EnocNRoll