Qt, WIndows and OpenSSL - Cannot Call Unresolved Function xyz - qt

I've recently installed the ArcGIS Runtime SDK on my Windows 10 machine running Qt 5.9.1. When attempting to build a simple QWidget application using one of the ArcGIS templates, I get the following errors:
qt.network.ssl: QSslSocket: cannot call unresolved function SSLv23_client_method
qt.network.ssl: QSslSocket: cannot call unresolved function SSL_CTX_new
qt.network.ssl: QSslSocket: cannot call unresolved function SSL_library_init
qt.network.ssl: QSslSocket: cannot call unresolved function ERR_get_error
qt.network.ssl: QSslSocket: cannot call unresolved function ERR_get_error
qt.network.ssl: QSslSocket: cannot call unresolved function SSLv23_client_method
qt.network.ssl: QSslSocket: cannot call unresolved function SSL_CTX_new
qt.network.ssl: QSslSocket: cannot call unresolved function SSL_library_init
qt.network.ssl: QSslSocket: cannot call unresolved function ERR_get_error
qt.network.ssl: QSslSocket: cannot call unresolved function ERR_get_error
qt.network.ssl: QSslSocket: cannot call unresolved function SSLv23_client_method
qt.network.ssl: QSslSocket: cannot call unresolved function SSL_CTX_new
qt.network.ssl: QSslSocket: cannot call unresolved function SSL_library_init
qt.network.ssl: QSslSocket: cannot call unresolved function ERR_get_error
qt.network.ssl: QSslSocket: cannot call unresolved function ERR_get_error
qt.network.ssl: QSslSocket: cannot call unresolved function SSLv23_client_method
qt.network.ssl: QSslSocket: cannot call unresolved function SSL_CTX_new
qt.network.ssl: QSslSocket: cannot call unresolved function SSL_library_init
qt.network.ssl: QSslSocket: cannot call unresolved function ERR_get_error
qt.network.ssl: QSslSocket: cannot call unresolved function ERR_get_error
qt.network.ssl: QSslSocket: cannot call unresolved function SSLv23_client_method
qt.network.ssl: QSslSocket: cannot call unresolved function SSL_CTX_new
qt.network.ssl: QSslSocket: cannot call unresolved function SSL_library_init
qt.network.ssl: QSslSocket: cannot call unresolved function ERR_get_error
qt.network.ssl: QSslSocket: cannot call unresolved function ERR_get_error
This problem seems to be quite common-place however most of the Google results come up with answers for Linux systems.
I have done the following:
Downloaded and installed OpenSSL (from GnuWin32 OpenSSL)
Copied across the libeay32.dll and libssl32.dll to the build folder
Added the include path into the Qt pro file
Verified that network is in the QT += config section of the pro file
Yet none of the above has made any difference. I'm running MSVC 2015 32-bit kit.

you have to add static libraries to your project.
Find out libeay32.lib and libssl32.lib and add them to your project.
Refer
http://doc.qt.io/qtcreator/creator-project-qmake-libraries.html

I think you need such two dll files:libeay32.dll and ssleay32.dll.I use the same version qt as you do,so you can download them from here or directly get the zip from here (which works for me).
Different version openssl lib used by Qt,so you should test it in you code using static function below if you are not sure about it:
QSslSocket::sslLibraryBuildVersionString();

If somebody else comes across this question, notice that since version 1.1.0 OpenSSL have changed their library names from:
libeay32.dll -> libcrypto.dll
ssleay32.dll -> libssl.dll
So you will need to include those two files with your project in order for QSsl functions to work.

Related

Unable to load some packages; R looking for gcc in old directory

