|
Quote: used TransparentBLT thank you all"
|
|
|
|
|
I am copying stuff from "quick answers" to here because it is no longer quick solution.
I am doing voluntarily and will comment / post in FRONT and if I get discussion going here I will delete "quick answers".
Last suggestion was to link to
libbluetooth-dev
Here is the SAME type of error - the library cannot be found.
I am deleting most of the post - it is no longer needed.
modified 19-Oct-21 11:56am.
|
|
|
|
|
You appear to be trying to cross compile a project for a Raspberry Pi from a regular PC. The two CPUS do not share machine language, so you will need to install an arm version of libbluetooth to link against. There was another fellow that was trying to do this with the user name "Vaclav_", who's posts you should be able to search for. I don't know if he ever managed to get the cross comipilation working. In the short term, it might be more productive to develop on the RPI. If you have a RPI-4, then you've got a moderately powerful system. If you convert it to boot from USB using an SSD, it should be powerful and fast enough to get you started, while you research how to get an ARM-compatible libbluetooth installed.
Keep Calm and Carry On
|
|
|
|
|
Part 2:
You seem to be using Ubuntu, so you might be able to add packages via the multilib/foreign architecture options for apt. There's a discussion of it in the Debian Wiki here: Multiarch/HOWTO - Debian Wiki I haven't tried this, so can't say for certain it will work, but if it does, it will be much easier than having to cross compile the libraries yourself.
Keep Calm and Carry On
|
|
|
|
|
Sorry about the long post - I have one more problem.
I installed libbluetooth-dev on my ARM /RPi OS ,
used csp to copy to my X86 PC
verified it exist on PC
added -L to my options
Still getting same error
BUT
the linker error is coming from different path and it definitely looks as the linker is NOT looking to the path I added
-L/usr/lib/arm-linux-gnueabihf/arm-linux-gnueabihf' '-L/usr/lib/arm-linux-gnueabihf' '
, but it is in verbose output
Still missing something...
OLLECT_GCC_OPTIONS='-L/usr/lib/x86_64-linux-gnu' '-L/usr/lib/arm-linux-gnueabihf/arm-linux-gnueabihf' '-L/usr/lib/arm-linux-gnueabihf' '-v' '-o' 'RPI_Bluetooth' '-shared-libgcc' '-march=armv6' '-mtune=arm1176jz-s' '-mfloat-abi=hard' '-mfpu=vfp' '-mtls-dialect=gnu'
/home/qw/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin/../libexec/gcc/arm-linux-gnueabihf/4.8.3/collect2 --sysroot=/home/qw/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin/../arm-linux-gnueabihf/libc --build-id --eh-frame-hdr -dynamic-linker /lib/ld-linux-armhf.so.3 -X -m armelf_linux_eabi -o RPI_Bluetooth /home/qw/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin/../arm-linux-gnueabihf/libc/usr/lib/arm-linux-gnueabihf/crt1.o /home/qw/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin/../arm-linux-gnueabihf/libc/usr/lib/arm-linux-gnueabihf/crti.o /home/qw/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin/../lib/gcc/arm-linux-gnueabihf/4.8.3/crtbegin.o -L/usr/lib/x86_64-linux-gnu -L/usr/lib/arm-linux-gnueabihf/arm-linux-gnueabihf -L/usr/lib/arm-linux-gnueabihf -L/home/qw/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin/../lib/gcc/arm-linux-gnueabihf/4.8.3 -L/home/qw/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin/../lib/gcc/arm-linux-gnueabihf -L/home/qw/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin/../lib/gcc -L/home/qw/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin/../lib/gcc/arm-linux-gnueabihf -L/home/qw/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin/../lib/gcc/arm-linux-gnueabihf/4.8.3/../../../../arm-linux-gnueabihf/lib -L/home/qw/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin/../arm-linux-gnueabihf/libc/lib/arm-linux-gnueabihf -L/home/qw/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin/../arm-linux-gnueabihf/libc/lib -L/home/qw/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin/../arm-linux-gnueabihf/libc/lib/arm-linux-gnueabihf -L/home/qw/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin/../arm-linux-gnueabihf/libc/usr/lib/arm-linux-gnueabihf -L/home/qw/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin/../arm-linux-gnueabihf/libc/usr/lib -L/home/qw/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin/../arm-linux-gnueabihf/libc/usr/lib/arm-linux-gnueabihf ./src/RPI_Bluetooth.o -llibbluetooth-dev -lstdc++ -lm -lgcc_s -lgcc -lc -lgcc_s -lgcc /home/qw/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin/../lib/gcc/arm-linux-gnueabihf/4.8.3/crtend.o /home/qw/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin/../arm-linux-gnueabihf/libc/usr/lib/arm-linux-gnueabihf/crtn.o
/home/qw/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin/../lib/gcc/arm-linux-gnueabihf/4.8.3/../../../../arm-linux-gnueabihf/bin/ld: cannot find -llibbluetooth-dev
/home/qw/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin/../lib/gcc/arm-linux-gnueabihf/4.8.3/../../../../arm-linux-gnueabihf/bin/ld: skipping incompatible /usr/lib/x86_64-linux-gnu/libm.so when searching for -lm
/home/qw/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin/../lib/gcc/arm-linux-gnueabihf/4.8.3/../../../../arm-linux-gnueabihf/bin/ld: skipping incompatible /usr/lib/x86_64-linux-gnu/libm.a when searching for -lm
/usr/lib/x86_64-linux-gnu/libgcc_s.so.1: file not recognized: File format not recognized
collect2: error: ld returned 1 exit status
make: *** [makefile:61: RPI_Bluetooth] Error 1
"make all" terminated with exit code 2. Build might be incomplete.
|
|
|
|
|
Firstly:
OLLECT_GCC_OPTIONS='-L/usr/lib/x86_64-linux-gnu'
That's a bit odd. If you are compiling for arm, you should not be including anything from the x86_64 lib tree.
Secondly you seem to be confusing the difference between a software package, and its contents. The package is libbluetooh-dev. It has headers, documentation and other files that are needed to compile a program that uses libbluetooth. The package libbluetooth3 contains the shared library: /usr/lib/arm-linux-gnueabihf/libbluetooth.so.3.xx.yy, so you should ask to link only with -lbluetooth
Thirdly: if you've installed the gcc cross-copmiler tools correctly, it should know how to find libm without any additional help from you. Consider the following very simple program
#include <stdio.h>
#include <math.h>
int main()
{
printf("%f\n", lgamma(2.0));
return 0;
} In order to compile it, we need to include libm. On my X86-64 computer I do
gcc example.c -o example -lm to create an x86-64 executable program. To create an ARM version I do
gcc-arm7 example.c -o example-arm -lm I now have 2 versions of the example program, one for X86-64 and one for ARM e.g.
k5054@loaclhost $ file example example-arm
example: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=c5d319f4b896ad825b708ff73a248ed23f64489f, for GNU/Linux 3.2.0, not stripped
example-arm: ELF 32-bit LSB shared object, ARM, EABI5 version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux-armhf.so.3, BuildID[sha1]=1bc8369c7de09a7510c93c0bcab5824c6342d688, for GNU/Linux 3.2.0, not stripped Are you sure you've installed the cross compiler correctly and can produce simple programs (like example.c above or a basic hello world) that can run on the RPI?
Keep Calm and Carry On
|
|
|
|
|
1. Being lazy I left the x86 links references in - it should not matter,
but I'll take them out.
2. Yes I got puzzled by instruction to "install a library " when in essence I was installing a
Linux package which contains the library and other stuff. I got better undertaking of thet
now.
3. I have another app in works with no problem crosscompiling and actually running it on Raspberry.
3. No, I did not physically install the crosscomplier - just selected "cross compile" option in Eclipse.
I am not sure if my -l and -L options are syntactically correct - but it looks OK in output
I'll recheck that .
Many thanks for your help, appreciate that very much.
|
|
|
|
|
Update
1. installing libbluetooth-dev package installs libbluetooth.a and libbluetooth.so
AKA there is NO libbluetooth-dev library
2. linker options are
-l:libbluetooth.a
-L/usr/lib/x86_64-linux-gnu
build process links and application runs as local , no crosscompiler, on "host" PC
pre lang="text">
Building target: TEST_BT
Invoking: GCC C++ Linker
g++ -L/usr/lib/x86_64-linux-gnu -v -o "TEST_BT" ./src/TEST_BT.o -l:libbluetooth.a
Using built-in specs.
COLLECT_GCC=g++
Can anybody educate me about the ":" in -l:libbluetooth.a.
I ADDED it in Eclipse options.
WHY ?
|
|
|
|
|
Member 14968771 wrote: Can anybody educate me about the ":" in -l:libbluetooth.a. I cannot find any reference to that option in Using the GNU Compiler Collection (GCC): Link Options[^], where the normal option would be -lbluetooth . I can only assume it is an add-on from somewhere that allows yo to specify the full library name.
|
|
|
|
|
It definitely looks as a linker "suggestion " when "libbluetooth" is set as an option
When both ":" and ".a" are used linker does not complain.
/usr/bin/ld: cannot find -llibbluetooth
/usr/bin/ld: note to link with /usr/lib/x86_64-linux-gnu/libbluetooth.a use -l:libbluetooth.a or rename it to liblibbluetooth.a
collect2: error: ld returned 1 exit status
|
|
|
|
|
My latest Visual Studio does not display the resources in the Resources tab or the classes in the Classes view.
It's version 16.11.5
I'm doing clean builds from new git clone (but it should not matter with MFC resources).
I've looked and tried to apply different fixes and workarounds (unload/reload projects, create dummy project ... ) and nothing really works.
Any ideas ?
CI/CD = Continuous Impediment/Continuous Despair
|
|
|
|
|
Hmm, works for me. I assume you've tried View->"Class View (Ctrl+Shift+C)" and View->"Other Windows"->"Resource View (Ctrl_Shift+E)"
Mircea
|
|
|
|
|
It works for me the same way as in 16.11.3. No differences, no problems.
|
|
|
|
|
I disabled my intellisense that borked my classes/resources windows
CI/CD = Continuous Impediment/Continuous Despair
|
|
|
|
|
Hi
I have a richedit control as child control in my modeless dialog. I have populated editcontrol via streamin SF_TEXT with a program listing. I am looking to insert a bullet to specify a breakpoint.
After doing some research there were a number of articles about the richedit ole interface. With the bitmap being an ole client. I remember at one time getting this work (had different computer but still had windows 10)
regardless just looking back at those articles it seems the ole support would only work with RTF format text.
I am now thinking of going back to original API for bitmaps by that I mean BitBlt and or Strechbilt.
In my initdialog after creating the rich edit both object via new and creating a HWND via DDX_CONTROL I did a Clientrect on bot the modless dialog box and the richedit control it showed that right variable of the RECT structure for richedit window was 20 pixels less than the right viariable of the parent modeless dialog box. I think those 20 pixels would be enough for me to insert a bullet bmp
Yet when eyeballing the output, it seemed the text of the richedit was right up against the frame of the modeless dialog box
I think 20 pixels would be something I would notice
am I not understanding things correctly
thanks
|
|
|
|
|
I'm not sure, but couldn't it be that the dialog's client rect is relative to the upper left of the window, while the child control's client rect is relative to the upper left of the dialog's client rect?
The difficult we do right away...
...the impossible takes slightly longer.
|
|
|
|
|
Not sure what you mean by window in dialog box same as CFRamewnd there is a frame that takes up space
The GetClientRect implies as in Client the white back ground portion
I mean if you were to Draw text the coordinates would be the white back ground right So if the richedit child control is +20 from the client area of dialog the text I’m writting to or streaming shouldn’t be right up against the frame right ?
|
|
|
|
|
I don't have MFC so I cannot test this control. However, it occurs to me that perhaps the RichEdit control reserves some edge space for its own purposes (possibly a scrollbar). Try calling GetWindowRect on the control and compare that with the dialog's client rect.
[edit]
I just checked the difference between the Window and Client sizes of a simple Edit control. The width was 25 pixels different, and the height 4. So I guess what you are seeing is correct.
[/edit]
modified 18-Oct-21 11:30am.
|
|
|
|
|
I had this code working in the begining of this year. I a program listing in a rich edit control that I streamed in with SF_TEXT (looked really) nice. I then wanted insert a bullet to indicate a break point something similar to what visual studio does.
I had a red bullet and used the Richedit OLE interface along the lines in what is in KB Article Q220844 All of the sudden now its not working the red bullet does even look a bitmap after I do insertobject
Could it be to fixes windows have something to do with this
I'll end by asking a general question is it possible to insert a bitmap (in may case a red bullet ) in Richedit doc where I streamed in data in SF_TEXT format ?
|
|
|
|
|
If a bitmap does not work, could you use an HTML character instead? I'm not sure what format CRichEditCtrl uses, but maybe something like:
·
·
·
·
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"You can easily judge the character of a man by how he treats those who can do nothing for him." - James D. Miles
|
|
|
|
|
I know I tried streaming in a z/os assembler listing when I look at the project date it was 1/2020 it was under windows 10 I now have a different computer newer version of windows 10 back then inserting the bullet via richeditole->object worked
I just would like to ask you a general question if streamin the text with SF_TEXT should I after doing the other api calls be able to do richediole->insertobject I did setsel to where I want to place it and put value in REFORMT structure to use current selection for bitmap should this work if initial text was streamed in with SF_TEXT
|
|
|
|
|
I have a richedit control which first time I am not able to clear out to nulls or have no value
Below is the code for CGRegs which a modeless Cdialog in which the client area is filled by a rich edit
as you can see all the way on the bottom I select the entire richedit and do a Clear
The first time around before General Purpose Registers Cdialog/richedit is filled I do a Stream out
I would assume the value of cb would be zero but its not its 0x7b for some unexplained reason more so
the value of the buffer of the rich edit is
pbBuff = 0x000001d45061df80 "{\\rtf1\\ansi\\deff0{\\fonttbl{\\f0\\fnil\\fcharset0 Courier New;}}\r\n\\viewkind4\\uc1\\pard\\lang1033\\f0\\fs17
Dont know what this is when I try to populate the the richedit with the register value it puts after the string
{\rtf1\ansi\deff0{\fonttbl{\f0\fnil\
\viewkind4 GPR 00=000000_00000114 GPR 04=00000000_FFFF
Any one the know who I can clear the inital value of the rich edit
thanks
static DWORD MyStreamOutGPRCallback(DWORD_PTR dwCookie, LPBYTE pbBuff, LONG cb, LONG* pcb)
BOOL CGPRegs::OnInitDialog()
{
gprrichedit = new CRichEditCtrl;
CDialog::OnInitDialog();
gprrichedit->SetSel(0, -1);
gprrichedit->Clear();
return TRUE;
}
CGPRegs::~CGPRegs()
{
}
void CGPRegs::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
DDX_Control(pDX, IDC_RICHEDIT22, (CWnd &)*gprrichedit);
}
|
|
|
|
|
gprrichedit = new CRichEditCtrl;
CDialog::OnInitDialog();
gprrichedit->SetSel(0, -1);
gprrichedit->Clear();
You are creating a new RichEdit control so it will not contain any data, so no need to clear it. As to the other code you show above, I cannot understand what it is about; e.g:
pbBuff = 0x000001d45061df80 "{\\rtf1\\ansi\\deff0{\\fonttbl{\\f0\\fnil\\fcharset0 Courier New;}}\r\n\\viewkind4\\uc1\\pard\\lang1033\\f0\\fs17
is not valid, since the parameter is a long integer.
|
|
|
|
|
That’s the data I find the first time I call streamout with cb being x’7B’
Okay thanks
|
|
|
|
|
I think that is just the base control data for CRichEdit text, which is used to format it in the display. If you want pure text then you need to use CEdit.
|
|
|
|