As mentioned in the first answer to the post
"Win32 API stack walk with MinGW/MSYS?"
dlltool can be used to generate an import library for MinGW.
But the below command just prints "Create Process" on the screen and generates a 0KB dbghelp.a file
dlltool -k -d libdbghelp.def -l dbghelp.a
I used the .def file available here:
http://sourceforge.net/p/mingw/feature-requests/40/?limit=10&page=1#54a9
The first few lines of the .def file are
; File generated automatically from ./dbghelp.spec; do not edit!
LIBRARY dbghelp.dll
EXPORTS
EnumDirTree#24 #3
EnumDirTreeW#24 #4
EnumerateLoadedModules#12 #5
EnumerateLoadedModules64#12 #6
Am I missing something? I am currently using MinGW version 4.4.1
I see that a header file dbghelp.h is also available in the page where I found libdbghelp.def . Where should this be placed?
Also any limitation on the location from where this tool has to be run. I have currently copied the .def file to the same directory as dlltool and executed the command.
Regards,
Shreyas
The problem was with MinGW 4.4.1 again. It works fine if I use 4.6.1.
Thank you.
Related
i am trying to run an executable in linux shell ( OpenELEC on raspberry pi )
OpenELEC:~ # /storage/fingi/usr/lib/autossh/autossh
-sh: /storage/fingi/usr/lib/autossh/autossh: not found
What does the "not found" in this case mean ?
If i try to do ldd:
OpenELEC:~ # ldd /storage/fingi/usr/lib/autossh/autossh
/usr/bin/ldd: eval: line 1: /storage/fingi/usr/lib/autossh/autossh: not found
And if i do file:
OpenELEC:~ # file /storage/fingi/usr/lib/autossh/autossh
/storage/fingi/usr/lib/autossh/autossh: ELF 32-bit LSB executable, ARM, EABI5 version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.26, BuildID[sha1]=599207c47d75b62ede5f214f9322ae2a18643eb7, stripped
The file type is in correct format . But it wont work adn wont give more descriptive error msg either.
Since openELEC is very restrictive, i had copied the autossh executable from a raspbmc installation . I have done it for several other executables as well ( screen , boost libraries etc ) and they work fine .
Can anyone suggest what might be the issue?
Edit 1:
as was suggested, this is the output of file command on an executable ( also copied from raspbmc ) that is working:
OpenELEC:~ # file /storage/fingi/usr/bin/screen
/storage/fingi/usr/bin/screen: ELF 32-bit LSB executable, ARM, EABI5 version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.26, BuildID[sha1]=5c58f047a25caa2c51a81d8285b4f314abc690e7, stripped
What does the "not found" in this case mean ?
This usually means that the executable cannot find one or more (shared) libraries to satisfy its external symbols.
This usually happens when no libraries are stored in the initramfs, or there is a shared library missing that the executable needs.
This can also happen if the executable is built with a C library that is incompatible with the runtime library, e.g. uClibc versus glibc/eglibc.
strings executable | less is the quickest way to see the required libraries and external symbols that the executable requires.
Or
Recompile your program and use static linking by specifying the -static option.
Check that the file has been set to executable permissions with ls -l if it hasn't change with chmod +x /storage/fingi/usr/lib/autossh/autossh
I'm trying to run AmazonFreeRTOS on my ESP32 (at Windows). After creating build folder in my amazon-freertos main folder I've tried to build it from main folder with
cmake --build .\build
The Error I've got is
include could not find load file: targets
However, there is a idf_functions.cmake file that contains include(targets) command, and the targets.cmake file is in the same folder so I don't know why the error occured.
If you pay close attention to the error, you'd notice the full error says something like:
CMake Error at
your-amazon-freertos-directory/vendors/espressif/esp-idf/tools/cmake/idf_functions.cmake: 26 (include)
include could not find load file:
targets
This is because idf_functions.cmake sets the variable IDF_PATH to $ENV{IDF_PATH} which was configured in ~/.profile when the line export IDF_PATH=~/esp/esp-idf was added, as seen here.
If you navigate to ~/esp/esp-idf/tools/cmake/ you'd notice that files like target.cmake and ldgen.cmake, which are being included <your-amazon-freertos-directory>/vendors/espressif/esp-idf/tools/cmake/idf_functions.cmake, do not exist.
Solution 1 (somewhat hacky):
Copy the contents of <your-amazon-freertos-directory>/vendors/espressif/esp-idf/tools/cmake/ to ~/esp/esp-idf/tools/cmake/
Solution 2:
Modify the ~/.profile file to add the following lines instead of that suggested in the guide:
export IDF_PATH=~/<your-amazon-freertos-directory>/vendors/espressif/esp-idf/
export PATH="$PATH:$IDF_PATH/tools"
This should circumvent any CMake include errors during generation of build files and during build.
Since Amazon FreeRTOS supports many different platforms in addition to ESP32, you might need to supply additional commands to tell CMake that ESP32 is the target you want to build.
Try using
cmake -DVENDOR=espressif -DBOARD=esp32_wrover_kit -DCOMPILER=xtensa-esp32 -S . -B your-build-directory
from your top level folder to generate your makefiles into the build folder, and then switching to your build folder and calling
make all
(From the "Build, Flash, and Run the Amazon FreeRTOS Demo Project" section of
https://docs.aws.amazon.com/freertos/latest/userguide/getting_started_espressif.html)
I want to use the freertos_demo that is part of StellarisWare /TivaWare in combination with wolfSSL library but I find it difficult to read the Makefile (actually the makedefs files).
I downloaded and compiled wolfSSL according to the manual. Now in /usr/local/lib there are the following files:
/usr/local/lib//libwolfssl.la
/usr/local/lib//libwolfssl.so
/usr/local/lib//libwolfssl.so.3
/usr/local/lib//libwolfssl.so.3.1.0
Now I open makedefs from the StellarisWare root directory and added the folling code to line 160:
LIBS=-lwolfssl
Further, I modified lines 246 and 252 which now state the following (both lines are identical; basically I only added '${LIBS}' ):
'${LIBM}' '${LIBC}' '${LIBGCC}' '${LIBS}';
However, when I go to the blinky sub-directory and perform a "make clean; make", I get the following error:
arm-none-eabi-ld: cannot find -lwolfssl
What am I missing?
Best
per the suggestion from #nettrino it looks like /usr/local/lib is not in your system LD_LIBRARY_PATH variable. You could confirm this from a terminal by using this command
echo $LD_LIBRARY_PATH
Do you see /usr/local/lib? If not you can do one of two things.
Option 1: Follow #nettrino's intended suggestion and in the Makefile change the line:
LIBS=-lwolfssl
to
LIBS=-L/usr/local/lib -lwolfssl
Option 2: Edit your .bash_profile (or .bashrc) and add the line:
export LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:/usr/local/lib"
Then reload the terminal to get the updated changes or use the command
source .bash_profile
(or source .bashrc depending on which one you edited)
Then try the same echo command again and do you now see /usr/local/lib
in the LD_LIBRARY_PATH?
I've tried official howto but failed. I got error:
"The procedure entry point InterlockedCompareExchange#12 could not be located in the dynamic link library libstdc++-6.dll"
The problem was due the old gcc compiler, bundled with DevKit from rubyinstaller.org (4.5 vs 4.8 on my PC). Use MSYS instead. Assume we have zeromq source inside D:\libs\zeromq, then the procedure is:
Download GUI MinGW installer.
Install base and MSYS (if you already have working gcc compiler you probably only need MSYS).
Launch MSYS environment by executing C:\MinGW\msys\1.0\msys.bat.
Follow Using MSYS with MinGW section:
mount c:/mingw /mingw
cd /d/libs/zeromq
./configure --prefix=/mingw
make
Copy /d/libs/zeromq/src/.libs/libzmq.dll to your desired place.
In fact I needed to use ZeroMQ with C++, so I downloaded zmq.hpp, moved it to include directory, and compiled hwserver.cpp to test it:
C:\MinGW\bin\g++.exe -o hwserver hwserver.cpp -L. -lzmq -ID:\libs\zeromq\include
It worked, but when I launch it I got:
Assertion failed!
Program: D:\tmp\zmq\hwserver.exe
File: D:\libs\zeromq\include/zmq.hpp, Line 280
Expression: rc == 0
This application has requested the Runtime to terminate it in an unusual way.
Please contact the application's support team for more information.
I've managed to get rid of this failure by commenting lines 279, 280. Similar issue
Is there any way to Link a custom library with pkg-config?
For example:
'pkg-config --cflags --libs mono-2'
but putting mono 2.8 files in a custom directory.I expect somthing like :
'pkg-config --cflags --libs ./mono.pc'
$ man pkg-config
In addition to specifying a package name on the command line, the full
path to a given .pc file may be given instead. This allows a user to
directly query a particular .pc file.
So yes, what you posted should work. Did you try it? Did you get an error? What version of pkg-config? (mine is 0.26)
Alternatively, you can list additional package directories using the PKG_CONFIG_PATH environment variable.