I'm having an issue will installing/ loading some packages in R. When I try to do so, I get the following error:
> library(asreml)
Error: package or namespace load failed for ‘asreml’:
.onLoad failed in loadNamespace() for 'asreml', details:
call: dyn.load(file, DLLpath = DLLpath, ...)
error: unable to load shared object '/Library/Frameworks/R.framework/Versions/4.2-arm64/Resources/library/asreml/libs/asreml.so':
dlopen(/Library/Frameworks/R.framework/Versions/4.2-arm64/Resources/library/asreml/libs/asreml.so, 0x0006): Library not loaded: '/opt/homebrew/opt/gcc#11/lib/gcc/11/libgfortran.5.dylib'
Referenced from: '/Library/Frameworks/R.framework/Versions/4.2-arm64/Resources/library/asreml/libs/asreml.so'
Reason: tried: '/opt/homebrew/opt/gcc#11/lib/gcc/11/libgfortran.5.dylib' (no such file), '/usr/local/lib/libgfortran.5.dylib' (no such file), '/usr/lib/libgfortran.5.dylib' (no such file)
The last time I had this issue, I uninstalled and reinstalled the package, and that solved the problem. This time, however, that isn't working. I believe the issue is that it's looking for gcc in
/opt/homebrew/opt/gcc#11/
but 12 is my most current version. HOWEVER, both
/opt/homebrew/opt/gcc#11/
and
/opt/homebrew/opt/gcc#12/
link to
../Cellar/gcc/12.2.0
So I'm not even sure if redirecting it would solve the issue. Any ideas? Thanks!

Installing RcppArmadillo in R

i'm having this error when trying to install RcppArmadillo in R, and is driving me crazy, i've not been able to find how to deal with it:
Error: package or namespace load failed for ‘RcppArmadillo’ in dyn.load(file, DLLpath = DLLpath, ...):
unable to load shared object '/Users/Ghost/Rlibs/00LOCK-RcppArmadillo/00new/RcppArmadillo/libs/RcppArmadillo.so':
dlopen(/Users/Ghost/Rlibs/00LOCK-RcppArmadillo/00new/RcppArmadillo/libs/RcppArmadillo.so, 6): Symbol not found: _wrapper2_ddot_
Referenced from: /Users/Ghost/Rlibs/00LOCK-RcppArmadillo/00new/RcppArmadillo/libs/RcppArmadillo.so
Expected in: flat namespace
in /Users/Ghost/Rlibs/00LOCK-RcppArmadillo/00new/RcppArmadillo/libs/RcppArmadillo.so
Error: loading failed
Any insights/advice on how to fix it?
Something is not quite right with your setup. As a possible workaround, define ARMA_DONT_USE_WRAPPER before including RcppArmadillo in your code.
#define ARMA_DONT_USE_WRAPPER
#include <RcppArmadillo.h>

Failed loading rJava.dll using Rscript

I run R 3.0.1 through Eclipse and have no problem. I tried to execute some of my R scripts using Rscript.exe but i get the following error:
Error : .onLoad failed in loadNamespace() for 'rJava', details:
call: inDL(x, as.logical(local), as.logical(now), ...)
error: unable to load shared object 'H:/R/R-3.0.1/library/rJava/libs/x64/rJava.dll':
LoadLibrary failure: The specified path is invalid.
I have checked and the DLL exists in the directory.
Do you have any suggestion?
Thanks.
Regards
Solved by Adding
if (Sys.getenv("JAVA_HOME")!="")
Sys.setenv(JAVA_HOME="")

OpenGL/glew unresolved external symbols

