Spelt / ZXing.Delphi

ZXing Barcode Scanning object Pascal Library for Delphi VCL and Delphi Firemonkey
Apache License 2.0
471 stars 206 forks source link

Undeclared identifier: 'TBitmap' #166

Closed chkerk closed 4 months ago

chkerk commented 6 months ago

Dear sir,

I had download and try to compile and run the aTestApp for mobile qrcode scanning. But when i try to Run it, error shown Could not compile used unit 'ZXing.Helpers.pas'.

in file ..\Lib\Classes\Filtering\ZXing.RGBLuminanceSource.pas

constructor CreateFromBitmap(const sourceBitmap: TBitmap; const width, height: Integer);

Please help.

Thank you

Spelt commented 6 months ago

Hi,

That an old project which should have been deleted. If you open the project group file you see all the demo projects.

I hope it helps!

Sincerly, Edward

On Fri, 9 Feb 2024 at 04:45, chkerk @.***> wrote:

Dear sir,

I had download and try to compile and run the aTestApp for mobile qrcode scanning. But when i try to Run it, error shown Could not compile used unit 'ZXing.Helpers.pas'.

Please help.

Thank you

— Reply to this email directly, view it on GitHub https://github.com/Spelt/ZXing.Delphi/issues/166, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADAS3VNUK7DREJGOUHCGTC3YSWLWXAVCNFSM6AAAAABDA2MCDCVHI2DSMVQWIX3LMV43ASLTON2WKOZSGEZDMNBRHEYTSOA . You are receiving this because you are subscribed to this thread.Message ID: @.***>

chkerk commented 6 months ago

Hi Edward,

I had tried to open project group file. But it seem like same doesn't work. Or is't I'm have mistake somewhere or anything I can modify just to make it work fine?

Thank you for your reply. Kerk

On Sat, Feb 10, 2024 at 12:27 AM E Spelt @.***> wrote:

Hi,

That an old project which should have been deleted. If you open the project group file you see all the demo projects.

I hope it helps!

Sincerly, Edward

On Fri, 9 Feb 2024 at 04:45, chkerk @.***> wrote:

Dear sir,

I had download and try to compile and run the aTestApp for mobile qrcode scanning. But when i try to Run it, error shown Could not compile used unit 'ZXing.Helpers.pas'.

Please help.

Thank you

— Reply to this email directly, view it on GitHub https://github.com/Spelt/ZXing.Delphi/issues/166, or unsubscribe < https://github.com/notifications/unsubscribe-auth/ADAS3VNUK7DREJGOUHCGTC3YSWLWXAVCNFSM6AAAAABDA2MCDCVHI2DSMVQWIX3LMV43ASLTON2WKOZSGEZDMNBRHEYTSOA>

. You are receiving this because you are subscribed to this thread.Message ID: @.***>

— Reply to this email directly, view it on GitHub https://github.com/Spelt/ZXing.Delphi/issues/166#issuecomment-1936225828, or unsubscribe https://github.com/notifications/unsubscribe-auth/A52P2V4UMQSDKS2J5KVMJITYSZE7XAVCNFSM6AAAAABDA2MCDCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSMZWGIZDKOBSHA . You are receiving this because you authored the thread.Message ID: @.***>

Spelt commented 6 months ago

HiI did an update of the demo files. Some where missing. Sorry about that. Can you pull all from github and try again?For fmx the demo which will be interesting is in:demo/aTestAppOp 12 feb 2024 om 05:48 heeft chkerk @.***> het volgende geschreven: Hi Edward,

I had tried to open project group file. But it seem like same doesn't work.

Or is't I'm have mistake somewhere or anything I can modify just to make it

work fine?

Thank you for your reply.

Kerk

On Sat, Feb 10, 2024 at 12:27 AM E Spelt @.***> wrote:

Hi,

That an old project which should have been deleted. If you open the

project

group file you see all the demo projects.

