I am trying to compile a large B4i project as a library with Compile To Library in B4i 10.00 using the local builder.
The same source code compiles when the project is built as a normal application. The problem only appears when compiling it as a library provider.
The project contains many source modules. All modules are listed in the .b4i project file with ModuleN entries. The project has about 170 library / module entries.
When the library compile fails, the generated folder:
contains only one generated class, for example:
ClassA uses ClassB, ClassC and ClassD in its B4X source code. These classes are also listed as ModuleN entries in the same .b4i project file. However, after the failed Compile To Library run, the corresponding generated files are missing:
The generated header for ClassA contains forward declarations for these classes, for example:
but the actual generated implementation files for these modules are not created.
After that, B4i reports what looks like a B4X syntax error in valid code.
Example 1:
Example 2 from another compile attempt:
In both cases the B4X code and also the generated Objective-C code for the second example looks normal:
So the generated code for ClassA looks reasonable, but the generated project appears to be incomplete because the other modules are not generated.
I also enabled the IDE log mode and checked the generated log.txt. Unfortunately it did not contain a clear hint about the real cause. The only suspicious parts were entries like:
The project might be a little bigger and complex than average projects. It uses macros before compilation to switch environment-specific internal libraries and refresh the Libraries tab. I also clean the project before compiling. Still, the failure appears as if the module tree used by Compile To Library is incomplete or inconsistent.
I would appreciate help understanding what could cause Compile To Library to generate only one b4i_classa.h/.m file although the other modules are listed in the project file and the same source code compiles as a normal application.
It would also appreciate help to get more details about the internal build process of Compile To Library: at which stage are the ModuleN entries resolved, when is the module tree built, and under which conditions can B4i stop after generating only a partial Objects/src/B4iProject folder?
Thanks,
Thomas
The same source code compiles when the project is built as a normal application. The problem only appears when compiling it as a library provider.
The project contains many source modules. All modules are listed in the .b4i project file with ModuleN entries. The project has about 170 library / module entries.
When the library compile fails, the generated folder:
B4X:
Objects/src/B4iProject
contains only one generated class, for example:
B4X:
b4i_classa.h
b4i_classa.m
ClassA uses ClassB, ClassC and ClassD in its B4X source code. These classes are also listed as ModuleN entries in the same .b4i project file. However, after the failed Compile To Library run, the corresponding generated files are missing:
B4X:
b4i_classb.h / .m
b4i_classc.h / .m
b4i_classd.h / .m
The generated header for ClassA contains forward declarations for these classes, for example:
B4X:
@class b4i_classb;
@class b4i_classc;
@class b4i_classd;
but the actual generated implementation files for these modules are not created.
After that, B4i reports what looks like a B4X syntax error in valid code.
Example 1:
B4X:
B4i Version: 10.00
Parse den Code. (6.04s)
Building folders structure. (0.06s)
Führe individuellen Aktion aus. (9.14s)
Führe individuellen Aktion aus. (0.14s)
Kompiliere den Code. Error
Fehler beim Kompilieren des Programms.
Fehlerbeschreibung: ',' erwartet.
Fehler in Zeile: 528
objSubject = CallSub(mObject, "getSomeValue")
Word: )
Example 2 from another compile attempt:
B4X:
B4i Version: 10.00
Parse den Code. (5.15s)
Building folders structure. (0.01s)
Führe individuellen Aktion aus. (15.77s)
Führe individuellen Aktion aus. (0.95s)
Kompiliere den Code. Error
Fehler beim Kompilieren des Programms.
Fehlerbeschreibung: '(' erwartet.
Fehler in Zeile: 270
objClassB.Initialize
Word: initialize
In both cases the B4X code and also the generated Objective-C code for the second example looks normal:
B4X:
_objclassb = [b4i_classb new];
[_objclassb _initialize /*NSString**/ :self.bi];
So the generated code for ClassA looks reasonable, but the generated project appears to be incomplete because the other modules are not generated.
I also enabled the IDE log mode and checked the generated log.txt. Unfortunately it did not contain a clear hint about the real cause. The only suspicious parts were entries like:
B4X:
CompilingManager: not ready
Macro
Build modules tree: 37
Building folders structure.
System.Exception: Fehler beim Kompilieren des Programms.
Fehlerbeschreibung: ',' erwartet.
...
The project might be a little bigger and complex than average projects. It uses macros before compilation to switch environment-specific internal libraries and refresh the Libraries tab. I also clean the project before compiling. Still, the failure appears as if the module tree used by Compile To Library is incomplete or inconsistent.
I would appreciate help understanding what could cause Compile To Library to generate only one b4i_classa.h/.m file although the other modules are listed in the project file and the same source code compiles as a normal application.
It would also appreciate help to get more details about the internal build process of Compile To Library: at which stage are the ModuleN entries resolved, when is the module tree built, and under which conditions can B4i stop after generating only a partial Objects/src/B4iProject folder?
Thanks,
Thomas