[ant-contrib - Help] Can not compile, can not fix - help me...

"SourceForge.net" <[email protected]> Fri, 11 Jul 2008 20:38:18 +0000
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=5090109
By: glass_knife

This is my first try using the cc ant task.  I am running fedora core 8, g++
4.1.2, and ant 1.7.0.

Here is the *.cpp file...

#include <iostream>
using namespace std;

int main(int argc, char **argv) {
	cout << "CppTest001 - Hello World!" << endl;
	return 0;
}


Here is the build script...

<?xml version="1.0" encoding="UTF-8"?>
<project name="CppTest001" default="default"
xmlns:cpptasks="antlib:net.sf.antcontrib.cpptasks">
    <target name="default" description="Testing the C++ stuff">
        <mkdir dir="target/main/obj"/>
        <cpptasks:cc outtype="executable" subsystem="console" outfile="target/hello"
objdir="target/main/obj">
        	<compiler name="g++"/>
        	<linker name="g++"/>
           	<fileset dir="src" includes="*.cpp"/>
        </cpptasks:cc>
    </target>
</project>

Here is the output...


default:
[cpptasks:cc] Starting dependency analysis for 1 files.
[cpptasks:cc] 1 files are up to date.
[cpptasks:cc] 0 files to be recompiled from dependency analysis.
[cpptasks:cc] 0 total files to be compiled.
[cpptasks:cc] Starting link
[cpptasks:cc] main/obj/main.o: In function
`__static_initialization_and_destruction_0(int, int)':
[cpptasks:cc] main.cpp:(.text+0x23): undefined reference
to `std::ios_base::Init::Init()'
[cpptasks:cc] main/obj/main.o: In function `__tcf_0':
[cpptasks:cc] main.cpp:(.text+0x6c): undefined reference
to `std::ios_base::Init::~Init()'
[cpptasks:cc] main/obj/main.o: In function `main':
[cpptasks:cc] main.cpp:(.text+0x8e): undefined reference to `std::cout'
[cpptasks:cc] main.cpp:(.text+0x93): undefined reference to `std::basic_ostream<char,
std::char_traits<char> >& std::operator<< <std::char_traits<char>
>(std::basic_ostream<char, std::char_traits<char> >&, char const*)'
[cpptasks:cc] main.cpp:(.text+0x9b): undefined reference to `std::basic_ostream<char,
std::char_traits<char> >& std::endl<char, std::char_traits<char>
>(std::basic_ostream<char, std::char_traits<char> >&)'
[cpptasks:cc] main.cpp:(.text+0xa3): undefined reference to `std::basic_ostream<char,
std::char_traits<char> >::operator<<(std::basic_ostream<char, std::char_traits<char>
>& (*)(std::basic_ostream<char, std::char_traits<char> >&))'
[cpptasks:cc] main/obj/main.o:(.eh_frame+0x11): undefined reference to
`__gxx_personality_v0'
[cpptasks:cc] collect2: ld returned 1 exit status

BUILD FAILED
/CppTest001/build.xml:5: gcc failed with return code 1

Total time: 0 seconds


I am sure I am doing something wrong, but I have no idea what to do.  I have
tried compiling everything from the command line, and it works fine.

Any help here would be great.  I love using ANT, and since I do not know a lot
about make files, I would really like to get this working.




______________________________________________________________________
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 the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/