I am having issues with glew and linker errors. I have:
put glew32.dll and glew32d.dll in system, System32 and SysWOW64
put glew.h in GL folder
put glew32.lib, glew32d.lib, glew32s.lib in Lib folder
put glew32.lib, glew32d.lib, glew32s.lib, glut32.lib, opengl32.lib in Additional Dependencies
put GLEW_STATIC in preprocessor defintions
However, I am still getting the following errors:
1>project2.obj : error LNK2001: unresolved external symbol ___glewGetProgramInfoLog
1>project2.obj : error LNK2001: unresolved external symbol ___glewGetShaderInfoLog
1>project2.obj : error LNK2001: unresolved external symbol ___glewGetProgramiv
1>project2.obj : error LNK2001: unresolved external symbol ___glewGetShaderiv
1>project2.obj : error LNK2001: unresolved external symbol ___glewIsShader
1>project2.obj : error LNK2001: unresolved external symbol ___glewGetUniformLocation
1>project2.obj : error LNK2001: unresolved external symbol ___glewLinkProgram
1>project2.obj : error LNK2001: unresolved external symbol ___glewAttachShader
1>project2.obj : error LNK2001: unresolved external symbol ___glewCreateProgram
1>project2.obj : error LNK2001: unresolved external symbol ___glewCompileShader
1>project2.obj : error LNK2001: unresolved external symbol ___glewShaderSource
1>project2.obj : error LNK2001: unresolved external symbol ___glewCreateShader
1>project2.obj : error LNK2001: unresolved external symbol ___glewEnableVertexAttribArray
1>project2.obj : error LNK2001: unresolved external symbol ___glewVertexAttribPointer
1>project2.obj : error LNK2001: unresolved external symbol ___glewBufferData
1>project2.obj : error LNK2001: unresolved external symbol ___glewBindBuffer
1>project2.obj : error LNK2001: unresolved external symbol ___glewGenBuffers
1>project2.obj : error LNK2001: unresolved external symbol ___glewBindVertexArray
1>project2.obj : error LNK2001: unresolved external symbol ___glewGenVertexArrays
1>project2.obj : error LNK2001: unresolved external symbol ___glewUniformMatrix3fv
1>project2.obj : error LNK2001: unresolved external symbol ___glewUniformMatrix4fv
1>project2.obj : error LNK2001: unresolved external symbol ___glewUniform3f
1>project2.obj : error LNK2001: unresolved external symbol ___glewUniform1f
1>project2.obj : error LNK2001: unresolved external symbol ___glewUseProgram
Is there something obvious I am missing? Is there something else I can try? Thanks.
If you're using the static library glew32s.lib you need to define the preprocessor flag GLEW_STATIC in order for you to resolve the symbols.
You can do this either in-source with
#define GLEW_STATIC
or add it to your pre-processor directives for the project
Project Properties > C/C++ > Preprocessor > Preprocessor Definitions
If you still have unresolved external symbols afterwards you may also need to
add opengl32.lib as an additional dependency for the linker.
If after that you are still having unresolved symbols regarding glew, make sure you actually have it's .lib added to a library directory that your linker searches in. You can add that in
Project Properties > Linker > General > Additional Library Directories

UPnP Library for Qt WinCE

