Skip to content

Conversation

Pign
Copy link

@Pign Pign commented Feb 21, 2025

Add basic explanation about dll_import and dll_export

Add informations about dll_import and dll_export
...the c++ compiler will start the two step compilation process (1. generate the c++ source files, and 2. kick off the c++ compiler to create the executable).
The result will be a host executable called **bin/Host** on Linux/Mac and **bin/Host.exe** on Windows.

You will notice that an additional file will be created : `export_classes.info`. This file contains informations about classes and other components included in the host you have just generated.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The plural is "information" too.

You will notice that an additional file will be created : `export_classes.info`. This file contains informations about classes and other components included in the host you have just generated.
You can specify a path for this file by using `-D dll_export=my/path/export_class.info`.

Moreover, when compiling your CPPIA script, you'll want to add its counterpart: `-D dll_import=my/path/export_class.info`.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It might be because I'm lacking context but I don't understand what this sentence means. What are we adding where and why?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Given it's a -D I thought it was pretty obvious that it was added to the command line used to start compilation.

However, since compiling the host creates a file that should be used to compile the guest, I think it's the whole tutorial that needs to be updated to start with the host creation…

I didn't want to change too much at first but the more I think about it, the more it seems necessary.
I'm going to head that way and update the PR.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's the whole tutorial that needs to be updated to start with the host creation…

@Pign I think there is some benefit to having the simple script creation page first, to show how easy it is to get running with the builtin host.

I was about to make a PR because I also found this set of pages to be a bit lacking, but I didn't think to check first and completely missed your PR 😅...

Here is my version, where I took the approach of just adding a new page: https://github.com/tobil4sk/code-cookbook/blob/553adbcd10abaad8eed02083599d6fa07fe59bac/assets/content/cookbook/Other/Working-with-cppia/05.host-vs-script-classes.md. I think it is helpful to see an example of why export_classes.info might be needed, rather than just mentioning it and how to change the path. Let me know if you have any thoughts or improvements.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants