qnx run error : Attempting to exec a shared lib - c

I managed to setup the Neutrino 6.5.0 RTOS in a virtual box and connect to it over qconn from Momentics IDE for Blackberry IDE 2.1.2 .....
I can get the system information perspective view for my Neutrino.
BUT
when I am trying to run my compiled application I am getting the errors :
Could not launch
Cannot find qnx launch process
and
Error starting remote application.
Target launcher#<192.168.56.101:8000>: Error: Attempting to exec a shared lib
SO I manually copied the executable file I compiled to the /tmp dir on my Neutrino virtual machine and run it using ./Test ,still get this error:
"/bin/sh: ./Test: Attempting to exec a shared lib"
I rechecked the project option and make sure that this is an Application output and not a shared library output type.
Any idea what am I doing wrong ?

I also encountered the same problem. Later, I found that the cross compiler was selected incorrectly. This error occurs when x86 programs are run on arm processors; Specify the correct compiler to solve the problem;

Related

Can't launch debug - C in VS code on Linux

Let me preface this, I am very new to linux and to working on a non-IDE based setup.
I am trying to debug a very simple C program using vs code version 1.55
I unloaded all modules beforehand, so vs code can load appropriate default gcc & gdb versions (which it did, GCC 8.2)
I am following the VS code getting started documentation for setting up and everything seems very straight forward until I try to debug.
I use the default settings as instructed, the file builds successfully but then I get the below
/usr/bin/gdb: symbol lookup error: /usr/bin/gdb: undefined symbol: PyUnicodeUCS4_FromEncodedObject
please note that I cannot rebuild python with ucs4 enabled as suggested in another thread as I have no root access. however I can change VS code version to an earlier one if this will help.
Thanks.
I think this issue is specific to my environment but I will post the answer anyway as it may face someone else.
So this for me was 2 separate issues:
First gdb doesn't start and second vs code can't start gdb.
To check if this is the case try to launch gdb from terminal (not vs code) by typing gdb in the terminal (after loading gdb if needed), I was receiving the error above
Solution to this part is this as T0maas thankfully suggested above
Steps for linux newbies:
ldd gdb (or /usr/bin/gdb) (with vs_code loaded)
from step one get the python library path
unload all modules
load gdb
LD_PRELOAD=<python path from 1>
bash -c "export LD_PRELOAD"
load vs_code
load gdb
After the above steps writing gdb in the terminal should start gdb
Part 2:
The rest of the problem was when I tried to launch debugging session through the GUI of vs_code (still produced the same error)
In the terminal (after loading gdb) type whereis gdb
For me this produced multiple directories the first of which was /usr/bin/gdb (this is the default used in vs_code launch.json)
Changing that directory in the launch.json file to a different one of the other directories solved the second part of the problem for me.

Termios.h error on linux, -lftdi error on windows. cross compiling

I am able to compile this for linux and run it on linux, but I would like to be able to run it on my windows machine as well.
https://github.com/bear24rw/rgb_table/tree/master/code/table_drivers/beat_finder
(is this allowed?)
When I try to cross compile it on my linux machine, I get an error saying Termios.h cannot be found. I read somewhere that termios.h and mingw don't work together. So then I spent hours downloading a few compiling tools for windows (on capped internet speeds) to try and make progress on windows since that's where I want to run the application anyway. I'm trying to use Cygwin now and when I try to compile it by making a few changes to the makefile to try and use
x86_64-pc-cygwin-gcc
I get
/usr/lib/gcc/x86_64-pc-cygwin/6.4.0/../../../../x86_64-pc-cygwin/bin/ld:
cannot find -lftdi
collect2: error: ld returned 1 exit status
make: *** [makefile:6: main] Error 1
I have used the package installer for cygwin but I only found ftdi1, but I did find the ftdi.h raw file on github and copied it to my usr/include folder. so I'm not sure what to do from here but I'd really like to get this code running on my windows machine as an .exe I just need to know which direction I should go in, trying to solve the termios.h error on the linux machine, or ftdi.h error on the windows machine.
When I try to cross compile it on my linux machine, I get an error saying Termios.h cannot be found.
That's because <termios.h> describes terminal handling functionality which doesn't exist on Windows. However, I don't see any code in main.c which would actually depend on termios functionality -- you can probably just remove that #include.
As far as -lftdi goes, ftdi1 should be the right library. Make sure you've installed the -dev package from Cygwin.

Gdbserver for Snow Leopard?