I am trying to write DLNA project in Qt WinCE. Is there any UPnP library for it?
I am now trying CyberLink C library. But, it only has wrapper for Objective-C.
I got some configuration errors while trying to translate Objective-C wrapper to Qt WinCE wrapper.
Errors:
Error 1 error LNK2019: unresolved external symbol GetAdaptersInfo referenced in function cg_net_gethostinterfaces cyberlinkc.lib QtUpnp
Error 2 error LNK2019: unresolved external symbol freeaddrinfo referenced in function cg_net_selectaddr cyberlinkc.lib QtUpnp
Error 3 error LNK2001: unresolved external symbol freeaddrinfo cyberlinkc.lib QtUpnp
Error 4 error LNK2019: unresolved external symbol getaddrinfo referenced in function cg_net_selectaddr cyberlinkc.lib QtUpnp
Error 5 error LNK2001: unresolved external symbol getaddrinfo cyberlinkc.lib QtUpnp
Error 6 error LNK2019: unresolved external symbol ntohl referenced in function cg_net_selectaddr cyberlinkc.lib QtUpnp
Error 7 error LNK2019: unresolved external symbol WSAStartup referenced in function cg_socket_startup cyberlinkc.lib QtUpnp
Error 8 error LNK2019: unresolved external symbol WSACleanup referenced in function cg_socket_cleanup cyberlinkc.lib QtUpnp
Error 9 error LNK2019: unresolved external symbol setsockopt referenced in function cg_socket_setid cyberlinkc.lib QtUpnp
Error 10 error LNK2019: unresolved external symbol closesocket referenced in function cg_socket_close cyberlinkc.lib QtUpnp
Error 11 error LNK2019: unresolved external symbol recv referenced in function cg_socket_close cyberlinkc.lib QtUpnp
Error 12 error LNK2019: unresolved external symbol shutdown referenced in function cg_socket_close cyberlinkc.lib QtUpnp
Error 13 error LNK2019: unresolved external symbol listen referenced in function cg_socket_listen cyberlinkc.lib QtUpnp
Error 14 error LNK2019: unresolved external symbol getnameinfo referenced in function cg_socket_accept cyberlinkc.lib QtUpnp
Error 15 error LNK2019: unresolved external symbol getsockname referenced in function cg_socket_accept cyberlinkc.lib QtUpnp
Error 16 error LNK2019: unresolved external symbol accept referenced in function cg_socket_accept cyberlinkc.lib QtUpnp
Error 17 error LNK2019: unresolved external symbol send referenced in function cg_socket_write cyberlinkc.lib QtUpnp
Error 18 error LNK2019: unresolved external symbol recvfrom referenced in function cg_socket_recv cyberlinkc.lib QtUpnp
Error 19 error LNK2019: unresolved external symbol gethostbyname referenced in function cg_socket_tosockaddrin cyberlinkc.lib QtUpnp
Error 20 error LNK2019: unresolved external symbol inet_addr referenced in function cg_socket_tosockaddrin cyberlinkc.lib QtUpnp
Error 21 error LNK2019: unresolved external symbol htons referenced in function cg_socket_tosockaddrin cyberlinkc.lib QtUpnp
Error 22 error LNK2019: unresolved external symbol htonl referenced in function cg_socket_tosockaddrin cyberlinkc.lib QtUpnp
Error 23 error LNK2019: unresolved external symbol WSAGetLastError referenced in function cg_socket_getlasterror cyberlinkc.lib QtUpnp
Error 24 error LNK2019: unresolved external symbol bind referenced in function cg_socket_bind cyberlinkc.lib QtUpnp
Error 25 error LNK2019: unresolved external symbol socket referenced in function cg_socket_bind cyberlinkc.lib QtUpnp
Error 26 error LNK2019: unresolved external symbol connect referenced in function cg_socket_connect cyberlinkc.lib QtUpnp
Error 27 error LNK2019: unresolved external symbol sendto referenced in function cg_socket_sendto cyberlinkc.lib QtUpnp
Error 28 error LNK2019: unresolved external symbol XML_ParserFree referenced in function cg_xml_parse cyberlinkc.lib QtUpnp
Error 29 error LNK2019: unresolved external symbol XML_Parse referenced in function cg_xml_parse cyberlinkc.lib QtUpnp
Error 30 error LNK2019: unresolved external symbol XML_SetCharacterDataHandler referenced in function cg_xml_parse cyberlinkc.lib QtUpnp
Error 31 error LNK2019: unresolved external symbol XML_SetElementHandler referenced in function cg_xml_parse cyberlinkc.lib QtUpnp
Error 32 error LNK2019: unresolved external symbol XML_SetUserData referenced in function cg_xml_parse cyberlinkc.lib QtUpnp
Error 33 error LNK2019: unresolved external symbol XML_ParserCreate referenced in function cg_xml_parse cyberlinkc.lib QtUpnp
Please share some hints or sample codes.
Thanks
Is there any UPnP library for it?
You can try GUpnp
http://gupnp.org/downloads/gupnp-dlna-0.3.0
or try Developer Tools for UPnP to generate skeleton code
http://opentools.homeip.net/dev-tools-for-upnp

Resources