Page 2 of 3
Re: Create QRCode (2D-Barcode)
Posted: Tue Aug 06, 2013 3:38 pm
by NoahPhense
jassing wrote:did you create the lib as indicated before your 1st post?
Sure did. I will try it again, for fun.
** still no go **
I have the DLL, created the lib.. do I need to register the DLL or the lib .. ?
Re: Create QRCode (2D-Barcode)
Posted: Tue Aug 06, 2013 5:11 pm
by applePi
Hi
here is what i have done since i have beta 8 also and works okay.
1- download QrcodeXtra.7z from
https://docs.google.com/leaf?id=0B_EW83 ... ist&num=50 mentioned above, you may need google chrome
2-and as jack said copy qrcodelib.dll to C:\PureBasic\Compilers and from prompt : polib qrcodelib.dll /machine:ix86 /out:qrcodelib.lib
so now the qrcodelib.dll and qrcodelib.lib in c:\purebasic\compilers folder.
3- edit the code above line 20 so it is:
ImportC "qrcodelib.lib"
instead of ImportC "..\Lib\qrcodelib.lib"
run it click on size
Re: Create QRCode (2D-Barcode)
Posted: Tue Aug 06, 2013 5:18 pm
by NoahPhense
applePi wrote:Hi
here is what i have done since i have beta 8 also and works okay.
1- download QrcodeXtra.7z from
https://docs.google.com/leaf?id=0B_EW83 ... ist&num=50 mentioned above, you may need google chrome
2-and as jack said copy qrcodelib.dll to C:\PureBasic\Compilers and from prompt : polib qrcodelib.dll /machine:ix86 /out:qrcodelib.lib
so now the qrcodelib.dll and qrcodelib.lib in c:\purebasic\compilers folder.
3- edit the code above line 20 so it is:
ImportC "qrcodelib.lib"
instead of ImportC "..\Lib\qrcodelib.lib"
run it click on size
Thanks, it turns out that I was libbing a different version of the DLL than the one in that google docs download. Should be noted.
** and ps, you don't need to leave it in the compilers dir.. the app directory is fine.
- np
Re: Create QRCode (2D-Barcode)
Posted: Thu Jan 07, 2016 4:37 am
by Keya
hello does anyone have 64bit libs?
thanks dige for the demo!!!

