Function glGetString not found during explicit linking [duplicate] - linux

This question already exists:
gladLoadGLLoader() fails because glGetString is not found [closed]
Closed 3 years ago.
As it seems to be a larger problem to understand my question: It is NOT about any source code or programming implementation, it is about linking an existing and working program! So let me try that again:
I have an application which runs on both, Windows and Linux and makes use of the GLAD-wrapper for OpenGL. (For all the people which never heard about GLAD: is is a wrapper around OpenGL/MESA which ensures proper symbol loading for a defined subset/version of OpenGL). It works smoothly for Windows but recently I found it is not working for Linux any more (Ubuntu 18.04 LTS to be more specific).
The problem is: the call to
glGetString = (PFNGLGETSTRINGPROC)load("glGetString");
in function gladLoadGLLoader() returns NULL, means the library function glGetString can't be found any more. To clarify this too: not the function glGetString() is returning NULL, when trying to retrieve a function pointer to glGetString the NULL is returned as the function could not be found for some reason.
So my question is: what Linux-library would provide the function glGetString()?
Thanks!

Related

MFC GetParent function returns null

Hello there back in 1999 early 2000 a lot of my apps used this MFC Export dialog extension which added filters to file extensions, because MFC didn't yet have that (at least that's what I remember to be the reason, maybe I was drunk I don't now), the library can be downloaded here: https://www.codeproject.com/Articles/54/Adding-filters-to-the-Open-File-dialog
Now I know that this functionality is built in already, but its easier to fix one library then to fix all of my apps
Now if I compile this with VC++ 6 everything is fine, the problem is that I would like to use a bit more modern compiler
Here are my changes that I added to this lib over the years (its a big file so I will post a link instead): https://pastebin.com/pj0j2nL4
The example code that I use to test this library can be found here: https://www.mediafire.com/file/xz5mxwy2rcmb9h3/FileExportDialog_demo_upg.zip/file
Just click on File->Export and you should see the problem
Now the problem happens on the library's void CFileExportDialog::OnTypeChange() method
is this part
CWnd *fileNameBox = GetParent()->GetDlgItem(edt1);
if (fileNameBox == NULL)
fileNameBox = GetParent()->GetDlgItem(cmb13);
For some reason, GetParent() returns NULL (I cannot even get to GetDlgItem() at this point)) pointer, I have no idea why does it do that, and the strangest thing is that this used to work on VC++ 6 (it also worked on MFC7 as well), why doesn't it work on VC++ 17 (MFC140) anymore ?
Hopefully someone has an idea what changed and how can I fix my library
Thanks for Anwsering and Best Regards

Problems building wxwidgets in cygwin

I followed all the instructions provided in the docs/msw/install.txt file for building wxWidgets 3.0.2 using cygwin with all the necessary tools installed.
And even after using the configure script with all the different possible options.
But still it doesn't build properly.The configure script executes correctly but when i use make it shows me this error.
Error:
cannot convert ‘wxString’ to ‘const void*’ for argument ‘2’ to ‘ssize_t cygwin_conv_path(cygwin_conv_path_t, const void*, void*, size_t)’
cygwin_conv_path(CCP_POSIX_TO_WIN_W, strDir, windowsPath, MAX_PATH);
If any one can help me on this i will highly appreciate it.
Thank you.
First of all, are you absolutely sure that you really want to use the Cygwin port of wxWidgets? This is almost never a good idea and it's strongly recommended to use Cygwin as the build environment for building the native MSW port using MinGW (cross-)compiler as explained in this post.
If you really do need Cygwin, it looks like you need to insert .c_str() call here, i.e. write cygwin_conv_path(CCP_POSIX_TO_WIN_W, strDir.c_str(), windowsPath, MAX_PATH), as you're probably using --enable-stl and the implicit conversion is not available.

VC++ EXE standalone has bugs that don't happen in IDE

My program has a very specific error that took me a while to track down - now I don't know how to fix it. My code is very long and in many files and I don't see much point in posting it here.
In the IDE, everything runs fine, in both Debug and Release (with the runtime library set to either /MTd or /MT, respectively, so I'm assuming all dependencies are included).
However, when I run the standalone, I get a crash. At first I thought it was a dependency problem but it doesn't seem so.
At some point in the code, I am accessing a vector via a method call: t->GetList(), where GetList is defined as std::vector<T*> & GetList() and the method simply returns a member variable (simply defined as std::vector<T*> field in the class).
It turns out, if I print out the size of the list while running from the IDE, I get 0 (which is the correct answer in this case).
However, when doing the same thing running from standalone, I get the size as 467467353.
I tried changing the method declaration to std::vector<T*> * GetList() and doing return &field; and updating the rest of the code but this didn't fix anything.
I then tried replacing the member variable field with a pointer, and in the constructor instantiating a new vector and deleting it in the destructor. Still no luck.
So I made a simple test case program that simply made a class with a vector field, and a method to return a reference to it. Then in main I would create an instance variable and getting the vector and printing the size. This worked both in VC++ and as a standalone - both returned zero.
This is driving me nuts and I can't figure out why I'm getting different behaviour. Why is the standalone running differently, and what should I be looking at to fix this?
Thanks
Okay so it was literally a bug in my code that was very well hidden. I was dynamically casting to a wrong type.
Somehow it slipped past when I was running on Windows and OSX in both Debug and Release, and as a standalone on OSX. Good thing I found it.

Android: Cannot load library

I am facing a situation of which I have no idea. I am tried to test one method that I have implemented in C++ and I used swig to generate the wrapper. After compilation, when I tried to run the application, I got an error java.lang.UnsatisfiedLinkError.
It further states that
cannot load library:reloc_library[1311]:33
cannot locate '_Z13recognizeFacePKcS0_'
...
and suddenly throw exception.
I tried using adb shell to debug and found library in the right location (data/data/com/mesh/faceAuth/lib/libfaceAuth.so) but it gives the same error. I also read from this site, that it has to do with wrong STL implementation which I don't have any clue of. I will highly appreciate your candid suggestion.
Regards,
Mohammed.
Best guess with what information you have provided, The library you are trying to load needs some dependencies to be loaded before it.
For example:
System.loadLibrary("bullet");
System.loadLibrary("irrlicht");
System.loadLibrary("gamescript");
gamescript library needs other 2 library to be loaded before it. Otherwise, it gives me the same error you have mentioned. I can dig further on this issue if you can post some part of your .mk file for building the library here.
Your error has nothing to do with STL.
You probably reference a global function ::recognizeFace(char const*, char const*) in your code. Maybe, you have another function defined, for example recognizeFace(char*, char*).

How does cocoa's obsolete CGSCStringValue function actually work?

I've been using CGSPrivate.h for cocoa development under MacOSX for a while. I'm now using it under Lion (10.7.x), and it turns out that the CGSCStringValue() function described in that file no longer exists under that OS version.
I want to make use of the functionality of CGSCStringValue() -- i.e., converting a CGSValue to its associated char* when appropriate -- and I'm wondering if anyone knows how that function is actually implemented.
I've tried various forms of casting of the CGSValue, but to no avail. So could anyone point me to some documentation or actual cocoa code that runs in 10.7 which will take a CGSValue that's associated with a string as input and return its char* equivalent?
Thanks in advance.
It's implemented by checking the type (to make sure it's really a CFString) and calling CFStringGetCString(). You can do that yourself, there is no real need for CGSCStringValue.

Resources