until now, generation always happened in linux-side (generatedlibraries however have been tested on windows, time to time... when generation has nothing to do with the platform :P).
I have to say that pharo-cig is not a "pharo team" project (in the sense any member of the pharo team can take it). While we can have this conversation here, I would very much prefer if we have it at https://github.com/pharo-cig/pharo-cig :)
Forwarding the original email.
Dear Pharo Team,
I am currently attempting to replicate what Esteban Lorenzano did for this Youtube Video (Esteban Lorenzano - Pharo-CIG: C++ Interface Generator - 23 April 2025), which is to generate C Bindings for Pharo uFFI to call, in Windows 11. Unfortunately, I am unable to replicate the results of the video. The results of my attempts leads to Pharo's Virtual Machine crashing and exiting abruptly to the launcher. I am unable to find any logs for this, and would appreciate your support for this matter.
OS: Windows 11
Steps to Reproduce
Step 1: Create Image

Step 2: Installing Pharo CIG
Open Playground wtih 'Ctrl + O + P' (or 'Cmd + O + P').
Copy and paste the Installation Code from the Pharo CIG Github.
Click the "Do it All" green triangle button on the top left of the Playground Window.

Step 3: Installing Clang
Download and run the Pre-built binaries from this
Github page according to your platform.
The folder named LLVM should be in your "C:\Program Files" directory after installation for Windows 11.
Other installation methods may be used according to your preference.
Step 4: Installing raylib
Download or clone the raylib Github repository.
Extract the folder ('raylib-master') if you are downloading the repository.
Place the folder in a directory of your preference. E.g "C:\Users\morgan\raylib-master"
Step 5: Setting Pharo CIG Requirements
CIG needs to be able to find the clang library. If it cannot find it automatically, set the location in LibClang>>unix64LibraryName, e.g.
- Pharo CIG Github
Open System Browser with 'Ctrl + O + B' (or 'Cmd + O + B').
Create a "win32LibraryName" method in the LibClang class under the CIG-LibClang package to set your "libclang.dll" location. This method is missing from the default installation.
Paste in this code (There may be whitespace character issues):
win32LibraryName ^ FFIWindowsLibraryFinder new userPaths: #('C:\Program Files\LLVM\bin'); findAnyLibrary: #('libclang.dll')
|
Save and create the method with 'Ctrl + S' (or 'Cmd + S').
Step 6: The Example Recipe from Github
Open Playground wtih 'Ctrl + O + P' (or 'Cmd + O + P').
Copy and paste the example recipe from Github into the Playground.
Configure the example recipe from Github.
Change "import:" and "cIncludedPath:" directories according to your file structure. E.g '/home/esteban/dev/vm/raylib/src/raylib.h' ��� 'C:\Users\morgan\raylib-master\src\raylib.h'
Click the "Do it All" green triangle button on the top left of the Playground Window. This should cause the Virtual Machine to abruptly exit or crash.
Code Snippet (There may be whitespace character issues):
(lib := CigCLibraryGenerator new)
"Prefix to be added to the generated classes (structures, enums, etc.)"
prefix: 'Ray';
"name of the generated package (by default, is the same as the libraryName, capitalized)"
packageName: 'Raylib';
"Library name. If not unixLibraryName, macLibraryName and winLibraryName
are specified, it will be taken as base name for the existing libraries
(e.g. in this case raylib.so, raylib.dylib and raylib.dll)"
libraryName: 'raylib';
"headers to import (there can be as many of them as is needed)."
import: 'C:\Users\morgan\raylib-master\src\raylib.h';
import: 'C:\Users\morgan\raylib-master\src\rcamera.h';
"include path (-I of c compiler), to allow libclang to find other
included headers."
cIncludePath: 'C:\Users\morgan\raylib-master\src';
"Since this is a graphical library, instruct the library to run in mainthread
(otherwise, default is 'same thread' which is the same thread the pharo is
running)"
useMainThread.
"generate the library"
lib generate.
|
End of email.