[MacPorts] #46202: Undefined symbols for architecture x86_64 on Yosemite
MacPorts
noreply at macports.org
Thu Dec 11 02:20:44 PST 2014
#46202: Undefined symbols for architecture x86_64 on Yosemite
------------------------+--------------------------------
Reporter: nmsnoopy@… | Owner: macports-tickets@…
Type: defect | Status: new
Priority: High | Milestone:
Component: ports | Version: 2.3.3
Keywords: linker | Port: log4cpp
------------------------+--------------------------------
hello,
First of all thanks a lot to have solved my first ticket : #46178, I
resintalled from scratch gcc48 and now gcc48 works.
The problem I have now(and from the beginning in fact) is a linking
problem on Yosemite. Here below I added a simple code using the log4cpp
library which fails at the link level. I have only installed the gcc48,
log4cpp and boost ports (Note that the same program does not fail on
Mavericks).
Thanks to help me on this.
The link error is:
{{{
> g++ -o test4 test4.cpp -L/opt/local/lib -llog4cpp
Undefined symbols for architecture x86_64:
"log4cpp::OstreamAppender::OstreamAppender(std::basic_string<char,
std::char_traits<char>, std::allocator<char> > const&,
std::basic_ostream<char, std::char_traits<char> >*)", referenced from:
_main in cc8Xtd0v.o
ld: symbol(s) not found for architecture x86_64
collect2: error: ld returned 1 exit status
}}}
The example code:
{{{
#include "log4cpp/Category.hh"
#include "log4cpp/Appender.hh"
#include "log4cpp/OstreamAppender.hh"
int main(int argc, char** argv) {
log4cpp::Appender *appender1 = new log4cpp::OstreamAppender("console",
&std::cout);
return 0;
}
}}}
--
Ticket URL: <https://trac.macports.org/ticket/46202>
MacPorts <https://www.macports.org/>
Ports system for OS X
More information about the macports-tickets
mailing list