So I have this source gdb-1515. I'm using Xcode 3.2.6 command line tools on Snow Leopard (and this gdb source is the source of the gdb included in them).
Trying to run (inside /private/var/root/Downloads/gdb-1515/src/gdb/gdbserver):
gcc -I. -I. -I./../regformats -I./../macosx -I./../../include -I../../bfd -I./../../bfd -I/private/var/root/Downloads/gdb-1515/src/bfd ./../macosx/macosx-nat.c
Fails with:
./../macosx/macosx-nat.c:34:17: error: bfd.h: No such file or directory
./../macosx/macosx-nat.c:35:18: error: defs.h: No such file or directory
./../macosx/macosx-nat.c:36:21: error: gdbcore.h: No such file or directory
./../macosx/macosx-nat.c:37:20: error: serial.h: No such file or directory
./../macosx/macosx-nat.c:38:22: error: ser-base.h: No such file or directory
./../macosx/macosx-nat.c:39:22: error: ser-unix.h: No such file or directory
./../macosx/macosx-nat.c:40:22: error: inferior.h: No such file or directory
./../macosx/macosx-nat.c:41:23: error: objc-lang.h: No such file or directory
./../macosx/macosx-nat.c:42:21: error: infcall.h: No such file or directory
In file included from ./../macosx/macosx-nat-dyld.h:5,
Etc.
Thing is there is no bfd.h anywhere inside the gdb-1515 folder.
find /private/var/root/Downloads/gdb-1515 -name bfd.h
Returns no output.
I want to call attach_to_classic_process (defined inside macosx/macosx-nat.c) from gdbserver/macosx_low.c:476 instead of ptrace - that's why I'm trying to build macosx/macosx-nat.c from the gdbserver directory.
Currently at its place it's used ptrace which fails for rosetta processes.
Ok so I want to debug a classic (Rosetta) process running on Snow Leopard by using remote gdb connection.
It should be obvious cause after all Rosetta applications are using remote connection for debugging anyway.
Additionally gdb application can successfully connect with mentioned PowerPC applications.
I'm trying to compile gdbserver from this apple source however this is Aids - it seems that the way gdbserver included in this packages is fundamentally wrong since the original gdb is using special functions to establish connection to classic process while gdbserver is trying to use ptrace which obviously fails.
Another thing that comes into my mind is why the hell gdbserver has to be so retardedly complicated - why isn't directly co-operating with the functional gdb command line application (maybe a wrapper of sorts)?

Sleuthkit -- Error while loading shared libraries

After successfully building and compiling sleuthkit library [4.2 version], I tried to write an introspection tool using the library.. Thing is whenever i am trying to compile the program in order to test it and I am using a function from the library API I'm get the following error :
error while loading shared libraries: libtsk.so.13: cannot open shared object file: No such file or directory
I found thought that this file exists in /usr/local/lib folder . Am i missing something ? ./configure && make didn't give me any errors.. and I am including -ltsk on the makefile!
My pc information : XEN hypervisor [Ubuntu 12.04 x64bit] and i am trying to investigate a guest vm running ubuntu 12.04 x32bit
Thanks in advance
I found a solution to the problem , if I install -dev package...
sudo apt-get install libtsk-dev
Also read this useful article... Understood why exactly that happened .

Error while loading shared libraries - Using CUnit on Netbeans

I am a newbie working with Cygwin and CUnit. I have to develop some Unit Tests using CUnit and Netbeans and I have followed the next tutorial:
https://netbeans.org/kb/docs/cnd/c-unit-test.html?print=yes#project
At the end, when I was trying to run the first example test I got stocked by an error:
0 [main] make 4380 C:\cygwin\bin\make.exe: *** fatal error - error while loading shared libraries: /cygdrive/C/Program Files/NetBeans 8.0.2/ide/bin/nativeexecution/Windows-x86_64/unbuffer.dll: cannot open shared object file: Exec format error
448 [main] make 4380 open_stackdumpfile: Dumping stack trace to make.exe.stackdump
I don't know if this has relation to the Cygwin version I have, I have a computer running Windows 7 Enterprise 64bits edition. I have configured my C project to use Cygwin 64bits edition...
Could you please share any idea about how I can solve this?
Thanks!
I had a similar issue, but in my case I was trying to run CppUnit tests in Netbeans. I was using make provided by MSYS2 and it was failing to load unbuffer.dll, but error was "No such file or directory". I switched the make from MSYS2 for the one found in MSYS and the error went away. You could try this as a workaround.
I found sole here:
https://bz.apache.org/netbeans/attachment.cgi?id=164026&action=edit
Need download new version of unbuffer.dll.
Yar

Resources