Archive for July, 2007

64-bit compilation errors in Visual Studio 2005

Friday, July 20th, 2007

After just having spent some hours trying to compile a C/C++ piece into a 64-bit DLL I came across with a number of error messages searching for which does not yield a lot of great results, so I thought to post them here for the benefit of the others who come across:

  1. “unresolved external symbol __security_check_cookie”: Configuration Properties->C/C++->Code Generation switch off Buffer Security Check (/GC- command line) and this error goes away
  2. “unresolved external symbol _DllMainCRTStartup” (not to be confused with __DllMainCRTStartup@): Configuration Properties->Linker->Input – make sure “Ignore All Default Libraries” is set to “no”.
  3. Could not find kernel32.lib user32.lib etc – if you search for this files in VS2005 directory you will find them in various places, but for 64-bit mode they should be in AMD64 – if they are not there, then go to setup of VS and make sure you installed 64-bit compilers and tools: you can try install recent Platform SDK from Microsoft, however even though it contains these files in correct directory they don’t appear to help compile even if you provide path to them in “Additional Library Directories” in Linker options.
  4. “module machine type ‘X86′ conflicts with target machine ‘X64′” – this message appears if you have not got correct 64-bit kernel32.lib or other similar DLLs, so that VS takes 32-bit versions and then can’t link them since they are not 64-bit. This error comes up after you think you “fixed” error #3 by giving path to place where you think correct kernel32.lib exists – solution is the same as in error #3.

Hope this will save a few hours of fruitless efforts trying to understand what the heck Visual Studio is on about when trying to compile a wee 64-bit .DLL :)

Biting the hand that feeds it…

Saturday, July 7th, 2007

In the last 10 days I tested and found good way to charm grey squirrels that otherwise can be called pretty shy, or to put it less diplomatically rather cowardly. However I managed to find a way that allowed them to overcome their shyness and finally eat tasty roasted peanuts from my hand! You just can’t beat having around 10 squirrels around you greedily looking at you waiting for their turn to grab a nut :)

When dealing with wild life one has to be careful since they are not called wild for nothing! Squirrels are very furry and cute, but they have very sharp teeth! Today a baby squirrel that was over-enthusiastic over getting a peanut run at high speed and grabbed by index finger rather than peanut, despite wearing a glove it was a successful bite :(

Well, it was time for a tetanus shot in arm as a precautinary measure as I have not been vaccinated in the last 10 years. Not to put you off feeding squirrels by hand, but one has to be careful – next time it is going to be a bigger glove and that baby squirrel will have to act like adults who come very politely and get nut very carefully, the younster has not learnt any manners yet, he will have to or no peanuts for him!