Recent

Author Topic: RegisterUnit Fails  (Read 108 times)

kevin.black

  • New member
  • *
  • Posts: 33
RegisterUnit Fails
« on: January 12, 2019, 02:32:06 am »
Hi,

Standard disclaimer, long ago Lazarus, moved to delphi, now back to Lazarus because FMX Cross-Platform just doesn't. So consider newbie, and if questions are too basic then apologies.

Background

Trying to move FMX Windows applications using TMS Cloud Pack to OSX. Calls are in DYLIBs and that in and of itself is causing significant issues. So Plan D (A, B and C essentially screwed). Give Lazarus a try, it's at least native on OSX AND AND AND with the cocoa framework, there is a 64 bit version - no such thing with Delphi at the moment. My DYLIBs need to be accessible to other apps (SWIFT, Objective C etc). My Delphi DLLs work fine (limit the returns to pChars and booleans). So, after building a simple App/DYLIB and proving it works, now trying to get the TMS LCL Cloud Pack installed. It's quite old (mid 2016), but that's the latest update.

I'm using Lazarus 2.0.0RC3 (macOS 10.13.6 in a Parallels VM). I thought I had updated/was using cocoa, but the About says i386-darwin-carbon, see second question....

The Problem

Everything goes fine with the build the package until it comes to registering the components. I got onto the TMS forum and had a whinge and they got back and said ...don't blame use, the file you are complaining about is generated by Lazarus. So basically in the unit LCLTMSCloudLazarusPkg I get an error in Procedure Register in any RegisterUnit() line. See code below:

