[vs] Code c++ qui marche que en 32Bits et pas en 64
Bonjour, voila mon code:
Code:
1 2 3 4 5
| RegCreateKeyEx(HKEY_CURRENT_USER, TEXT("Software\\Microsoft\\Windows\\CurrentVersion\\Run"), 0, 0, REG_OPTION_NON_VOLATILE,KEY_ALL_ACCESS, 0, &ultracopier_regkey, 0);
DWORD kSize=254;
if(RegQueryValueEx(ultracopier_regkey,TEXT("ultracopier"),NULL,NULL,(LPBYTE)0,&kSize) == ERROR_SUCCESS)
checkBoxStart->setChecked(true);
RegCloseKey(ultracopier_regkey); |
Des que je fait des accéss au registre j'ai l'erreur en compilant en 64Bits, par contre en 32Bits mon code marche trés bien.
Voila l'erreur:
Citation:
Generating Code...
link /LIBPATH:"c:\Qt\lib" /NOLOGO /DEBUG /MANIFEST /MANIFESTFILE:"debug\ultracopier.intermediate.manifest" /SUBSYSTEM:WINDOWS "/MANIFESTDEPENDENCY:type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' publicKeyToken='6595b64144ccf1df' language='*' processorArchitecture='*'" /OUT:debug\ultracopier.exe @C:\Users\user\AppData\Local\Temp\nm9F39.tmp
main.obj : error LNK2019: unresolved external symbol __imp_RegCloseKey referenced in function "bool __cdecl getSystemCopyCatched(void)" (?getSystemCopyCatched@@YA_NXZ)
Options.obj : error LNK2001: unresolved external symbol __imp_RegCloseKey
main.obj : error LNK2019: unresolved external symbol __imp_RegQueryValueExW referenced in function "bool __cdecl getSystemCopyCatched(void)" (?getSystemCopyCatched@@YA_NXZ)
Options.obj : error LNK2001: unresolved external symbol __imp_RegQueryValueExW
main.obj : error LNK2019: unresolved external symbol __imp_RegCreateKeyExW referenced in function "bool __cdecl getSystemCopyCatched(void)" (?getSystemCopyCatched@@YA_NXZ)
Options.obj : error LNK2001: unresolved external symbol __imp_RegCreateKeyExW
main.obj : error LNK2019: unresolved external symbol __imp_RegSetValueExW referenced in function "bool __cdecl newRegQuery(struct HKEY__ *,unsigned short const *,unsigned short const *,class QString const &)" (?newRegQuery@@YA_NPEAUHKEY__@@
PEBG1AEBVQString@@@Z)
Options.obj : error LNK2001: unresolved external symbol __imp_RegSetValueExW
Options.obj : error LNK2019: unresolved external symbol __imp_RegDeleteValueW referenced in function "private: void __cdecl optionsDialog::apply(void)" (?apply@optionsDialog@@AEAAXXZ)
debug\ultracopier.exe : fatal error LNK1120: 5 unresolved externals
NMAKE : fatal error U1077: '"c:\Program Files (x86)\Microsoft Visual Studio 9.0\
VC\BIN\amd64\link.EXE"' : return code '0x460'
Stop.
NMAKE : fatal error U1077: '"c:\Program Files (x86)\Microsoft Visual Studio 9.0\
VC\BIN\amd64\nmake.exe"' : return code '0x2'
Stop.
D'où découle plusieurs question:
- Quel lib linker?
- Comment grâce à des macro pre-processeur voir si on est en 64Bits sous visual?