
Hello, I have a question about cabal versioning. It's possible to export in a cabal library a version, so instead of getting version from: import Paths_my_package( version ) I want to get version from my library using: import MyPackage( version ) And then using this from programs. Thanks, Luis

On Jun 7, 2011, at 11:10 AM, Luis Cabellos wrote:
Hello,
I have a question about cabal versioning. It's possible to export in a cabal library a version, so instead of getting version from:
import Paths_my_package( version )
I want to get version from my library using:
import MyPackage( version )
And then using this from programs.
Thanks, Luis
You can export things from one module that are defined in other modules. For example:
module MyPackage ( version, ... ) import Paths_my_package( version ) ...
-- James

For example:
module MyPackage ( version, ... )
import Paths_my_package( version ) ...
Yes indeed, but I getting ugly errors (undefined references to version I
You can export things from one module that are defined in other modules. think) when use Paths_my_package from library, and i don't know a better fix: /home/cabellos/.cabal/lib/skema-server-0.1.0/ghc-6.12.3/libHSskema-server-0.1.0.a(Main.o): In function `r4HU_info': (.text+0x3ef9): undefined reference to `skemazmserverzm0zi1zi0_Pathszuskemazuserver_version1_closure' /home/cabellos/.cabal/lib/skema-server-0.1.0/ghc-6.12.3/libHSskema-server-0.1.0.a(Main.o): In function `s5TE_info': (.text+0x8e03): undefined reference to `__stginit_skemazmserverzm0zi1zi0_Pathszuskemazuserver_' Also, I'm using Dyre, It's possible that recompile proccess of dyre cause the error.

On Jun 7, 2011, at 12:28 PM, Luis Cabellos wrote:
You can export things from one module that are defined in other modules. For example:
module MyPackage ( version, ... )
import Paths_my_package( version ) ...
Yes indeed, but I getting ugly errors (undefined references to version I think) when use Paths_my_package from library, and i don't know a better fix: /home/cabellos/.cabal/lib/skema-server-0.1.0/ghc-6.12.3/libHSskema- server-0.1.0.a(Main.o): In function `r4HU_info': (.text+0x3ef9): undefined reference to `skemazmserverzm0zi1zi0_Pathszuskemazuserver_version1_closure' /home/cabellos/.cabal/lib/skema-server-0.1.0/ghc-6.12.3/libHSskema- server-0.1.0.a(Main.o): In function `s5TE_info': (.text+0x8e03): undefined reference to `__stginit_skemazmserverzm0zi1zi0_Pathszuskemazuserver_'
Also, I'm using Dyre, It's possible that recompile proccess of dyre cause the error.
Did you tell cabal that Paths_my_package is a part of your library? If it is referenced by your code, then it should be listed in either "exposed-modules" or "other-modules", otherwise it won't be installed. I've never used dyre so I don't know whether it would cause any issues, but I suspect not. -- James

Did you tell cabal that Paths_my_package is a part of your library? If it is referenced by your code, then it should be listed in either "exposed-modules" or "other-modules", otherwise it won't be installed. I've never used dyre so I don't know whether it would cause any issues, but I suspect not.
Thank's a lot, the use of other-models fix my problem!
participants (2)
-
James Cook
-
Luis Cabellos