OpenGL/glew unresolved external symbols - glew

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

Related

Cannot run a r package in python

I want to use the R package 'grpreg'. However, I do not want to run it in R. Instead, I want to run the package under python. I have searched that I need to install the package rpy2, which allows me to run an R package under python. After installing rpy2, I enter
> `from rpy2.robjects.packages import importr`
> `base=importr('grpreg')`
Unfortunately, I obtain the error messages:
R[write to console]: Error: package or namespace load failed for 'grpreg' in inDL(x, as.logical(local), as.logical(now), ...):
unable to load shared object 'C:/Program Files/R/R-4.1.3/library/stats/libs/x64/stats.dll':
LoadLibrary failure: The specified module could not be found.
R[write to console]: Error in inDL(x, as.logical(local), as.logical(now), ...) :
unable to load shared object 'C:/Program Files/R/R-4.1.3/library/stats/libs/x64/stats.dll':
LoadLibrary failure: The specified module could not be found.
Traceback (most recent call last):
File "C:\Users\willi\AppData\Local\Temp\ipykernel_27800\977170058.py", line 1, in <module>
base=importr('grpreg')
File "C:\Users\willi\anaconda3\envs\fun_regression_3.7\lib\site-packages\rpy2\robjects\packages.py", line 485, in importr
return package.__rdata__
File "C:\Users\willi\anaconda3\envs\fun_regression_3.7\lib\site-packages\rpy2\rinterface_lib\conversion.py", line 45, in _
File "C:\Users\willi\anaconda3\envs\fun_regression_3.7\lib\site-packages\rpy2\rinterface.py", line 810, in __call__
RRuntimeError: Error in inDL(x, as.logical(local), as.logical(now), ...) :
unable to load shared object 'C:/Program Files/R/R-4.1.3/library/stats/libs/x64/stats.dll':
LoadLibrary failure: The specified module could not be found.
I would like to know how to fix the problem.

Cannot load genefilter package from library

So I try to load by library(genefilter)
But I keep getting the error:
Error: package or namespace load failed for ‘genefilter’ in inDL(x, as.logical(local), as.logical(now), ...): unable to load shared object 'C:/Users/Jerry Yu/Documents/R/win-library/4.0/Rcpp/libs/x64/Rcpp.dll': LoadLibrary failure: The specified procedure could not be found.
I have already tried removing and reinstalling genefilter, but nothing has worked.

Qt, WIndows and OpenSSL - Cannot Call Unresolved Function xyz

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.

mediawiki installing R error

I am trying to get extension R to work with mediawiki but have run into a roadblock with the following error:
REngine.php: sh: /usr/bin/R: No such file or directory
Does anyone know how to correct this issue? If I look at mediawiki/Special:Version, I can see R listed under extensions as version 0.14, but if I try to use <R>1:10</R> it throws that error.
After the comment to add a symlink below I was able to get a little further. I added the following symlink to my brew installation of R:
ln -s /usr/local/Cellar/r/3.1.2_1/R.framework/Versions/3.1/Resources/bin/R /usr/bin/R
and this was the output:
REngine.php: Error in dyn.load(file, DLLpath = DLLpath, ...) :
unable to load shared object '/usr/local/Cellar/r/3.1.2_1/R.framework/Versions/3.1/Resources/library/grDevices/libs/grDevices.so':
dlopen(/usr/local/Cellar/r/3.1.2_1/R.framework/Versions/3.1/Resources/library/grDevices/libs/grDevices.so, 6): Symbol not found: __cg_jpeg_resync_to_restart
Referenced from: /System/Library/Frameworks/ImageIO.framework/Versions/A/ImageIO
Expected in: /mediWiki/common/lib/libJPEG.dylib
in /System/Library/Frameworks/ImageIO.framework/Versions/A/ImageIO
Error in dyn.load(file, DLLpath = DLLpath, ...) :
unable to load shared object '/usr/local/Cellar/r/3.1.2_1/R.framework/Versions/3.1/Resources/library/grDevices/libs/grDevices.so':
dlopen(/usr/local/Cellar/r/3.1.2_1/R.framework/Versions/3.1/Resources/library/grDevices/libs/grDevices.so, 6): Symbol not found: __cg_jpeg_resync_to_restart
Referenced from: /System/Library/Frameworks/ImageIO.framework/Versions/A/ImageIO
Expected in: /mediWiki/common/lib/libJPEG.dylib
in /System/Library/Frameworks/ImageIO.framework/Versions/A/ImageIO
In addition: Warning message:
package 'grDevices' in options("defaultPackages") was not found
Error in dyn.load(file, DLLpath = DLLpath, ...) :
unable to load shared object '/usr/local/Cellar/r/3.1.2_1/R.framework/Versions/3.1/Resources/library/grDevices/libs/grDevices.so':
dlopen(/usr/local/Cellar/r/3.1.2_1/R.framework/Versions/3.1/Resources/library/grDevices/libs/grDevices.so, 6): Symbol not found: __cg_jpeg_resync_to_restart
Referenced from: /System/Library/Frameworks/ImageIO.framework/Versions/A/ImageIO
Expected in: /mediWiki/common/lib/libJPEG.dylib
in /System/Library/Frameworks/ImageIO.framework/Versions/A/ImageIO
In addition: Warning message:
package 'graphics' in options("defaultPackages") was not found
During startup - Warning message:
package 'stats' in options("defaultPackages") was not found
<!--- Start of program --->
[1] 1 2 3 4 5 6 7 8 9 10
<!--- End of program --->
Error: could not find function "dev.cur"
Execution halted
Also the code I hae on the mediawiki page is:
Test
<R>1:10</R>

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