
Hi, I get the following error message: cetin@unique:~/lab/test/qths/hnm$ make configure runhaskell Setup.hs configure Configuring HNM-0.2... cetin@unique:~/lab/test/qths/hnm$ make build runhaskell Setup.hs build Preprocessing library HNM-0.2... Preprocessing executables for HNM-0.2... Building HNM-0.2... demo3.hs:4:7: Could not find module `HNM.WLAN': Use -v to see a list of the files searched for. make: *** [build] Error 1 when I try to build the following program: http://sert.homedns.org/hs/hnm/ http://sert.homedns.org/hs/hnm/hnm.cabal How can I tell in my cabal file that wlan.hs should be built first than settings.hs than demo3.hs? Best Regards, Cetin Sert

-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA512 2008/12/23 Cetin Sert :
Hi,
I get the following error message:
cetin@unique:~/lab/test/qths/hnm$ make configure runhaskell Setup.hs configure Configuring HNM-0.2... cetin@unique:~/lab/test/qths/hnm$ make build runhaskell Setup.hs build Preprocessing library HNM-0.2... Preprocessing executables for HNM-0.2... Building HNM-0.2...
demo3.hs:4:7: Could not find module `HNM.WLAN': Use -v to see a list of the files searched for. make: *** [build] Error 1
when I try to build the following program: http://sert.homedns.org/hs/hnm/ http://sert.homedns.org/hs/hnm/hnm.cabal
How can I tell in my cabal file that wlan.hs should be built first than settings.hs than demo3.hs?
Best Regards, Cetin Sert
You need some changes like this (as a Darcs patch): adddir ./HNM move ./settings.hs ./HNM/Settings.hs move ./wlan.hs ./HNM/WLAN.hs hunk ./hnm.cabal 3 - -Description: Happy Network Manager - -License: BSD +Synopsis: Happy Network Manager +Category: Network, System +homepage: http://sert.homedns.org/hs/hnm/ +License: BSD3 hunk ./hnm.cabal 9 - -Maintainer: cetin@sertcom.de +Maintainer: hunk ./hnm.cabal 13 +data-files: settings.conf + hunk ./hnm.cabal 17 - -ghc-options: -O3 -fglasgow-exts +other-modules: HNM.WLAN, HNM.Settings +ghc-options: -O2 -fglasgow-exts Note that -O3 is counterintuitively no better than -O2, and may be worse. You should probably change the -fglasgow-exts to individual per-file {-# LANGUAGE #-} pragmas. And you don't declare all your dependencies, for example I see Gtk2Hs imports, but no declarations in build-depends:. To solve your problem, you need to put the module names in other-modules:, but your modules are at wrong names. If a module's name is HNM.Settings, then it needs to be at Settings.hs. - -- gwern -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) iEYEAREKAAYFAklRGQcACgkQvpDo5Pfl1oLDHgCfcRswCMsUUPZLknvUrENM/MmD U7gAoIBq0CXXU6XHKn0L4kGi45zENNJ3 =txxi -----END PGP SIGNATURE-----

On Tue, 2008-12-23 at 17:27 +0100, Cetin Sert wrote:
when I try to build the following program: http://sert.homedns.org/hs/hnm/ http://sert.homedns.org/hs/hnm/hnm.cabal
How can I tell in my cabal file that wlan.hs should be built first than settings.hs than demo3.hs?
You need to follow the standard file name convention for modules. The module HNM.WLAN needs to be in the file HNM/WLAN.hs rather than wlan.hs. Similarly you will need to rename settings.hs to HNM/Settings.hs. That way cabal and ghc will be able to find the files. In the .cabal file you do not need these fields: Extra-Source-Files: wlan.hs, settings.hs HS-Source-Dirs: . Instead you should use: other-modules: HNM.WLAN, HNM.Settings Looking at: ghc-options: -fglasgow-exts -O3 --make you do not need '--make'. Using 'cabal check' or 'sdist' will have other suggestions for better portability and recommended practise. Duncan
participants (3)
-
Cetin Sert
-
Duncan Coutts
-
Gwern Branwen