Page 1 of 1

undefined reference to regex function

Posted: Wed Sep 12, 2018 12:57 pm
by gost.404
Hi everyone,
I'm trying to use regex.h library but get linker errors:

Code: Select all

/home/gost/esp/ups_motinor/build/main/libmain.a(app_main.o):(.literal.app_main+0x70): undefined reference to `regcomp'
/home/gost/esp/ups_motinor/build/main/libmain.a(app_main.o):(.literal.app_main+0x74): undefined reference to `regexec'
/home/gost/esp/ups_motinor/build/main/libmain.a(app_main.o):(.literal.app_main+0x78): undefined reference to `regfree'
/home/gost/esp/ups_motinor/build/main/libmain.a(app_main.o): In function `app_main':
/home/gost/esp/ups_motinor/main/app_main.cpp:209: undefined reference to `regcomp'
/home/gost/esp/ups_motinor/main/app_main.cpp:216: undefined reference to `regexec'
/home/gost/esp/ups_motinor/main/app_main.cpp:229: undefined reference to `regfree'
collect2: error: ld returned 1 exit status
I suppose that appropriate c-files are missed but if this true why regex.h still exist?

Re: undefined reference to regex function

Posted: Tue Nov 06, 2018 4:11 pm
by SpenZerX
Any news here? I have the same problem. Can i use regex?