Opened 11 years ago
Last modified 8 years ago
#41020 assigned defect
gcc48: undefined symbol for toupper(int) when compiled as C11
Reported by: | davydden@… | Owned by: | macports-tickets@… |
---|---|---|---|
Priority: | Normal | Milestone: | |
Component: | ports | Version: | 2.2.1 |
Keywords: | Cc: | qpjevi@…, etienne.renault@…, macports@… | |
Port: | gcc48 |
Description
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.
Change History (6)
comment:1 Changed 11 years ago by ryandesign (Ryan Carsten Schmidt)
Owner: | changed from macports-tickets@… to mww@… |
---|---|
Port: | gcc48 added; gcc removed |
Summary: | undefined symbol for toupper(int) when compiled as C11 → gcc48: undefined symbol for toupper(int) when compiled as C11 |
comment:2 follow-up: 3 Changed 11 years ago by qpjevi@…
Cc: | qpjevi@… added |
---|
comment:3 Changed 11 years ago by etienne.renault@…
Replying to qpjevi@…:
Cc Me!
This bug has been reported at https://trac.macports.org/ticket/41033 and the solution mentioned worked for me !
comment:6 Changed 8 years ago by kurthindenburg (Kurt Hindenburg)
Owner: | changed from mww@… to macports-tickets@… |
---|---|
Status: | new → assigned |
Note: See
TracTickets for help on using
tickets.
Cc Me!