[MacPorts] #41020: undefined symbol for toupper(int) when compiled as C11
MacPorts
noreply at macports.org
Mon Oct 28 06:35:20 PDT 2013
#41020: undefined symbol for toupper(int) when compiled as C11
------------------------+--------------------------------
Reporter: davydden@… | Owner: macports-tickets@…
Type: defect | Status: new
Priority: Normal | Milestone:
Component: ports | Version: 2.2.1
Keywords: | Port: gcc
------------------------+--------------------------------
The simple example which uses toupper(int)
{{{
#include <stdio.h>
#include <ctype.h>
int main ()
{
int i=0;
char str[]="Test String.\n";
char c;
while (str[i])
{
c=str[i];
putchar (toupper(c));
i++;
}
return 0;
}
}}}
does link via
{{{
g++-mp-4.8 main.cc -o main
}}}
but does not when invoking C11:
{{{
g++-mp-4.8 -std=c++11 main.cc -o main
Undefined symbols for architecture x86_64:
"toupper(int)", referenced from:
_main in ccWjHauc.o
ld: symbol(s) not found for architecture x86_64
collect2: error: ld returned 1 exit status
}}}
Macports was build on Xcode 5 under 10.9.
I am not sure if this is related to gcc4.8, but this behavior was not the
case for the previous Xcode (4.6) and OS-X Mountain Lion.
--
Ticket URL: <https://trac.macports.org/ticket/41020>
MacPorts <http://www.macports.org/>
Ports system for OS X
More information about the macports-tickets
mailing list