In one of my iphone projects I have used the RegexLiteKit for drawing rout in my mapview. While compiling the following failures are showing,
Undefined symbols for architecture i386:
"_uregex_start", referenced from:
_rkl_performRegexOp in RegexKitLite.o
_rkl_search in RegexKitLite.o
_rkl_findRanges in RegexKitLite.o
"_uregex_end", referenced from:
_rkl_performRegexOp in RegexKitLite.o
_rkl_search in RegexKitLite.o
_rkl_findRanges in RegexKitLite.o
"_uregex_setText", referenced from:
_rkl_clearCacheSlotSetTo in RegexKitLite.o
_rkl_setCacheSlotToString in RegexKitLite.o
"_uregex_find", referenced from:
_rkl_search in RegexKitLite.o
"_uregex_findNext", referenced from:
_rkl_search in RegexKitLite.o
_rkl_replaceAll in RegexKitLite.o
"_u_errorName", referenced from:
_rkl_NSExceptionForRegex in RegexKitLite.o
_rkl_userInfoDictionary in RegexKitLite.o
"_u_strlen", referenced from:
_rkl_userInfoDictionary in RegexKitLite.o
"_uregex_reset", referenced from:
_rkl_replaceAll in RegexKitLite.o
"_uregex_appendReplacement", referenced from:
_rkl_replaceAll in RegexKitLite.o
"_uregex_appendTail", referenced from:
_rkl_replaceAll in RegexKitLite.o
"_uregex_open", referenced from:
_rkl_getCachedRegex in RegexKitLite.o
"_uregex_groupCount", referenced from:
_rkl_getCachedRegex in RegexKitLite.o
"_uregex_close", referenced from:
_rkl_clearCacheSlotRegex in RegexKitLite.o
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Is there any way to make RegexLiteKit work? please help..
go to your target build settings
search for linker flags
double tap near other linker flags and add -licucore
done
Add libicucore framework to your project solve this issue and for reference go through this link http://www.mobisoftinfotech.com/blog/iphone/iphone-regular-expression-tutorial-regexkitlite-framework/
I have solve this issue by adding libicucore framework to my project.The way to add libicucore frame work Build Settings-> Linking->Other Linker Flags --> -licucore
You need to set linker flags below are steps to do same.
Go to Build Settings-> Linking->Other Linker Flags --> -licucore
Don't forget to add - above licucore
If you are not using arc for project then please add compiler flag -fno-objc-arc for RegexKitLite.m.
Next you must add Other linker flag by follow:
Build Settings > Linking > Other Linker Flags
Add:
-licucore
-ObjC
-lc++
Thanks,
For iOS 9.2 and Xcode 7, I solved the problem as follow
Click your project
Click target
Click "Build Phases" tab
Double click RegexKitLie.m
Enter -fno-objc-arc in opend box
Done and enjoy.
Related
I am trying to build the pocl library on MacOS
System:
MBP 16" 2019
Intel i9, AMD Radeon 5500m
Mac OS 12.4
using bash, instead of zsh
llvm from home-brew, -version 14
I have the following in my .bash_profile to setup the build environment
export PATH=/usr/local/opt/llvm/bin:$PATH
export CC=clang
export CMAKE_C_COMPILER=clang
export CXX=clang++
export CMAKE_CXX_COMPILER=clang++
I go and clone the repo with git, cd into the source directory, mkdir build
Then in build/ run:
cmake .. -DENABLE_TESTS=OFF -DENABLE_EXAMPLES=OFF -DENABLE_ICD=OFF
The config seems to work and then when I run make everything builds, and gets to the end but then gives me the following error:
[100%] Linking C executable poclcc
clang-14: warning: argument unused during compilation: '-pie' [-Wunused-command-line-argument]
Undefined symbols for architecture x86_64:
"_clBuildProgram", referenced from:
_main in poclcc.c.o
_poclu_load_program_multidev in libpoclu.a(misc.c.o)
"_clCreateCommandQueue", referenced from:
_poclu_get_any_device2 in libpoclu.a(misc.c.o)
_poclu_get_multiple_devices in libpoclu.a(misc.c.o)
"_clCreateContext", referenced from:
_main in poclcc.c.o
_poclu_get_any_device2 in libpoclu.a(misc.c.o)
_poclu_get_multiple_devices in libpoclu.a(misc.c.o)
"_clCreateContextFromType", referenced from:
_poclu_create_any_context in libpoclu.a(misc.c.o)
"_clCreateProgramWithBinary", referenced from:
_poclu_load_program_multidev in libpoclu.a(misc.c.o)
"_clCreateProgramWithIL", referenced from:
_poclu_load_program_multidev in libpoclu.a(misc.c.o)
"_clCreateProgramWithSource", referenced from:
_main in poclcc.c.o
_poclu_load_program_multidev in libpoclu.a(misc.c.o)
"_clGetDeviceIDs", referenced from:
_main in poclcc.c.o
_poclu_get_any_device2 in libpoclu.a(misc.c.o)
_poclu_get_multiple_devices in libpoclu.a(misc.c.o)
"_clGetDeviceInfo", referenced from:
_main in poclcc.c.o
_poclu_load_program_multidev in libpoclu.a(misc.c.o)
"_clGetPlatformIDs", referenced from:
_main in poclcc.c.o
_poclu_create_any_context in libpoclu.a(misc.c.o)
_poclu_get_any_device2 in libpoclu.a(misc.c.o)
_poclu_get_multiple_devices in libpoclu.a(misc.c.o)
"_clGetProgramBuildInfo", referenced from:
_main in poclcc.c.o
_poclu_show_program_build_log in libpoclu.a(misc.c.o)
"_clGetProgramInfo", referenced from:
_main in poclcc.c.o
_poclu_show_program_build_log in libpoclu.a(misc.c.o)
"_clReleaseContext", referenced from:
_main in poclcc.c.o
"_clReleaseProgram", referenced from:
_main in poclcc.c.o
ld: symbol(s) not found for architecture x86_64
I checked and libOpenCL.dylib was successfully built in the pocl/build/lib/CL/ directory. Just as a check, I tried compiling clinfo with a direct link to this library and it gave me the same set of error messages shown above.
Running nm libOpenCL.dylib | grep clBuildProgram prints the following:
0000000000013850 t _clBuildProgram
So its in there, but it is a local text section symbol. I don't actually know what that means though, and if that means it should work, or should not work. I don't actually understand what the problem is here or why this linking is failing, or what to do about it. Looking for some guidance on that.
The meaning of the lower case t is that the symbols are local, i.e. not externally visible to linking programs. Upper case T would be externally visible.
POCL has a number of configuration options, not all of which are documented in the Build section of the docs. The VISIBILITY_HIDDEN option is on by default unless the ENABLE_PROXY option is on.
In build/, running:
cmake .. -DENABLE_ICD=OFF -DVISIBILITY_HIDDEN=OFF
and then:
make
the compile succeeds to the end. Then in build/lib/CL/ running:
nm libOpenCL.dylib | grep clBuildProgram
now prints:
0000000000013790 T _clBuildProgram
$clang++ main.cpp -o out
Got following error, the same error happens when changing to g++. I have tested on some simple simple c++ code, the command works fine. So it the problem in that PNG class file? However, the same files worked on my MacOS before, but suddenly failed today.
Undefined symbols for architecture x86_64:
"PNG::writeToFile(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&)", referenced from:
_main in main-f6a06a.o
"PNG::PNG(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&)", referenced from:
_main in main-f6a06a.o
"PNG::PNG(unsigned long, unsigned long)", referenced from:
_main in main-f6a06a.o
"PNG::~PNG()", referenced from:
_main in main-f6a06a.o
"PNG::operator()(unsigned long, unsigned long)", referenced from:
_main in main-f6a06a.o
"PNG::width() const", referenced from:
_main in main-f6a06a.o
"PNG::height() const", referenced from:
_main in main-f6a06a.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Did you miss providing static/shared to the linker to resolve the linker errors for the methods mentioned? Also note that clang++ is a different compiler compared to g++ and hence need the static/shared libraries compiled prior by the same compiler you are using (clang++).
Try:
clang++ main.cpp -o out -lpng
Here's why: You are not providing the library that contains the implementation of your PNG library (libpng most likely). You need -lpng added to your compiler, so that it links with the relevant library. It may not be exactly -lpng in your particular case, but it's definitely a "missing library". Without knowing exactly what library you are trying to use (you didn't provide some source to "try the fix with").
As pointed out in the comment: you are using some kind of C++ wrapper on top, the above is probably not enough - but without knowing exactly which C++ wrapper on the png functionality you are actually using, it's hard to say what the command-line should look like.
Perhaps this
I've tried with/without -m64 option, it is not working. How should I fix this?
Undefined symbols for architecture x86_64:
"boost::system::system_category()", referenced from:
boost::asio::error::get_system_category() in main-6996c8.o
boost::system::error_code::error_code() in main-6996c8.o
___cxx_global_var_init.2 in main-6996c8.o
"boost::system::generic_category()", referenced from:
___cxx_global_var_init in main-6996c8.o
___cxx_global_var_init.1 in main-6996c8.o
ld: symbol(s) not found for architecture x86_64
First, are you using Xcode or using command line?
Second, the problem probably is that the include dir and lib dir are not set up correctly.
Third, you can go to /usr/local/include to check if you have boost headers and go to /usr/local/lib to check if you have boost libs.
I got a problem when I rebuild cocos2d v2.1.5 with architecture x64 in xcode 6.3. please help me fix this.
Undefined symbols for architecture arm64:
"_WebPGetFeaturesInternal", referenced from:
WebPGetFeatures(unsigned char const*, unsigned long, WebPBitstreamFeatures*) in CCImageCommonWebp.o
"_WebPInitDecoderConfigInternal", referenced from:
WebPInitDecoderConfig(WebPDecoderConfig*) in CCImageCommonWebp.o
"_WebPDecode", referenced from:
cocos2d::CCImage::_initWithWebpData(void*, int) in CCImageCommonWebp.o
"_NEON_Matrix4Mul", referenced from:
_kmMat4Multiply in mat4.o
"_AES_decrypt", referenced from:
DataEncrypt::parseXMLData(unsigned long, char const*) in UserDataEncrypt.o
"_AES_set_encrypt_key", referenced from:
DataEncrypt::save() in UserDataEncrypt.o
"_AES_encrypt", referenced from:
DataEncrypt::save() in UserDataEncrypt.o
"_AES_set_decrypt_key", referenced from:
DataEncrypt::parseXMLData(unsigned long, char const*) in UserDataEncrypt.o
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
You have to update cocos2d to version 2.2.6. It's minimum version which supports x64 architecture. However it's not stable, so you'd better update to 3.6 if you have enough time.
Link to tutorial
We've started migration and it looks like it will take 80+ hours because of big changes in API.
I'm trying to get up to speed using libcurl with D on Mac.
I'm using the latest dmd2 compiler (DMD64 D Compiler v2.062).
The following example compiles and works fine on Windows:
import std.net.curl, std.conv, std.stdio;
void main() {
string content = to!string(get("dlang.org"));
writeln(content);
}
When compiling it on Mac I get the following output:
~/src $ dmd dcurl.d
Undefined symbols for architecture x86_64:
"_curl_easy_cleanup", referenced from:
_D3std3net4curl4Curl8shutdownMFZv in libphobos2.a(curl_1522_37c.o)
"_curl_easy_duphandle", referenced from:
_D3std3net4curl4Curl3dupMFZS3std3net4curl4Curl in libphobos2.a(curl_151e_149.o)
"_curl_easy_init", referenced from:
_D3std3net4curl4Curl10initializeMFZv in libphobos2.a(curl_151d_432.o)
"_curl_easy_perform", referenced from:
_D3std3net4curl4Curl7performMFbZi in libphobos2.a(curl_1528_2fb.o)
"_curl_easy_setopt", referenced from:
_D3std3net4curl4Curl3setMFE3etc1c4curl10CurlOptionlZv in libphobos2.a(curl_1525_14c.o)
_D3std3net4curl4Curl3setMFE3etc1c4curl10CurlOptionAxaZv in libphobos2.a(curl_1524_14c.o)
_D3std3net4curl4Curl3setMFE3etc1c4curl10CurlOptionPvZv in libphobos2.a(curl_1526_14c.o)
_D3std3net4curl4Curl5clearMFE3etc1c4curl10CurlOptionZv in libphobos2.a(curl_1527_207.o)
"_curl_easy_strerror", referenced from:
_D3std3net4curl4Curl11errorStringMFiZAya in libphobos2.a(curl_1520_4a1.o)
"_curl_global_cleanup", referenced from:
_D3std3net4curl4Curl19_sharedStaticDtor29FZv in libphobos2.a(curl.o)
"_curl_global_init", referenced from:
_D3std3net4curl4Curl19_sharedStaticCtor28FZv in libphobos2.a(curl.o)
"_curl_slist_append", referenced from:
_D3std3net4curl3FTP3dupMFZS3std3net4curl3FTP in libphobos2.a(curl_1518_ea.o)
_D3std3net4curl3FTP10addCommandMFAxaZv in libphobos2.a(curl_1518_ea.o)
_D3std3net4curl4HTTP3dupMFZS3std3net4curl4HTTP in libphobos2.a(curl_1517_140.o)
_D3std3net4curl4HTTP16addRequestHeaderMFAxaAxaZv in libphobos2.a(curl_1517_140.o)
"_curl_slist_free_all", referenced from:
_D3std3net4curl3FTP4Impl6__dtorMFZv in libphobos2.a(curl_1518_ea.o)
_D3std3net4curl3FTP13clearCommandsMFZv in libphobos2.a(curl_1518_ea.o)
_D3std3net4curl4HTTP4Impl6__dtorMFZv in libphobos2.a(curl_1517_140.o)
_D3std3net4curl4HTTP19clearRequestHeadersMFZv in libphobos2.a(curl_1517_140.o)
ld: symbol(s) not found for architecture x86_64
collect2: ld returned 1 exit status
--- errorlevel 1
Which seems to imply a linking issue.
I have libcurl at:
/usr/lib/libcurl.3.dylib /usr/lib/libcurl.4.dylib /usr/lib/libcurl.dylib
But I'm not even sure whether dmd is trying to use them.
I've done this before with C/C++ (on the same machine using these libraries) so I think it must be a versioning issue or else I need to pass some flags to the compiler.
Any help would be most appreciated.
You need to link against libcurl. It's not linked against by default. So, instead of
dmd dcurl.d
you need to do
dmd -L-lcurl dcurl.d