Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

pigbrain

macrumors newbie
Original poster
Mar 4, 2005
6
0
I use a dictionary program on SunOS and planned to port it onto my Mac. I tried to compile it but got the error message:

ld: Undefined symbols:
_re_comp
_re_exec

I know the functions "re_comp" and "re_exec" are used for regular expression and I have imported unistd.h in the header file:
Code:
    ......
    #include <unistd.h>
    #ifdef __svr4__
    #include <libgen.h>
    #else
    extern char *re_comp(char *);
    extern int   re_exec(char *);
    #endif
    ......

I've even tried to take off the if-else condition. Anyhow the code compiles on SunOS but not on Mac. Is that because these two functions are deprecated or not provided on Mac?

Any suggestion? Thanks a ton. :confused:
 

MacNeXT

macrumors 6502
Jun 21, 2004
258
0
ld is the linker. The linker misses a binary in which those symbols have to be found.
 

daveL

macrumors 68020
Jun 18, 2003
2,425
0
Montana
You need to link in libcompat, which doesn't seem to be included in OS X, or you have to change the code the code to use the newer 'regex' functions, which are in libc. You can get libcompat from the Darwin "ports" project (dport).
 

gabitruc

macrumors newbie
Jul 19, 2005
2
0
ld: Undefined symbols:

Hello!

I'm having a similar problem, and cannot find which library I have to link. Does anyone have an idea?

The error is :

Code:
ld: Undefined symbols:
_CFDataGetBytes
_CFRelease
_CFShow
___CFStringMakeConstantString
_kCFAllocatorDefault
/usr/bin/libtool: internal link edit command failed

I don't know where to find those functions. :confused:
Oddly, when I compile with XCode, it works fine. XCode must include automatically the missing libraries, I think.

Does anyone know where those functions come from ?
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.