[ant-contrib - Help] RE: Problem: failed to create task or type cc

"SourceForge.net" <[email protected]> Fri, 09 Nov 2007 11:39:29 -0800
Newsgroups gmane.comp.java.ant-contrib.devel
Message-ID <[email protected]>
Read and respond to this message at: 
https://sourceforge.net/forum/message.php?msg_id=4615107
By: sharadb

Now I am trying to execute this in UNIX, facing some issues there..

1) Downloaded 'apache-ant-1.6.5-bin.tar.gz' and extracted into my home dir

2) Modified the ant script as follows

ANT_HOME=<home_dir>/apache-ant-1.6.5
JAVA_HOME=<java_home>
PATH=${PATH}:${ANT_HOME}/bin:${JAVA_HOME}/bin:$/usr/local/bin/cc  (/usr/blocal/bin/cc
is path to C++ compiler)
export CLASSPATH ANT_HOME JAVA_HOME

3) Added the above build.xml and hello.cpp file

4) Executed using the following

-> sh ant -verbose -noclasspath
Apache Ant version 1.6.5 compiled on June 2 2005
Buildfile: build.xml
Detected OS: SunOS
parsing buildfile <home_dir>/apache-ant-1.6.5/bin/build.xml with URI =
file://<home_dir>/apache-ant-1.6.5/bin/build.xml
Project base dir set to: <home_dir>/apache-ant-1.6.5/bin
Build sequence for target(s) `hello' is [cpptasks, init, hello]
Complete build sequence is [cpptasks, init, hello, ]

cpptasks:
dropping <home_dir>/apache-ant-1.6.5/bin/lib from path as it doesn't exist
parsing buildfile
jar:file:<home_dir>/apache-ant-1.6.5/lib/cpptasks.jar!/net/sf/antcontrib/cpptask
s/antlib.xml with URI
= jar:file:<home_dir>/apache-ant-1.6.5/lib/cpptasks.jar!/net/sf/antcontrib/cppta
sks/antlib.xml

init:

hello:
       [cc] Starting dependency analysis for 1 files.
       [cc] Parsing hello.cpp
       [cc] 1 files are up to date.
       [cc] 0 files to be recompiled from dependency analysis.
       [cc] 0 total files to be compiled.
       [cc] Starting link
       [cc] gcc -o hello hello.o
       [cc] Undefined                   first referenced
       [cc]  symbol                         in file
       [cc] std::cout                           hello.o
       [cc] std::ios_base::Init::~Init [in-charge]()hello.o
       [cc] std::ios_base::Init::Init[in-charge]()hello.o
       [cc] __gxx_personality_v0                hello.o
       [cc] std::basic_ostream<char, std::char_traits<char> >& std::operator<<
<std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&,
char const*)hello.o
       [cc] ld: fatal: Symbol referencing errors. No output written to hello
       [cc] collect2: ld returned 1 exit status

BUILD FAILED
<home_dir>/apache-ant-1.6.5/bin/build.xml:19: gcc failed with return code 1
        at net.sf.antcontrib.cpptasks.compiler.CommandLineLinker.link(CommandLin
eLinker.java:278)
        at net.sf.antcontrib.cpptasks.compiler.CommandLineLinkerConfiguration.li
nk(CommandLineLinkerConfiguration.java:117)
        at net.sf.antcontrib.cpptasks.CCTask.execute(CCTask.java:773)
        at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275)
        at org.apache.tools.ant.Task.perform(Task.java:364)
        at org.apache.tools.ant.Target.execute(Target.java:341)
        at org.apache.tools.ant.Target.performTasks(Target.java:369)
        at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1216)
        at org.apache.tools.ant.Project.executeTarget(Project.java:1185)
        at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExe
cutor.java:40)
        at org.apache.tools.ant.Project.executeTargets(Project.java:1068)
        at org.apache.tools.ant.Main.runBuild(Main.java:668)
        at org.apache.tools.ant.Main.startAnt(Main.java:187)
        at org.apache.tools.ant.launch.Launcher.run(Launcher.java:246)
        at org.apache.tools.ant.launch.Launcher.main(Launcher.java:67)

Total time: 2 seconds



Can somebody tell me from where does it pick up this path?
"dropping <home_dir>/apache-ant-1.6.5/bin/lib from path as it doesn't exist"

And is this again some issue with the C++ compiler/linker?

What could be the issue and resolution?

Thanks,
Sharad.



______________________________________________________________________
You are receiving this email because you elected to monitor this forum.
To stop monitoring this forum, login to SourceForge.net and visit: 
https://sourceforge.net/forum/unmonitor.php?forum_id=113701

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/