Qt 5.15.17 - Error: C3861 - guiddef.h(161): 'memcmp': identifier not found
-
Trying to upgrade a Qt project from 5.7 to Qt 5.15.17 and getting some errors on windows:
C:\Program Files (x86)\Windows Kits\10\include\10.0.26100.0\shared\guiddef.h(161): error C3861: 'memcmp': identifier not found
C:\Program Files (x86)\Windows Kits\10\include\10.0.26100.0\shared\stralign.h(335): error C3861: 'wcschr': identifier not found
C:\Program Files (x86)\Windows Kits\10\include\10.0.26100.0\shared\stralign.h(350): error C3861: 'wcsrchr': identifier not found
....Here is the command line that runs:
cl -c -nologo -Zc:wchar_t -FS -Zc:rvalueCast -Zc:inline -Zc:strictStrings -Zc:throwingNew -Zc:referenceBinding -Zc:__cplusplus -std=c++11 -Zi -MDd -W0 -EHsc /Fddebug\MyApp.com.vc.pdb -DUNICODE -D_UNICODE -DWIN32 -D_ENABLE_EXTENDED_ALIGNED_STORAGE -DWIN64 -DQT_QML_DEBUG_NO_WARNING -DVERSION_MAJOR=1 -DVERSION_MINOR=0 -DVERSION_BUILD=0 -DEMOOJ_APPLE -DPJ_NATIVE_STRING_IS_UNICODE=0 -DPJ_IS_LITTLE_ENDIAN=1 -DPJ_IS_BIG_ENDIAN=0 -DQT_PLUGIN -DQT_OPENGL_LIB -DQT_SVG_LIB -DQT_WIDGETS_LIB -DQT_QUICKCONTROLS2_LIB -DQT_QUICK_LIB -DQT_MULTIMEDIA_LIB -DQT_GUI_LIB -DQT_QMLMODELS_LIB -DQT_QML_LIB -DQT_NETWORK_LIB -DQT_XML_LIB -DQT_CONCURRENT_LIB -DQT_SQL_LIB -DQT_CORE_LIB -DQT_QML_DEBUG IC:\Qt\Qt5.15.17\5.15.17\
I cannot find the references to these methods anywhere in my project. I know for a fact Im not using memcmp anywhere in my project.
-
Trying to upgrade a Qt project from 5.7 to Qt 5.15.17 and getting some errors on windows:
C:\Program Files (x86)\Windows Kits\10\include\10.0.26100.0\shared\guiddef.h(161): error C3861: 'memcmp': identifier not found
C:\Program Files (x86)\Windows Kits\10\include\10.0.26100.0\shared\stralign.h(335): error C3861: 'wcschr': identifier not found
C:\Program Files (x86)\Windows Kits\10\include\10.0.26100.0\shared\stralign.h(350): error C3861: 'wcsrchr': identifier not found
....Here is the command line that runs:
cl -c -nologo -Zc:wchar_t -FS -Zc:rvalueCast -Zc:inline -Zc:strictStrings -Zc:throwingNew -Zc:referenceBinding -Zc:__cplusplus -std=c++11 -Zi -MDd -W0 -EHsc /Fddebug\MyApp.com.vc.pdb -DUNICODE -D_UNICODE -DWIN32 -D_ENABLE_EXTENDED_ALIGNED_STORAGE -DWIN64 -DQT_QML_DEBUG_NO_WARNING -DVERSION_MAJOR=1 -DVERSION_MINOR=0 -DVERSION_BUILD=0 -DEMOOJ_APPLE -DPJ_NATIVE_STRING_IS_UNICODE=0 -DPJ_IS_LITTLE_ENDIAN=1 -DPJ_IS_BIG_ENDIAN=0 -DQT_PLUGIN -DQT_OPENGL_LIB -DQT_SVG_LIB -DQT_WIDGETS_LIB -DQT_QUICKCONTROLS2_LIB -DQT_QUICK_LIB -DQT_MULTIMEDIA_LIB -DQT_GUI_LIB -DQT_QMLMODELS_LIB -DQT_QML_LIB -DQT_NETWORK_LIB -DQT_XML_LIB -DQT_CONCURRENT_LIB -DQT_SQL_LIB -DQT_CORE_LIB -DQT_QML_DEBUG IC:\Qt\Qt5.15.17\5.15.17\
I cannot find the references to these methods anywhere in my project. I know for a fact Im not using memcmp anywhere in my project.
@Austin-K You may not be directly using memcmp but the header file in the message is referencing it and not find a declaration. This could be because of another missing include, something excluded by a #define symbol, stale pre-compiled headers, etc.
Share some more information.
What compiler version? Has that changed?
What generated the build command? qmake, cmake, witchcraft?
Have you started form a completely clean source tree and build folder?
What is the context around the error messages?Have you approached Qt commercial support since that Qt version commercial-only AFAICT?
-
Hi Chris, Thanks. Im using qmake to build on windows.
What compiler version? Has that changed?
Compiler version: MSVC 2019 64bit -- same error on MSVC 2015 32bit. Internally bundled with Qt 5.15.17.
Have you started form a completely clean source tree and build folder?
No -- Im trying to upgrade an existing Qt 5.7 project which previously was being compiled with Ming32.
I have not approached commercial support yet -- last resort.
Per microsoft:
If error C3861 appears after project migration from older versions of the compiler, you may have issues related to supported Windows versions. Visual C++ no longer supports targeting Windows 95, Windows 98, Windows ME, Windows NT or Windows 2000. If your WINVER or _WIN32_WINNT macros are assigned to one of these versions of Windows, you must modify the macros. For more information, see Modifying WINVER and _WIN32_WINNT.
-
From my pov the MSVC env is not properly set up so the corresponding headers are not found. Try to compile a plain main.cpp without any Qt and include windows.h to see if you get also an error there.
-
Hi Chris, Thanks. Im using qmake to build on windows.
What compiler version? Has that changed?
Compiler version: MSVC 2019 64bit -- same error on MSVC 2015 32bit. Internally bundled with Qt 5.15.17.
Have you started form a completely clean source tree and build folder?
No -- Im trying to upgrade an existing Qt 5.7 project which previously was being compiled with Ming32.
I have not approached commercial support yet -- last resort.
Per microsoft:
If error C3861 appears after project migration from older versions of the compiler, you may have issues related to supported Windows versions. Visual C++ no longer supports targeting Windows 95, Windows 98, Windows ME, Windows NT or Windows 2000. If your WINVER or _WIN32_WINNT macros are assigned to one of these versions of Windows, you must modify the macros. For more information, see Modifying WINVER and _WIN32_WINNT.
@Austin-K said in Qt 5.15.17 - Error: C3861 - guiddef.h(161): 'memcmp': identifier not found:
Have you started from a completely clean source tree and build folder?
No -- Im trying to upgrade an existing Qt 5.7 project which previously was being compiled with Ming32.
So you are building using MS VC potentially modified sources, into a folder containing compilation artefacts from a MingW build: not a good idea. You should start with a clean copy of the project source and an empty build directory.
Before this:
C:\Program Files (x86)\Windows Kits\10\include\10.0.26100.0\shared\guiddef.h(161): error C3861: 'memcmp': identifier not found
should be a chain of messages leading back to one of your source files. Inspect everything #included or #defined before the line of your source that leads to this failure. You look to be using PJSIP, so there could be something in there at play as well. Don't know what the EMOOJ_APPLE define is related to.
-
@ChrisW67 Thanks - I think you're right. I think because the pjsip compile is being done with a different version of msvc 2019 than the one Qt is using we have problems. Is there a way to configure Qt to use the installed MSVC instead of the bundled version? I tried adding a new kit but it does look like its compatible with QtCreator's setup.
Im using QtCreator for the compile.
I figured MSVC would be a better experience than ming64 for debugging purposes but maybe I have bit off more than I can chew and now Im in a world of hurt on the errors.
-
@ChrisW67 Thanks - I think you're right. I think because the pjsip compile is being done with a different version of msvc 2019 than the one Qt is using we have problems. Is there a way to configure Qt to use the installed MSVC instead of the bundled version? I tried adding a new kit but it does look like its compatible with QtCreator's setup.
Im using QtCreator for the compile.
I figured MSVC would be a better experience than ming64 for debugging purposes but maybe I have bit off more than I can chew and now Im in a world of hurt on the errors.
@Austin-K said in Qt 5.15.17 - Error: C3861 - guiddef.h(161): 'memcmp': identifier not found:
Is there a way to configure Qt to use the installed MSVC instead of the bundled version?
There is no "bundled version" of the Microsoft toolchain. The
qmake
in a given set Qt libraries will generate a Makefile suitable for the set of tools that built the library. When you establish a Kit in Qt Creator, you are pointing it a specific set of Qt libraries and, by extension, set of compiler tools.In the case of Qt libraries built with MSVC 2015, you should be able to use that version or any later MSVC (they remain binary compatible AFAICT). You can see what compiler it will try to use in the Kit definition.
-
Well ive upgraded the entire stack to use the bundled version of mingw810_64, all components are now using the qt mingw toolchain bundled with Qt 5.15.
The good news is the compile is now successful. That bad news is the app does not run. qml doesnt work - qmlRegisterType crashes the app. Timers dont work. And non-stop segfaults.
Same app compiles fine and runs under osx just fine using the same version of Qt.
-
Ok so this was all resolved. It was important to get all libraries with the same version. OpenSSL, Mingw 64, etc etc all on the right versions and compiled. The OpenSSL version was important to match what Qt 5.15.17 was bundled with. This required custom compiles and everything worked.
-