Re: Create QRCode (2D-Barcode)
Posted: Mon Feb 12, 2018 5:17 pm
by tj1010
The reason it's hard to write a scanner is because you have to deal with noise and light levels when you get data from something like avicap32.dll. Getting dimension and angle using markers then decoding isn't that complex. Generating is just following the spec which uses only black and white and ninety degree vector shapes in proportion of markers.
Mobile devs have CIDetectorTypeQRCode for IOS and Barcode API for Android which is why everyone has a QR scan feature without knowing how it works..
I've yet to see a static scan lib on x86 though which sucks because QR is a fast air-gapped method for copy and paste.. I've transferred source code using it in seconds before..
Re: Create QRCode (2D-Barcode)
Posted: Mon Jun 17, 2019 9:41 pm
by bhatkins2000
I was able to create a program using Dige's code (thank you) that creates a scannable QR Code. It works fine from the compiled code but fails to start as an executable with the following error message:
The program can't start because qrcodelib.dll is missing from your computer. Try reinstalling the program to fix this problem.
I have both qrcodelib.lib and qrcodelib.dll in the compiler folder.
Any guesses as to what I'm doing wrong? Any help would be appreciated.
I'm using Purebasic 5.60 on WIndows 7 Ultimate and W10 Pro
Re: Create QRCode (2D-Barcode)
Posted: Sun Apr 05, 2020 3:48 am
by yrreti
I am having the same issue as bhatkins2000, and get the same error message.
I am using PureBasic 5.72
and use the following code
Code: Select all
ImportC "qrcodelib.lib"
QRcode_encodeString8bit(Text.p-ascii, Version.l, QRecLevel.l) As "_QRcode_encodeString8bit"
QRcode_free(*Qrcode.QRCode) As "_QRcode_free"
EndImport
which works fine as long as I am using the purebasic compiler IDE mode.
But when I compile and create an executable program, it always errors out with:
The program can't start because qrcodelib.dll is missing from your computer. Try reinstalling the program to fix this problem.
Correct me please if I am wrong.
I think the problem is that qrcodelib.lib is just imported when using the purebasic compiler IDE mode.
But is not added into the program when creating an executable, as the qrcodelib.dll files location doesn't exist anymore
as far as the executable program can see. Is there a way with PB to actually be able to create the executable with
the qrcodelib.dl file actually compiled into the exe ? Or if the lib file has to be located in the same directory as the executable,
to be able to compile it to load it from there?
As said above by bhatkins2000, Any help would be much much appreciated.
Re: Create QRCode (2D-Barcode)
Posted: Sun Apr 05, 2020 4:19 am
by yrreti
Experimented and found the solution
Just remove qrcodelib.dll and qrcodelib.lib out of you compiler directory and place them in your
programs code directory. Then change the previous ImportC code to reflect that new location.
eg: My programs directory is : D:\MyPB_pgms\QrCode
Code: Select all
ImportC "D:\MyPB_pgms\QrCode\qrcodelib.lib"
QRcode_encodeString8bit(Text.p-ascii, Version.l, QRecLevel.l) As "_QRcode_encodeString8bit"
QRcode_free(*Qrcode.QRCode) As "_QRcode_free"
EndImport
Now I can compile and run the code under the IDE,
and also compile it to a working exe file.
You just need to always include the qrcodelib.dll and qrcodelib.lib in the same directory
as your executable in order to run it. But at least it works.
Re: Create QRCode (2D-Barcode)
Posted: Sun Apr 05, 2020 1:50 pm
by Marc56us
5.72 LTS Windows x64
This works well with PB x86 version, but not with the x64 version.
Code: Select all
[ERROR] Invalid memory access. (read error at address 18446744073709551615)
(Line where debug stop)
Code: Select all
*Qrcode = QRcode_encodeString8bit(content, 0, EC_Level)
Is it possible to modify the code or is it a limitation of the lib?
qrcodelib.dll (x86 ?) 2012/10/11.
Is there a 64 version of this lib since this from 2011 ?
Some updates 2018
https://fukuchi.org/works/qrencode/
Re: Create QRCode (2D-Barcode)
Posted: Sun Apr 05, 2020 6:49 pm
by yrreti
Hi Marc56us
Your right. It's a 32 bit lib, so it won't compile under a 64bit program compiler.
Yet it works real well on my Windows 10 64bit Desktop, that I didn't even try to compile it because of that.
Thanks very much for that link though.
It looks very interesting, and I may look more into that later.
But right now I am just too tied up with many things.
I just needed to get the 32 bit one working asap for a immediately needed project.
At least you are able to use the 32 bit program for the time being.
If and when I do get some free time, I will post what I've found here.
Hopefully someone else may be able to help you with this question in the mean time.
Sorry.
Re: Create QRCode (2D-Barcode)
Posted: Wed Oct 21, 2020 2:38 pm
by loulou2522
Dige,
How can i integrate the swiss croos image at the center of the qrcode.
Thanks in advance
Re: Create QRCode (2D-Barcode)
Posted: Wed Oct 21, 2020 4:17 pm
by dige
loulou2522 wrote:Dige,
How can i integrate the swiss croos image at the center of the qrcode.
Thanks in advance
Sorry, I do not understand what you mean.

Re: Create QRCode (2D-Barcode)
Posted: Wed Oct 21, 2020 7:24 pm
by infratec
That's easy:
Create the QR code with highest 'errorlevel'.
This allows 30% damages.
Than you can overwrite the generated image with your logo.
(If it is not using more than 30% of the code)
But you have to test the readability

Re: Create QRCode (2D-Barcode)
Posted: Thu Oct 22, 2020 6:54 am
by loulou2522
infratec wrote:That's easy:
Create the QR code with highest 'errorlevel'.
This allows 30% damages.
Than you can overwrite the generated image with your logo.
(If it is not using more than 30% of the code)
But you have to test the readability

How can i owerwrite the generated image ? Please can you give me an example.
Thanks
Re: Create QRCode (2D-Barcode)
Posted: Thu Oct 22, 2020 8:11 am
by infratec
That's very 'Basic'
Code: Select all
If OpenWindow(0, 0, 0, 400, 100, "ImageGadget", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
If LoadImage(0, #PB_Compiler_Home + "Examples\Sources\Data\PureBasicLogo.bmp")
If CreateImage(1, 80, 50, 24, #Red)
If StartDrawing(ImageOutput(0))
DrawImage(ImageID(1), 80, 15)
StopDrawing()
EndIf
EndIf
ImageGadget(0, 10, 10, 0, 0, ImageID(0))
EndIf
Repeat : Until WaitWindowEvent() = #PB_Event_CloseWindow
EndIf