1. Robert Jones
  2. PowerBuilder
  3. Tuesday, 11 June 2019 20:26 PM UTC

Hi Folks,

I'm working on a compiler front-end for building our Powerbuilder applications. I've been using the pborca170.dll and the Orca API documentation as my guide.

My process is basically:

1. Bootstrap the application using PBORCA_CompileEntryImport, per the recommendation here

2. Import objects into each PBL using PBORCA_CompileEntryImport.

3. Rebuild the application using PBORCA_ApplicationRebuild

4. Set the EXE info using PBORCA_SetExeInfo

4. Generate the EXE using PBORCA_ExecutableCreate

This seems to "work" for trivial applications, but once I move to our more complex products I run into a lot of compilation errors. Specifically, I get a bunch of errors during PBORCA_CompileEntryImport.

Most errors seem to be related to undefined symbols. But, these are just symbols that are defined in another PBL so I expect the references to get resolved during PBORCA_ApplicationRebuild (I've tried FULL_REBUILD, INCREMENTAL_REBUILD, and 3PASS here).

That does not happen though. My question: what is the critical piece/pieces I'm missing here?

AFAICT I have the session configured properly at each step of the way. I close the session and create a new one between bootstrapping the application and the rest of the process. I close and create new sessions when updating the library list.

Any help/advice is appreciated.

 

Thanks,

Rob

Phil Wallingford Accepted Answer Pending Moderation
  1. Thursday, 13 June 2019 19:25 PM UTC
  2. PowerBuilder
  3. # 1

PowerGen does parse the objects and imports them in three phases.  This reduces errors but, more importantly, it allows the process to work.  Without care being taken it is fairly easy to get the PB compiler to fail completely.

 

Regards,

Phil

Comment
There are no comments made yet.
Phil Wallingford Accepted Answer Pending Moderation
  1. Thursday, 13 June 2019 19:22 PM UTC
  2. PowerBuilder
  3. # 2

To reinforce what Roland has said. There are tools out there that do this.  And developing a complete solution is a significant amount of work, so depending how you value your time....

 

Phil

Comment
There are no comments made yet.
Roland Smith Accepted Answer Pending Moderation
  1. Tuesday, 11 June 2019 21:03 PM UTC
  2. PowerBuilder
  3. # 3

Have you tried doing a Full Rebuild followed by an Incremental Rebuild?

I would close the ORCA session and start a new one before each call to PBORCA_ApplicationRebuild.

It appears that when PowerGen does a bootstrap, it imports bare bones versions of objects first and then goes back to import the full objects in the next phase. I think this is done to cut down on the number of object not found errors. I'm not 100% sure but I think it works in object type order, datawindows, pipelines, and structures first, then menus, userobjects and windows. 

Comment
  1. Robert Jones
  2. Tuesday, 11 June 2019 22:08 PM UTC
Just gave that a try. It didn't move the needle.



I did notice within PowerBuilder it outputs some messages about "Creating Type" as an initial pass during a full build. That sounds a lot like what you're describing with PowerGen.
  1. Helpful
There are no comments made yet.
Robert Jones Accepted Answer Pending Moderation
  1. Tuesday, 11 June 2019 20:52 PM UTC
  2. PowerBuilder
  3. # 4

Oh, and I'm not running Powerbuilder when I'm using my front end. 

Comment
There are no comments made yet.
Roland Smith Accepted Answer Pending Moderation
  1. Tuesday, 11 June 2019 20:45 PM UTC
  2. PowerBuilder
  3. # 5

The problem is that some of the ORCA functions use callbacks which are not supported by PowerBuilder. Because of that, you can't get the error messages. The ApplicationRebuild function is prone to aborting.

I have a tool that allows full use of the ORCA functionality from PowerBuilder apps:

http://www.topwizprogramming.com/pborcapi.html

I also have a bootstrap tool that also does compiling:

http://www.topwizprogramming.com/bootstrap.html

A lot of people use PowerGen for bootstrap and compiling:

https://www.ecrane.com/powergen-overview/

 

Comment
  1. Robert Jones
  2. Tuesday, 11 June 2019 20:50 PM UTC
@roland Thanks for the reply. I appreciate the response.



To clarify, this is a native C++ application that calls the functions in the pborca170.dll. I'm not doing anything from within Powerbuilder or within a Powerbuilder application. It's all command line C++.



I've implemented the callbacks. I can see the errors. What I don't understand is why I'm getting the errors, unless there's a gap in the process I outlined above.



Thanks again.



Rob
  1. Helpful
  1. Roland Smith
  2. Friday, 14 June 2019 13:02 PM UTC
Is the ApplicationRebuild function aborting or just returning errors that don't make sense?
  1. Helpful
There are no comments made yet.
  • Page :
  • 1


There are no replies made for this question yet.
However, you are not allowed to reply to this question.