I hope it helps!

Sincerly,

Edward

On Fri, 9 Feb 2024 at 04:45, chkerk @.***> wrote:

Dear sir,

I had download and try to compile and run the aTestApp for mobile qrcode

scanning. But when i try to Run it, error shown Could not compile used

unit

'ZXing.Helpers.pas'.

Please help.

Thank you

Reply to this email directly, view it on GitHub

https://github.com/Spelt/ZXing.Delphi/issues/166, or unsubscribe

<

https://github.com/notifications/unsubscribe-auth/ADAS3VNUK7DREJGOUHCGTC3YSWLWXAVCNFSM6AAAAABDA2MCDCVHI2DSMVQWIX3LMV43ASLTON2WKOZSGEZDMNBRHEYTSOA>

.

You are receiving this because you are subscribed to this thread.Message

ID: @.***>

Reply to this email directly, view it on GitHub

https://github.com/Spelt/ZXing.Delphi/issues/166#issuecomment-1936225828,

or unsubscribe

https://github.com/notifications/unsubscribe-auth/A52P2V4UMQSDKS2J5KVMJITYSZE7XAVCNFSM6AAAAABDA2MCDCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSMZWGIZDKOBSHA

.

You are receiving this because you authored the thread.Message ID:

@.***>

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you commented.Message ID: @.***>

nosakiis commented 5 months ago

This problem is not limited to TestApp!!!

We have use the last version of ZXing (v.3.9.8) to replace an old version (v.3.9.5) in an app and we have the same error: It is impossible to compile the project!!!

At the compilation, we have as result:

[DDC Error] ZXing.RGBLuminanceSource.pas(115): E2003 Identificator non declared: TBitmap [DDC Fatal Error] ZXing.RGBLuminanceSource.pas(122): F2063 ...

So, the conclusion is that the version v.3.9.8 cannot be installed as explained for the old versions or that elements are missing in the new code

Best Regards

Spelt commented 5 months ago

Can you download 3.99 ? I released a new version because the last release was a bit behind the repo.

I downloaded it myself and builded all projects in the test solution for Windows32 and Window64. Just for a quick test. That works.

Can you try?

On Sat, 9 Mar 2024 at 10:47, nosakiis @.***> wrote:

This problem is not limited to TestApp!!!

We have use the last version of ZXing (v.3.9.8) to replace an old version (v.3.9.5) in an app and we have the same error: It is impossible to compile the project!!!

At the compilation, we have as result:

[DDC Error] ZXing.RGBLuminanceSource.pas(115): E2003 Identificator non déclared: TBitmap [DDC Fatal Error] ZXing.RGBLuminanceSource.pas(122): F2063 ...

So, the conclusion is that the version v.3.9.8 cannot be installed as explained or that elements are missing

— Reply to this email directly, view it on GitHub https://github.com/Spelt/ZXing.Delphi/issues/166#issuecomment-1986810265, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADAS3VMNAW3E3IMRKRSR6OTYXLLEVAVCNFSM6AAAAABDA2MCDCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSOBWHAYTAMRWGU . You are receiving this because you commented.Message ID: <Spelt/ZXing. @.***>

chkerk commented 5 months ago

HI Spelt,

Alright, sure will do and try later. thank you very much.

Calvin.

On Sun, Mar 10, 2024 at 6:47 AM E Spelt @.***> wrote:

Can you download 3.99 ? I released a new version because the last release was a bit behind the repo.

I downloaded it myself and builded all projects in the test solution for Windows32 and Window64. Just for a quick test. That works.

Can you try?

On Sat, 9 Mar 2024 at 10:47, nosakiis @.***> wrote:

This problem is not limited to TestApp!!!

We have use the last version of ZXing (v.3.9.8) to replace an old version (v.3.9.5) in an app and we have the same error: It is impossible to compile the project!!!

At the compilation, we have as result:

