Failed to dlsym make_ device: undefined symbol: make_ device
Recently, I encountered some bugs when doing development. I have been troubled for a long time. Although I am a good cook, I think I can accumulate it. When I encounter the same type of problems in the future, I have a way to solve the problems. The problem is as follows: Android recovery system can do some basic test demo below. But this latest demo is developed by C + + and C language. Some functions need to rely on dynamic libraries, such as librecovery_ UI. So, but there is a special library called librecovery_ ui.recovery.so。 At that time, using the find command, we could find the generation location of the library. However, when using grep to find the generation location of the dynamic library, we couldn’t find it. We only found the calling location. For a time, we doubted whether we had made a mistake. Finally, we searched under the general system root directory. Finally, we kept printing a lot of messy code under the out subdirectory, thinking it was a program crash, It’s time for ^ C to end the process. But in the end, no matter how many, just let it collapse. Finally, we found the location of the Library under the out directory. It turned out that it was an automatically generated MK file, in which many concise generation dependent library scripts were used. Finally, we found the location of the so.
Then I met the problem on the topic, that is, how can the so library compiled according to the correct android.mk script file not find the defined library when using dlopen call?I wonder if there is a problem with the function, and then I wrote a new function to test the call, and found it still can’t work, Failed to dlsym FN: undefined symbol: test is also displayed. Then I searched the Internet and found that most people said that they needed to add extern “C” to the function. Finally, according to what I said on the Internet, I found that it was still not possible. Finally, I asked my colleagues and got the answer to the question, which is to use the nm command of Linux to find the dynamic library or the static library that contains the functions that can be called. Finally, I found that the dynamic library that I passed to the board did not have the make that I wanted to call_ Then use the find command to find two. So libraries with the same name. Finally, find the function body to be called in another library. Finally, transfer another. So library to the board. Finally, it is successful.
Read More:
- Ubuntu cannot access USB device, failed to create a proxy device for the USB device
- Tensorflow 2.1.0 error resolution: failed call to cuinit: CUDA_ ERROR_ NO_ DEVICE: no CUDA-capable device is detected
- device no response, device descriptor read/64, error -71
- Solutions to the problem of “symbol lookup error xxxxx, undefined symbol”
- When Linux installs redis, it executes make install and reports an error: Make: * * [server. O] error 1 (solved)
- .. ld: symbol(s) not found for architecture x86_64 collect2: ld returned 1 exit status make[2]: ***
- ExecutableNotFound: failed to execute [‘dot’, ‘-Tsvg’], make sure the Graphviz executables are on yo
- Failed to install ISKernel Files,make sure you have appropriate privileges on this machine
- Error: pngquant failed to build, make sure that libpng-dev is installed
- dnet: Failed to open device lo0
- Failed to mount / cache (no such device)
- “DNET: failed to open device eth1” error resolution of nmap
- VirtualBox failed to start virtual machine – ntcreatefile (\ device \ \ vboxdrvsstub)
- App installation failed.could not write to the device.
- Failed to add /run/systemd/ask-password to directory watch: No space left on device?
- Resolved failed call to cuinit: CUDA_ ERROR_ NO_ DEVICE
- [solved] DNET: failed to open device eth5
- warning failed to connect to lvmetad,falling back to device scanning.
- Solve runtimeerror: reduce failed to synchronize: device side assert triggered problem
- The apple mobile device service failed to start. Error 1053 is resolved