Hi there, my code uses a load of tr1 undefined maps for example so i need to use the newer functions however trying to link is not working; i've reduced the code to the following simple example (there are many more functions that don't in fact link but assuming they are all related to single cause):

/* isalnum example */
#include <stdio.h>
#include <ctype.h>
#include <string>

int main ()
{
  int i;
  char str[]="c3po...";
  i=0;
  while (isalnum(str[i])) i++;
  printf ("The first %d characters are alphanumeric.\n",i);
  return 0;
}

I installed and activated mac ports as follows:
sudo port install libgcrypt
sudo port install gcc48 +universal
sudo port select --set gcc mp-gcc48
hash gcc
gcc --version
sudo port install wxWidgets-3.0 +universal
sudo port select --set wxWidgets wxWidgets-3.0
hash wx-config
sudo port install psqlODBC postgresql92 postgresql92-server
sudo port install pgAdmin3
sudo mkdir -p /opt/local/var/db/postgresql92/defaultdb
sudo chown postgres:postgres /opt/local/var/db/postgresql92/defaultdb
sudo su postgres -c '/opt/local/lib/postgresql92/bin/initdb -D /opt/local/var/db/postgresql92/defaultdb' sudo launchctl load -w /Library/LaunchDaemons/org.macports.postgresql92-server.plist

Now trying to compile gives:
chrisd$ g++ -std=c++11 -o test test.cpp
Undefined symbols for architecture x86_64:
  "isalnum(int)", referenced from:
      _main in ccDuU6gp.o
ld: symbol(s) not found for architecture x86_64
collect2: error: ld returned 1 exit status

g++ -std=gnu++0x -o test test.cpp
Undefined symbols for architecture x86_64:
  "isalnum(int)", referenced from:
      _main in cc63DZ6i.o
ld: symbol(s) not found for architecture x86_64
collect2: error: ld returned 1 exit status

it's no good trying to change architecture:

g++ -arch i386 -std=gnu++0x -o test test.cpp
Undefined symbols for architecture i386:
  "isalnum(int)", referenced from:
      _main in ccNfChK7.o
ld: symbol(s) not found for architecture i386
collect2: error: ld returned 1 exit status


Any help would be much appreciated. Thanks

Christopher

_______________________________________________
macports-users mailing list
[email protected]
https://lists.macosforge.org/mailman/listinfo/macports-users

Reply via email to