[DDC Error] ZXing.RGBLuminanceSource.pas(115): E2003 Identificator non déclared: TBitmap [DDC Fatal Error] ZXing.RGBLuminanceSource.pas(122): F2063 ...

So, the conclusion is that the version v.3.9.8 cannot be installed as explained or that elements are missing

— Reply to this email directly, view it on GitHub < https://github.com/Spelt/ZXing.Delphi/issues/166#issuecomment-1986810265>,

or unsubscribe < https://github.com/notifications/unsubscribe-auth/ADAS3VMNAW3E3IMRKRSR6OTYXLLEVAVCNFSM6AAAAABDA2MCDCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSOBWHAYTAMRWGU>

. You are receiving this because you commented.Message ID: <Spelt/ZXing. @.***>

— Reply to this email directly, view it on GitHub https://github.com/Spelt/ZXing.Delphi/issues/166#issuecomment-1987000411, or unsubscribe https://github.com/notifications/unsubscribe-auth/A52P2V25EAJXBMAZROHOREDYXOGP3AVCNFSM6AAAAABDA2MCDCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSOBXGAYDANBRGE . You are receiving this because you authored the thread.Message ID: @.***>

nosakiis commented 5 months ago

Hello

I have the same error with the code v3.9.9

Best Regards

nosakiis

gleikocarmelo commented 5 months ago

Também estou com o mesmo problema

Spelt commented 5 months ago

Can you upload a zip file with the complete test project ?

On Tue, 12 Mar 2024 at 15:13, nosakiis @.***> wrote:

Hello

I have the same error with the code v3.9.9

Best Regards

nosakiis

— Reply to this email directly, view it on GitHub https://github.com/Spelt/ZXing.Delphi/issues/166#issuecomment-1991747901, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADAS3VMI3SRFUF3HNC4SMJTYX4EO3AVCNFSM6AAAAABDA2MCDCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSOJRG42DOOJQGE . You are receiving this because you commented.Message ID: <Spelt/ZXing. @.***>

Spelt commented 5 months ago

Which version of Delphi are you using?

The error what you get is: [DDC Error] ZXing.RGBLuminanceSource.pas(115): E2003 Identificator non declared: TBitmap

Its defined in fmx.graphics

this is included in the uses clause of ZXing.RGBLuminanceSource.pas with:

{$IFDEF FRAMEWORK_FMX} FMX.Graphics, {$ENDIF}

and this IFDEF is only available as of RAD Studio 11.1

This is because of this commit: https://github.com/Spelt/ZXing.Delphi/commit/129116c9e1ff355714c7504d535ec81e6bfa2f72

It breaks older Delphi versions. Is this something you can confirm ?

Spelt commented 5 months ago

I only work with 11.3 and 12.0 so I did not notice it.

Spelt commented 5 months ago

There is a new version 3.9.10 which has reverted FRAMEWORK_FMX so it should fix compatibility problems with pre 11.1 versions.

Can you check if this version works as expected on your machine ?

nosakiis commented 5 months ago

With Delphi 10.4.2, the version 3.9.10 doesn't work: The compilation triggers another fatal error:

[DCC Fatal error] ZXing.ScanManager.pas(11): F2613 Unit VCL.Graphics not found

Spelt commented 5 months ago

Thanks. this confirms my hypothesis.

Anyway it seems the $IFDEF FMX does not work. So I reverted this fix to the >= 11.1 Delphi versions

I uploaded a new version.

USAGE

If you use a Delphi older then 11.1 then you NEED to set a compiler Define in your 'project options->Delphi compiler->Conditional defines'. Set this in your target platforms or All platforms. See demo applications.

FRAMEWORK_VCL - this predefined variable is set to true if the project uses the VCL framework FRAMEWORK_FMX - this predefined variable is set to true if the project uses the FireMonkey (FMX) framework

Spelt commented 4 months ago

Feel free top reopen if there are any troubles.