- Als neu kennzeichnen
- Lesezeichen
- Abonnieren
- Stummschalten
- RSS-Feed abonnieren
- Kennzeichnen
- Anstößigen Inhalt melden
I have a project made of a console application and multiple DLLs called by this application (all in Fortran). I want to define a structure type that will be used in both the executable and the DLLs.
What is the best practice for defining this type, and have it in the scope of the executable and all the DLLs that need it? I could create a module in each project with a duplicate of the type definition, but then that means having multiple copies to maintain in parallel - an obvious source of non-obvious bugs.
Another solution is possibly to have the module defined in the main executable source, then adding the same module source to the DLL projects.
Maybe there is a better way to achieve this? It almost sounds like I need to create a project (say, an *empty DLL) that only contains this module.
Thanks,
Olivier
Link kopiert
- Als neu kennzeichnen
- Lesezeichen
- Abonnieren
- Stummschalten
- RSS-Feed abonnieren
- Kennzeichnen
- Anstößigen Inhalt melden
New in version 12 (Composer XE 2011), the output folder of the dependent project will be added automatically as an additional INCLUDE folder, so no more manually specifying the dependent project for INCLUDE.
- Als neu kennzeichnen
- Lesezeichen
- Abonnieren
- Stummschalten
- RSS-Feed abonnieren
- Kennzeichnen
- Anstößigen Inhalt melden
when you mention a 'project' you don't mention a 'solution'.
Areyouusing asolution which contians themany projects from the many locations?
To add to what Steve has said i would suggest using a solution with all the DLLs in them and create a separate 'your_shared_data' dll which contains the structure/data (and also any other stuff you want to exchange).
Then set the output directory for the projects in the solution to $(SolutionDir)$(ConfigurationName)
and output files from each project to $(SolutionDir)$(ConfigurationName)\EACHDLLNAME.dll
where EACHDLLNAME is the DLL name for each project
and don't forget to export your DLL names
!DEC$ ATTRIBUTES DLLEXPORT :: YOURDLLNAME
and of course the shared_data DLL elements
!dec$ attributes dllexport :: YOUR_SHARED_DATA
- Als neu kennzeichnen
- Lesezeichen
- Abonnieren
- Stummschalten
- RSS-Feed abonnieren
- Kennzeichnen
- Anstößigen Inhalt melden
Yes, it is just the structure definition which is shared. I will follow your suggestion of creating a dummy library containing the module source.
Thanks again!
Olivier

- RSS-Feed abonnieren
- Thema als neu kennzeichnen
- Thema als gelesen kennzeichnen
- Diesen Thema für aktuellen Benutzer floaten
- Lesezeichen
- Abonnieren
- Drucker-Anzeigeseite