Link Error Using gcc49 port on Mac OS 10.9
Geoffrey at Odhner.net
Fri Dec 6 19:26:30 PST 2013
I also tried your suggestion of using clang. I installed the MacPorts port of clang-3.4, which compiled my program fine, but when I ran it, it gave exceptions on regexes that it shouldn't! I have a regex std::regex phone_("\\PHONE ?"), and I learned that their regular expression engine is very much more particular about adhering to the ECMA standard in its parsing of regular expressions, but because the standard doesn't explicitly require it, they don't support matching of backslashes, even when they are specified using hex escape sequences. This is really a problem! How can they not support matching against a specific character? Well, that's why I need to go back to GCC for now. I always seem to run into the issues with compilers. Thanks again for your help.
On 6 Dec 2013, at 2:59, Ryan Schmidt wrote:
> On Dec 5, 2013, at 23:10, Geoffrey Odhner wrote:
>> I just installed MacPorts, and gcc49, and tried to compile a simple program, which really should work, but I'm getting a link error. I narrowed it down, and if I take out the use of any regex then it will link. I can leave in the #include <regex> line, but if I have any line that actually does a regex_search or a regex_replace, then I get the following error output when I compile and link (with my compile line shown first):
>> g++-mp-4.9 -std=c++11 -ggdb test-program.cxx -o test-program
>> Undefined symbols for architecture x86_64:
>> "__istype(int, unsigned long)", referenced from:
>> std::ctype<char>::is(unsigned long, char) const in test-program.o
>> ld: symbol(s) not found for architecture x86_64
>> collect2: error: ld returned 1 exit status
>> Can anyone help me? I don't know what to do next.
> I don’t know the answer but I Googled the error message and found this post; does that help?
> I’d also ask if you really need to use gcc. Could you use clang instead?
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 882 bytes
Desc: OpenPGP digital signature
More information about the macports-users