Author Topic: PCL API version error  (Read 2657 times)

Offline mmisiura1

  • Newcomer
  • Posts: 25
PCL API version error
« on: 2018 October 15 15:35:07 »
Hi, everyone!

I have a small (hopefully) question. I am trying to write a new module for PI and started from compiling existing ones using Visual Studio 2015 Community (vc14).

I was able to compile couple of modules, but when I try to install them in PI I get the following error:

Unsupported API version 161 (expected <= 160).: Module load error

As your Git repo says, PCL API there is indeed version 161 (API interface version 0x0161 (core version 1.8.5.1357)).

I have the latest PI installation it seems (1.8.5.1353), there are no updates available. So looks like current PI is outdated compared to PCL repo?

What am I missing here?

Thank you very much in advance!


Offline Juan Conejero

  • PTeam Member
  • PixInsight Jedi Grand Master
  • ********
  • Posts: 7111
    • http://pixinsight.com/
Re: PCL API version error
« Reply #1 on: 2018 October 16 04:32:42 »
Hi,

Sorry for this issue. The GitHub commit that introduced this change is here:

https://github.com/PixInsight/PCL/commit/97e83fd6747bcf5655a4caf395a6109c348c79e9

Actually, API version 161 introduces a very minor change that you can revert very easily:

- Open the header file 'include/pcl/api/APIInterface.h' with your code editor.

- Go to line #59 and replace '0x0161' with '0x0160', then save the file.

- Rebuild the PCL library.

Since the change introduced by version 0x161 affects just to a parameter of an API function call[1], that is, it does not add new API calls, there should be no problems. Just don't call ImageWindow::ForceClose() from your code, since it won't work in the current official version of PixInsight.

BTW, I am about to upload a new version of PCL with very important changes necessary to support the next version of the PixInsight core application, which comes with exciting new features. However, this time I'll create a new branch on the PCL GitHub repository to avoid further problems (yes, this is exactly what I should have done in March, when I committed API v. 0x161 :) )

Let me know if this works.

[1] Because function arguments are pushed from right to left in C and C++, and the change in v. 0x161 just adds a second parameter to the API function in question. So the original first argument, which the core application expects to find at the top of the stack, continues being there. Sorry for the technicality but it's too nice to be omitted 8)
« Last Edit: 2018 October 16 04:44:30 by Juan Conejero »
Juan Conejero
PixInsight Development Team
http://pixinsight.com/

Offline mmisiura1

  • Newcomer
  • Posts: 25
Re: PCL API version error
« Reply #2 on: 2018 October 18 13:02:13 »
Dear Juan,

Thank you very much for your detailed reply!

I did as you advised and everything seems to work perfect now!

Thank you very much again!