View previous topic :: View next topic |
Author |
Message |
ParticlePeter
Joined: 19 Nov 2011 Posts: 49 Location: Germany
|
Posted: Mon Dec 05, 2011 7:54 am Post subject: Problems linking to Library gl3n |
|
|
Hi,
How would I set up my VisualD Project to link against this Library:
https://bitbucket.org/dav1d/gl3n
It comes with 4 d-Files, they are in the directory named gl3n. In the sourcefile there is a module definition directory.filename ( e.g. source util.d module gl3n.util ; )
The linker complaints that he cannot find the symbols within my exe which are defined in those files. _________________ Cheers, searching for the Pivot of my Soul, PP |
|
Back to top |
|
|
sagitario
Joined: 03 Mar 2007 Posts: 292
|
Posted: Mon Dec 05, 2011 12:17 pm Post subject: |
|
|
You get link errors because the imported files are not automatically compiled, so they are missing for the link.
The proper way is to create a Visual D library project and add the 4 files to it, then add it as a build dependency to your executable project.
The simple way is to just drag them into your project, so they get compiled when you build the executable.
In both cases, you have to add the path to the gl3n folder to the import path setting in the project (or in the global settings if you plan to use it in most of your projects). |
|
Back to top |
|
|
ParticlePeter
Joined: 19 Nov 2011 Posts: 49 Location: Germany
|
Posted: Mon Dec 05, 2011 6:31 pm Post subject: |
|
|
THX very much,
the project approach worked immediately
Have just one doubt, maybe you could clarify. I'm not sure, but I thing the library uses compile time code evaluation and string mixins. What happens if my code requires some additional generic function from that library, but the gl2n.lib is already build, and according to the compiler up to date ? Would the lib get rebuilded automatically ? _________________ Cheers, searching for the Pivot of my Soul, PP |
|
Back to top |
|
|
sagitario
Joined: 03 Mar 2007 Posts: 292
|
Posted: Tue Dec 06, 2011 1:25 am Post subject: |
|
|
Code for instantiated templates and mixins is generated into the object files of the modules that use the templates or mixins, not the library. So you don't need to worry about it. |
|
Back to top |
|
|
|