Wiki

Changes between Initial Version and Version 1 of Troubleshooting

Show
Ignore:
Timestamp:
05/05/10 10:33:34 (14 years ago)
Author:
Chuck
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Troubleshooting

    v1 v1  
     1== Troubleshooting == 
     2 
     3Here are some problems people run into when getting started with Cobra and their solution. 
     4 
     5=== 64-bit vs. 32-bit Clash === 
     6 
     7Symptoms include a "!BadImageFormatException". You might be running on a 64-bit operating system, but trying to use a DLL/library that is 32-bit native. In other words, you're using a C or C++ library built for 32-bit on a 64-bit system. 
     8 
     9The solution is to build against the "x86" platform, instead of "x64" or "Any". Note that "Any" is the default, and will run in whatever is native to the machine such as 32-bit or 64-bit. You can target "x86" at the command line: 
     10{{{ 
     11cobra -sharp-args:"/platform:x86" ... 
     12}}} 
     13or with a directive in a source file: 
     14{{{ 
     15@args -sharp-args:"/platform:x86" 
     16}}} 
     17 
     18Also note that you can "cd C:\Windows\Microsoft.NET\Framework64\v2.0.50727" and then enter "ldr64 setwow" to force .NET programs to run as 32-bit. You can enter "ldr64 set64" to switch back. 
     19