Code: Pascal  [Select]
  1. { This file was automatically created by Lazarus. Do not edit!
  2.   This source is only used to compile and install the package.
  3.  }
  4.  
  5. unit LCLTMSCloudLazarusPkg;
  6.  
  7. {$warn 5023 off : no warning about unused units}
  8. interface
  9.  
  10. uses
  11.   cloudutf8scanner, cloudutf8tools, ssl_openssl, ssl_openssl_lib, synacode,
  12.   synafpc, synaip, synautil, synsock, blcksock, cloudunicodeinfo,
  13.   cloudcharacter, LCLTMSCloudCustomConvert, LCLTMSCloudCustomCloudKit,
  14.   LCLTMSCloudCustomDataStore, LCLTMSCloudBaseLCL, LCLTMSCloudCustomBoxNet,
  15.   LCLTMSCloudCustomNetatmo, LCLTMSCloudCustomGTasks, LCLTMSCloudCustomGoogle,
  16.   LCLTMSCloudCustomBarcode, LCLTMSCloudCustomGAnalytics,
  17.   LCLTMSCloudCustomGPlaces, LCLTMSCloudCustomHubic, LCLTMSCloudGTasks,
  18.   LCLTMSCloudGTasksReg, LCLTMSCloudCustomInstagram, LCLTMSCloudCustomGDrive,
  19.   LCLTMSCloudBase, LCLTMSCloudCustomFlickr, LCLTMSCloudCustomAmazonCloudDrive,
  20.   LCLTMSCloudCustomFourSquare, LCLTMSCloudCustomGCalendar,
  21.   LCLTMSCloudCustomGDataStore, LCLTMSCloudCustomHiDrive,
  22.   LCLTMSCloudCustomLinkedIn, LCLTMSCloudCustomLiveCalendar,
  23.   LCLTMSCloudCustomLiveContacts, LCLTMSCloudCustomLive,
  24.   LCLTMSCloudCustomOpenStack, LCLTMSCloudCustomPayPal,
  25.   LCLTMSCloudCustomPicasa, LCLTMSCloudCustomPryv, LCLTMSCloudCustomStripe,
  26.   LCLTMSCloudCustomTrello, LCLTMSCloudCustomTwitter, LCLTMSCloudCustomWinLive,
  27.   LCLTMSCloudCustomYouTube, LCLTMSCloudCustomGMail, LCLTMSCloudGoogleLCL,
  28.   LCLTMSCloudCustomFacebook, LCLTMSCloudCustomDropBox, LCLTMSCloudBarcode,
  29.   LCLTMSCloudBarcodeReg, LCLTMSCloudConvert, LCLTMSCloudConvertReg,
  30.   LCLTMSCloudDropBox, LCLTMSCloudDropBoxReg, LCLTMSCloudGDrive,
  31.   LCLTMSCloudGDriveReg, LCLTMSCloudWinLive, LCLTMSCloudWinLiveReg,
  32.   LCLTMSCloudBoxNetReg, LCLTMSCloudBoxNet, LCLTMSCloudAmazonCloudDrive,
  33.   LCLTMSCloudAmazonCloudDriveReg, LCLTMSCloudHubic, LCLTMSCloudLiveLCL,
  34.   LCLTMSCloudHubicReg, LCLTMSCloudHiDrive, LCLTMSCloudHiDriveReg,
  35.   LCLTMSCloudFacebookReg, LCLTMSCloudFacebook, LCLTMSCloudFlickrReg,
  36.   LCLTMSCloudFlickr, LCLTMSCloudHMAC, LCLTMSCloudFourSquareReg,
  37.   LCLTMSCloudFourSquare, LCLTMSCloudGCalendarReg, LCLTMSCloudGCalendar,
  38.   LCLTMSCloudGMailReg, LCLTMSCloudGMail, LCLTMSCloudGPlacesReg,
  39.   LCLTMSCloudGPlaces, LCLTMSCloudIPLocReg, LCLTMSCloudIPLoc,
  40.   LCLTMSCloudInstagramReg, LCLTMSCloudInstagram, LCLTMSCloudLiveCalendarReg,
  41.   LCLTMSCloudLiveCalendar, LCLTMSCloudLinkedInReg, LCLTMSCloudLinkedIn,
  42.   LCLTMSCloudLiveContactsReg, LCLTMSCloudLiveContacts, LCLTMSCloudPayPalReg,
  43.   LCLTMSCloudPayPal, LCLTMSCloudPicasaReg, LCLTMSCloudPicasa,
  44.   LCLTMSCloudPryvReg, LCLTMSCloudPryv, LCLTMSCloudPushOver,
  45.   LCLTMSCloudPushOverReg, LCLTMSCloudStripe, LCLTMSCloudStripeReg,
  46.   LCLTMSCloudTrelloReg, LCLTMSCloudTrello, LCLTMSCloudTwitter,
  47.   LCLTMSCloudTwitterReg, LCLTMSCloudUrlShortener, LCLTMSCloudURLShortenerReg,
  48.   LCLTMSCloudWeatherReg, LCLTMSCloudYouTube, LCLTMSCloudYouTubeReg,
  49.   LCLTMSCloudGAnalyticsReg, LCLTMSCloudGAnalytics, LCLTMSCloudImage,
  50.   LCLTMSCloudImageReg, LCLTMSCloudCustomMyCloudData, LCLTMSCloudMyCloudData,
  51.   LCLTMSCloudMyCloudDataReg, LazarusPackageIntf;
  52.  
  53. implementation
  54.  
  55. procedure Register;
  56. begin
  57.   RegisterUnit('LCLTMSCloudGTasksReg', @LCLTMSCloudGTasksReg.Register);       //<<<----[MY COMMENT] THIS IS THE FIRST LINE TO BLOW UP
  58.   RegisterUnit('LCLTMSCloudBarcodeReg', @LCLTMSCloudBarcodeReg.Register);
  59.   RegisterUnit('LCLTMSCloudConvertReg', @LCLTMSCloudConvertReg.Register);
  60.   RegisterUnit('LCLTMSCloudDropBoxReg', @LCLTMSCloudDropBoxReg.Register);
  61.   RegisterUnit('LCLTMSCloudGDriveReg', @LCLTMSCloudGDriveReg.Register);
  62.   RegisterUnit('LCLTMSCloudWinLiveReg', @LCLTMSCloudWinLiveReg.Register);
  63.   RegisterUnit('LCLTMSCloudBoxNetReg', @LCLTMSCloudBoxNetReg.Register);
  64.   RegisterUnit('LCLTMSCloudAmazonCloudDriveReg',
  65.     @LCLTMSCloudAmazonCloudDriveReg.Register);
  66.   RegisterUnit('LCLTMSCloudHubicReg', @LCLTMSCloudHubicReg.Register);
  67.   RegisterUnit('LCLTMSCloudHiDriveReg', @LCLTMSCloudHiDriveReg.Register);
  68.   RegisterUnit('LCLTMSCloudFacebookReg', @LCLTMSCloudFacebookReg.Register);
  69.   RegisterUnit('LCLTMSCloudFlickrReg', @LCLTMSCloudFlickrReg.Register);
  70.   RegisterUnit('LCLTMSCloudFourSquareReg', @LCLTMSCloudFourSquareReg.Register);
  71.   RegisterUnit('LCLTMSCloudGCalendarReg', @LCLTMSCloudGCalendarReg.Register);
  72.   RegisterUnit('LCLTMSCloudGMailReg', @LCLTMSCloudGMailReg.Register);
  73.   RegisterUnit('LCLTMSCloudGPlacesReg', @LCLTMSCloudGPlacesReg.Register);
  74.   RegisterUnit('LCLTMSCloudIPLocReg', @LCLTMSCloudIPLocReg.Register);
  75.   RegisterUnit('LCLTMSCloudInstagramReg', @LCLTMSCloudInstagramReg.Register);
  76.   RegisterUnit('LCLTMSCloudLiveCalendarReg',
  77.     @LCLTMSCloudLiveCalendarReg.Register);
  78.   RegisterUnit('LCLTMSCloudLinkedInReg', @LCLTMSCloudLinkedInReg.Register);
  79.   RegisterUnit('LCLTMSCloudLiveContactsReg',
  80.     @LCLTMSCloudLiveContactsReg.Register);
  81.   RegisterUnit('LCLTMSCloudPayPalReg', @LCLTMSCloudPayPalReg.Register);
  82.   RegisterUnit('LCLTMSCloudPicasaReg', @LCLTMSCloudPicasaReg.Register);
  83.   RegisterUnit('LCLTMSCloudPryvReg', @LCLTMSCloudPryvReg.Register);
  84.   RegisterUnit('LCLTMSCloudPushOverReg', @LCLTMSCloudPushOverReg.Register);
  85.   RegisterUnit('LCLTMSCloudStripeReg', @LCLTMSCloudStripeReg.Register);
  86.   RegisterUnit('LCLTMSCloudTrelloReg', @LCLTMSCloudTrelloReg.Register);
  87.   RegisterUnit('LCLTMSCloudTwitterReg', @LCLTMSCloudTwitterReg.Register);
  88.   RegisterUnit('LCLTMSCloudURLShortenerReg',
  89.     @LCLTMSCloudURLShortenerReg.Register);
  90.   RegisterUnit('LCLTMSCloudWeatherReg', @LCLTMSCloudWeatherReg.Register);
  91.   RegisterUnit('LCLTMSCloudYouTubeReg', @LCLTMSCloudYouTubeReg.Register);
  92.   RegisterUnit('LCLTMSCloudGAnalyticsReg', @LCLTMSCloudGAnalyticsReg.Register);
  93.   RegisterUnit('LCLTMSCloudImageReg', @LCLTMSCloudImageReg.Register);
  94.   RegisterUnit('LCLTMSCloudMyCloudDataReg', @LCLTMSCloudMyCloudDataReg.Register
  95.     );
  96. end;
  97.  
  98. initialization
  99.   RegisterPackage('LCLTMSCloudLazarusPkg', @Register);
  100. end.

The error message is:

Quote
Compile package LCLTMSCloudLazarusPkg 1.0: Exit code 256, Errors: 1
LCLTMSCloudLazarusPkg.pas(57,34) Error: Identifier not found "Register"
Compile package lazprojectgroups 0.7: Aborted

So maybe there's a switch/package/whatever I have missed, but according to the documentation, the code is correct?

Questions

1.  Does anyone have any idea (what I'm doing wrong) how I might get the package installed?

and the bonus question:

I though I had followed the instructions to update to a 64bit cocoa framework. Obviously that didn't work. so. On a previous post I had a response:

       So yes, if you install the 2.0RC3 you have 32 and 64 bit compiler included. And you can choose in your project settings which one you are building.  (LCL for both).

2.  I don't see that in the Project properties. Can someone point me to the actual setting?

Thank you
« Last Edit: January 12, 2019, 02:59:22 am by kevin.black »