NAnt build issues with Mono
I am trying to build a Mono project using NAnt but I get the error listed below. I have tried altering the environment variable PKG_CONFIG_PATH to include the path leading to the file: mono.pc but that does not seem to work.
Failed to initialize the 'Mono 3.5 Profile' (mono-3.5) target framework.:
NAnt.Core.BuildException: Failed to initialize the 'Mono 3.5 Profile' (mono-3.5) target framework. ---> Unable to locate 'mono' module using pkg-config. Download the Mono development packages from http://www.mono-project.com/downloads/.:
NAnt.Core.BuildException: Unable to locate 'mono' module using pkg-config. Download the Mono development packages from http://www.mono-project.com/downloads/.
at NAnt.Core.Tasks.FailTask.ExecuteTask () [0x00000] in <filename unknown>开发者_JAVA百科:0
at NAnt.Core.Task.Execute () [0x00000] in <filename unknown>:0
--- End of inner exception stack trace ---
at NAnt.Core.FrameworkInfo.Init () [0x00000] in <filename unknown>:0
at NAnt.Core.FrameworkInfo.Validate () [0x00000] in <filename unknown>:0
at NAnt.Core.ProjectSettingsLoader.ConfigureRuntimeFramework () [0x00000] in <filename unknown>:0
I've recently had the same problem trying to install the TAO Framework on Mac OSX 10.6.5 under Mono 2.8.1 with Nant 0.90 (FYI). Here's how I was led to solve this (guided by this page):
- Locate the nant script itself ('/usr/bin/nant' on OSX, try 'which nant')
- Open the 'nant' script in an editor (you might need the right permissions).
- On a new line and before the 'exec ...' line, add something like:
export PKG_CONFIG_PATH=/path/to/Mono/Framework/Versions/VERSION/lib/pkgconfig
my Mac OSX version looks like:
export PKG_CONFIG_PATH=/opt/local/lib/pkgconfig:/Library/Frameworks/Mono.framework/Versions/Current/lib/pkgconfig/
(nb. my version actually has 2 pkgconfig paths, separated by a colon ':', '/usr/lib/pkgconfig' is also searched automatically, JFYI).
Also, you should add the exact same 'export' line to one of your .bashrc or .profile files (or the corresponding /etc/bashrc or /etc/profile files to set this globally).
Hope this helps.
Cheers
Rich
For me adding '/Library/Frameworks/Mono.framework/Versions/Current/bin' to the PATH has solved the issue on Mac OS X 10.7.3 with Mono 2.10.9 and NAnt 0.91.
精彩评论