bug-binutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug binutils/10711] New: ar/ranlib fake my .o files . C++ in autotools


From: sql7 at wp dot pl
Subject: [Bug binutils/10711] New: ar/ranlib fake my .o files . C++ in autotools
Date: 30 Sep 2009 13:53:16 -0000

`Packages:
debian/sid.

I write minimal app that cause errors:

test.cpp:
#include "test.hpp"
using namespace biox::priv;

argParser::argParser(int a,char **b)
        {}

test.hpp:
namespace biox{
namespace priv{
class   argParser
        {
        public:
        argParser(int,char**);
        };
        }}

test_e.cpp:
#include "test.hpp"

int main (int argc,char** argv)
        {
        biox::priv::argParser parser(argc,argv);
        return 0;
        }

test.cpp and test.hpp => libtest.a
libtest.a: rn -s
Archive index:
_ZN4biox4priv9argParserC2EiPPc in test.o
_ZN4biox4priv9argParserC1EiPPc in test.o

test.o:
00000006 T _ZN4biox4priv9argParserC1EiPPc
00000000 T _ZN4biox4priv9argParserC2EiPPc

error:
 
test_e.o: In function `main':
test_e.cpp:(.text+0x25): undefined reference to
`biox::priv::argParser::argParser(int, char**)'

test script for chceck:
#!/bin/bash
echo "Compiling directly ... "
g++ -o /dev/null test.cpp test_e.cpp && echo "OK"
echo "Compiling ranlib like automake ... "
g++ -c -o test.o test.cpp &&\
g++ -c -o test_e.o test_e.cpp &&\
ar cru libtest.a test.o &&\
ranlib libtest.a &&\
g++ -o /dev/null libtest.a test_e.o &&\
echo "OK"

how fix this in autotools ?

-- 
           Summary: ar/ranlib fake my .o files . C++ in autotools
           Product: binutils
           Version: 2.19
            Status: NEW
          Severity: normal
          Priority: P2
         Component: binutils
        AssignedTo: unassigned at sources dot redhat dot com
        ReportedBy: sql7 at wp dot pl
                CC: bug-binutils at gnu dot org


http://sourceware.org/bugzilla/show_bug.cgi?id=10711

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]