CocoaAsyncSocket Apple Mach-O Linker Error - tcp

I need to receive TCP packets using CocoaAsyncSocket. When I'm importing that library to Xcode and trying to run my application, it gives me Apple Mach-O Linker Errors:
Undefined symbols for architecture i386:
"_kCFStreamErrorDomainMach", referenced from:
-[AsyncSocket errorFromCFStreamError:] in AsyncSocket.o
"_kCFStreamErrorDomainNetDB", referenced from:
-[AsyncSocket errorFromCFStreamError:] in AsyncSocket.o
"_kCFStreamErrorDomainNetServices", referenced from:
-[AsyncSocket errorFromCFStreamError:] in AsyncSocket.o
"_kCFStreamErrorDomainSystemConfiguration", referenced from:
-[AsyncSocket errorFromCFStreamError:] in AsyncSocket.o
"_kCFStreamPropertySSLSettings", referenced from:
-[AsyncSocket maybeStartTLS] in AsyncSocket.o
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
So, What Can I do???

You just need to add SecurityFramework in the Frameworks.
I also met this similar problem.

Related

Issue while installing pod

Added Firebase pod for Cloud Messaging(Push notification)
pod 'Firebase/Core'
pod 'Firebase/Messaging'
Undefined symbols for architecture x86_64:
"__T09Alamofire11URLEncodingVAA17ParameterEncodingAAWP", referenced from:
__T09App0A3ApiO4task4Moya4TaskOfg in App.o
"__T09Alamofire12JSONEncodingVN", referenced from:
__T09App0A3ApiO4task4Moya4TaskOfg in App.o
"__T09Alamofire11URLEncodingVN", referenced from:
__T09App0A3ApiO4task4Moya4TaskOfg in App.o
"__T09Alamofire12JSONEncodingVAA17ParameterEncodingAAWP", referenced from:
__T09App0A3ApiO4task4Moya4TaskOfg in App.o
"__T09Alamofire11URLEncodingV7defaultACfgZ", referenced from:
__T09App0A3ApiO4task4Moya4TaskOfg in App.o
"__T09Alamofire12JSONEncodingV7defaultACfgZ", referenced from:
__T09App0A3ApiO4task4Moya4TaskOfg in App.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
I am also using Moya. But issue while adding Firebase pods.
From the logs it looks like you miss also the AlamoFire (which can be a dependency of your pods). Try do a pod deintegrate and then a pod install again and don't forget to open the Workspace and not the project.

Error while packaging application - Flex ANE

We are integrating Push notification with AppBoy SDK in our Flex project.
We are created ANE but while packaging application got error like this
Error occurred while packaging the application:
Undefined symbols for architecture armv7:
"_OBJC_CLASS_$_CTTelephonyNetworkInfo", referenced from:
objc-class-ref in libcom.fingent.appboyapn.a(ABKDevice.o)
"_CTFontManagerRegisterGraphicsFont", referenced from:
-[ABKInAppMessageViewController applyIconToLabelView:] in libcom.fingent.appboyapn.a(ABKInAppMessageViewController.o)
"_SLServiceTypeFacebook", referenced from:
+[ABKFacebookDataProvider facebookAccountExistsInIOS] in libcom.fingent.appboyapn.a(ABKFacebookDataProvider.o)
___85+[ABKFacebookDataProvider fetchAndPostFacebookDataAccessPromptWithSuccessCompletion:]_block_invoke in libcom.fingent.appboyapn.a(ABKFacebookDataProvider.o)
"_ACFacebookPermissionsKey", referenced from:
+[ABKFacebookDataProvider fetchAndPostFacebookDataAccessPromptWithSuccessCompletion:] in libcom.fingent.appboyapn.a(ABKFacebookDataProvider.o)
"_ACFacebookAppIdKey", referenced from:
+[ABKFacebookDataProvider fetchAndPostFacebookDataAccessPromptWithSuccessCompletion:] in libcom.fingent.appboyapn.a(ABKFacebookDataProvider.o)
"_ACAccountTypeIdentifierFacebook", referenced from:
+[ABKFacebookDataProvider fetchAndPostFacebookDataAccessPromptWithSuccessCompletion:] in libcom.fingent.appboyapn.a(ABKFacebookDataProvider.o)
"_OBJC_CLASS_$_SLRequest", referenced from:
objc-class-ref in libcom.fingent.appboyapn.a(ABKFacebookDataProvider.o)
"_OBJC_CLASS_$_ACAccountStore", referenced from:
objc-class-ref in libcom.fingent.appboyapn.a(ABKFacebookDataProvider.o)
"_OBJC_CLASS_$_SLComposeViewController", referenced from:
objc-class-ref in libcom.fingent.appboyapn.a(ABKFacebookDataProvider.o)
ld: symbol(s) not found for architecture armv7
Compilation failed while executing : ld64
Have your ANE been recompiled to 64bit from old 32bit xcode compile? If not you need to do this to compile w Apache Flex SDK above 16 (check doc for exact version...) Someplace on this site is a nifty ANT compiler that I used once: http://easynativeextensions.com/making-your-ios-apps-universal/ Good luck.

How to build Quazip 0.5.1 on Windows 7?

I'm trying to build the quazip libary (version 0.5.1) on Windows 7 (32-bit) with Qt 5.0.1 32-Bit LGPL installed.
When i run in the Qt-Commandprompt:
qmake
mingw32-make
with the directory set to the folder in which I extracted Quazip (C:\Qt\quazip-0.5.1\quazip), I get the following error-log:
C:\Qt\quazip-0.5.1\quazip>mingw32-make
mingw32-make -f Makefile.Release
mingw32-make[1]: Entering directory 'C:/Qt/quazip-0.5.1/quazip'
g++ -Wl,-s -shared -mthreads -Wl,--out-implib,release\libquazip.a -o release\qua
zip.dll object_script.quazip.Release -LC:\Qt\Qt5\5.0.1\mingw47_32\lib -lQt5Core
./release\unzip.o:unzip.c:(.text+0x1008): undefined reference to `crc32'
./release\unzip.o:unzip.c:(.text+0x10aa): undefined reference to `inflate'
./release\unzip.o:unzip.c:(.text+0x10da): undefined reference to `crc32'
./release\unzip.o:unzip.c:(.text+0x1110): undefined reference to `crc32'
./release\unzip.o:unzip.c:(.text+0x1327): undefined reference to `inflateEnd'
./release\unzip.o:unzip.c:(.text+0x1727): undefined reference to `get_crc_table'
./release\unzip.o:unzip.c:(.text+0x186f): undefined reference to `inflateInit2_'
./release\zip.o:zip.c:(.text+0xac7): undefined reference to `crc32'
./release\zip.o:zip.c:(.text+0xb7c): undefined reference to `deflate'
./release\zip.o:zip.c:(.text+0xcdf): undefined reference to `deflate'
./release\zip.o:zip.c:(.text+0xef5): undefined reference to `deflateEnd'
./release\zip.o:zip.c:(.text+0x13a8): undefined reference to `get_crc_table'
./release\zip.o:zip.c:(.text+0x1af9): undefined reference to `deflateInit2_'
./release\quaadler32.o:quaadler32.cpp:(.text+0x2e): undefined reference to `adle
r32'
./release\quaadler32.o:quaadler32.cpp:(.text+0x61): undefined reference to `adle
r32'
./release\quaadler32.o:quaadler32.cpp:(.text+0xa1): undefined reference to `adle
r32'
./release\quaadler32.o:quaadler32.cpp:(.text+0xb1): undefined reference to `adle
r32'
c:/qt/qt5/tools/mingw/bin/../lib/gcc/i686-w64-mingw32/4.7.2/../../../../i686-w64
-mingw32/bin/ld.exe: ./release\quaadler32.o: bad reloc address 0x0 in section `.
rdata$_ZTI13QuaChecksum32[__ZTI13QuaChecksum32]'
collect2.exe: error: ld returned 1 exit status
Makefile.Release:106: recipe for target 'release\quazip.dll' failed
mingw32-make[1]: *** [release\quazip.dll] Error 1
mingw32-make[1]: Leaving directory 'C:/Qt/quazip-0.5.1/quazip'
makefile:34: recipe for target 'release' failed
mingw32-make: *** [release] Error 2
But in my Zlib-Folder (C:\Qt\Qt5\5.0.1\Src\qtbase\src\3rdparty\zlib) are all this listed files installed.
.
As I tried to solve the problem, I have added into the quazip.pro and into the quazip.pri:
INCLUDEPATH += $$[QT_INSTALL_PREFIX]/src/3rdparty/zlib
, how it is suggested here.
All other solutiuons I have found on Google so far aren't helping.
I hope someone of you can help me.
Greetings,
LVreg
The problem is that QuaZIP can not find the zlib library. You should include the path of the headers an also the libraries when you run qmake:
qmake "INCLUDEPATH+=C:/Qt/Qt5/5.0.1/Src/qtbase/src/3rdparty/zlib" "LIBS+=-LC:/Qt/Qt5/5.0.1/Src/qtbase/src/3rdparty/zlib -lz"
mingw32-make
There is a full explanation in my blog if you want to check it out: http://www.antonioborondo.com/2014/10/22/zipping-and-unzipping-files-with-qt/
Here is what worked for me (QuaZip 0.7 on Windows 7 compiled with MSVC13 32 bits):
In the command line type:
SET INCLUDE=<PathToZib\include>;%INCLUDE%
SET LIB=<PathToZib\lib>;%LIB%
qmake PREFIX=<FolderWhereInstallWillPutFiles> LIBS+=<PathToZib\lib>/zdll.lib
nmake
nmake install
everything between <> must be changed to your applicable path
NOTE:
in the LIBS+= part use / instead of \ as folders delimiter
try to make the lib of quazip on windows - look here:
https://www.maefloresta.com/wiki/doku.php?id=quazip_windows
but - try the following command - instead of "make" take "mingw32-make".

xcode static library link error while building for iPhone device

I am using xcode 4.6. The SDK is iOS 6.1. The error I got is "Undefined symbols for architecture armv7" while project linking my own created static library, called "libEncrypt.a".
I am sure I have created the libEncrpt.a using architecture armv7. Using "otool -a" to verify the static library, it displays below message. Don't understand why xcode sill complains the error like "Undefined symbols for architecture armv7"??
> otool -a libEncrypt.a
Archive : libEncrypt.a (architecture armv7)
0100644 505/20 108 1360127518 #1/20
0100644 505/20 3604 1360127513 #1/20
Archive : libEncrypt.a (architecture armv7s)
0100644 505/20 108 1360127518 #1/20
0100644 505/20 3604 1360127513 #1/20
Add the detail error message blow:
Undefined symbols for architecture armv7:
"_OBJC_CLASS_$_libEncrypt", referenced from:
objc-class-ref in LoginViewController.o
objc-class-ref in SignupViewController.o
ld: symbol(s) not found for architecture armv7
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Double check your "Build Active Architecture Only" settings in your app and static library projects.
I had this exact same issue because I had "Build Active Architecture Only" set to YES for my static library but not for my iOS app. When the iOS app tried do a Debug build it expected all architectures to exist but only armv7s was being built for the static library because I was deploying to my iPhone 5.

CppUTest examples build fails

I am new to mac!
I download the xcode4.2 and tried to build CppUTest-v3
1)when I do make, I have the following logs
compiling AllTests.cpp
compiling AllocationInCppFile.cpp
compiling CheatSheetTest.cpp
compiling CommandLineArgumentsTest.cpp
compiling CommandLineTestRunnerTest.cpp
compiling JUnitOutputTest.cpp
compiling MemoryLeakDetectorTest.cpp
compiling MemoryLeakOperatorOverloadsTest.cpp
compiling MemoryLeakWarningTest.cpp
compiling NullTestTest.cpp
compiling PluginTest.cpp
compiling PreprocessorTest.cpp
compiling SetPluginTest.cpp
compiling SimpleStringTest.cpp
compiling TestFailureTest.cpp
compiling TestFilterTest.cpp
compiling TestHarness_cTest.cpp
compiling TestInstallerTest.cpp
compiling TestMemoryAllocatorTest.cpp
compiling TestOutputTest.cpp
compiling TestRegistryTest.cpp
compiling TestResultTest.cpp
compiling UtestTest.cpp
compiling AllocationInCFile.c
compiling TestHarness_cTestCFile.c
compiling CommandLineArguments.cpp
compiling CommandLineTestRunner.cpp
compiling JUnitTestOutput.cpp
compiling MemoryLeakDetector.cpp
compiling MemoryLeakWarningPlugin.cpp
compiling SimpleString.cpp
compiling TestFailure.cpp
compiling TestFilter.cpp
compiling TestHarness_c.cpp
compiling TestMemoryAllocator.cpp
compiling TestOutput.cpp
compiling TestPlugin.cpp
compiling TestRegistry.cpp
compiling TestResult.cpp
compiling Utest.cpp
compiling UtestPlatform.cpp
Building archive lib/libCppUTest.a
ar: creating archive lib/libCppUTest.a
a - objs/src/CppUTest/CommandLineArguments.o
a - objs/src/CppUTest/CommandLineTestRunner.o
a - objs/src/CppUTest/JUnitTestOutput.o
a - objs/src/CppUTest/MemoryLeakDetector.o
a - objs/src/CppUTest/MemoryLeakWarningPlugin.o
a - objs/src/CppUTest/SimpleString.o
a - objs/src/CppUTest/TestFailure.o
a - objs/src/CppUTest/TestFilter.o
a - objs/src/CppUTest/TestHarness_c.o
a - objs/src/CppUTest/TestMemoryAllocator.o
a - objs/src/CppUTest/TestOutput.o
a - objs/src/CppUTest/TestPlugin.o
a - objs/src/CppUTest/TestRegistry.o
a - objs/src/CppUTest/TestResult.o
a - objs/src/CppUTest/Utest.o
a - objs/src/Platforms/Gcc/UtestPlatform.o
Linking CppUTest_tests
ld: library not found for -lgcov
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [CppUTest_tests] Error 1
I found out that I can build by using the llvm make command
CC=/Applications/Xcode.app/Contents/Developer/usr/bin/llvm-gcc-4.2 make
Linking CppUTest_tests
Running CppUTest_tests
..................................................
..................................................
..................................................
..................................................
..................................................
...........................................
OK (293 tests, 293 ran, 791 checks, 0 ignored, 0 filtered out, 7 ms)
2)Then I cd to the examples directory. I got the following errors. I tried to investigate but could not find out how to solve it. Your help will be appreciated.
compiling AllTests.cpp
compiling CircularBuffer.cpp
compiling CircularBufferTest.cpp
compiling EventDispatcher.cpp
compiling EventDispatcherTest.cpp
compiling HelloTest.cpp
compiling MockDocumentationTest.cpp
ApplicationLib/MockDocumentationTest.cpp:193:85: warning: expression result unused [-Wunused-value]
mock_c()->actualCall("foo")->withIntParameters("integer", 10)->returnValue().value.doubleValue;
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^~~~~~~~~~~
1 warning generated.
compiling Printer.cpp
compiling PrinterTest.cpp
compiling hello.c
Building archive lib/libCppUTestExamples.a
ar: creating archive lib/libCppUTestExamples.a
a - objs/ApplicationLib/CircularBuffer.o
a - objs/ApplicationLib/CircularBufferTest.o
a - objs/ApplicationLib/EventDispatcher.o
a - objs/ApplicationLib/EventDispatcherTest.o
a - objs/ApplicationLib/HelloTest.o
a - objs/ApplicationLib/MockDocumentationTest.o
a - objs/ApplicationLib/Printer.o
a - objs/ApplicationLib/PrinterTest.o
a - objs/ApplicationLib/hello.o
Linking CppUTestExamples_tests
Undefined symbols for architecture x86_64:
"_main", referenced from:
start in crt1.10.6.o
"mock(SimpleString const&)", referenced from:
TEST_EventDispatcher_EventWithRegistrationForEventResultsIntoCallback_Test::testBody() in libCppUTestExamples.a(EventDispatcherTest.o)
TEST_EventDispatcher_RegisterTwoObserversResultIntoTwoCallsAndARegistrationNotification_Test::testBody() in libCppUTestExamples.a(EventDispatcherTest.o)
TEST_GROUP_CppUTestGroupEventDispatcher::setup() in libCppUTestExamples.a(EventDispatcherTest.o)
TEST_GROUP_CppUTestGroupEventDispatcher::teardown() in libCppUTestExamples.a(EventDispatcherTest.o)
ObserverMock::notify(Event const&, int)in libCppUTestExamples.a(EventDispatcherTest.o)
ObserverMock::notifyRegistration(EventObserver*) in libCppUTestExamples.a(EventDispatcherTest.o)
productionCode() in libCppUTestExamples.a(MockDocumentationTest.o)
...
"MockNamedValue::getIntValue() const", referenced from:
TEST_MockDocumentation_returnValue_Test::testBody() in libCppUTestExamples.a(MockDocumentationTest.o)
TEST_MockDocumentation_setData_Test::testBody() in libCppUTestExamples.a(MockDocumentationTest.o)
"MockNamedValue::~MockNamedValue()", referenced from:
TEST_MockDocumentation_returnValue_Test::testBody() in libCppUTestExamples.a(MockDocumentationTest.o)
TEST_MockDocumentation_setData_Test::testBody() in libCppUTestExamples.a(MockDocumentationTest.o)
"MockSupport::setData(SimpleString const&, int)", referenced from:
TEST_MockDocumentation_setData_Test::testBody() in libCppUTestExamples.a(MockDocumentationTest.o)
"MockSupport::setDataObject(SimpleString const&, SimpleString const&, void*)", referenced from:
TEST_MockDocumentation_setData_Test::testBody() in libCppUTestExamples.a(MockDocumentationTest.o)
"MockSupport::getData(SimpleString const&)", referenced from:
TEST_MockDocumentation_setData_Test::testBody() in libCppUTestExamples.a(MockDocumentationTest.o)
"MockNamedValue::getObjectPointer() const", referenced from:
TEST_MockDocumentation_setData_Test::testBody() in libCppUTestExamples.a(MockDocumentationTest.o)
"_mock_c", referenced from:
TEST_MockDocumentation_CInterface_Test::testBody() in libCppUTestExamples.a(MockDocumentationTest.o)
"_mock_scope_c", referenced from:
TEST_MockDocumentation_CInterface_Test::testBody() in libCppUTestExamples.a(MockDocumentationTest.o)
ld: symbol(s) not found for architecture x86_64
collect2: ld returned 1 exit status
make: *** [CppUTestExamples_tests] Error 1
I was able to find the location of CppUTest's missing libgcov.a on my Mac running Lion.
/usr/llvm-gcc-4.2/lib/gcc/i686-apple-darwin11/4.2.1/libgcov.a
/usr/llvm-gcc-4.2/lib/gcc/i686-apple-darwin11/4.2.1/x86_64/libgcov.a
Apparently these locations aren't in the loaders default search path, so after linking the 64 bit variant to /usr/local/lib I was able to make CppUTest without a hiccup.
sudo ln -s /usr/llvm-gcc-4.2/lib/gcc/i686-apple-darwin11/4.2.1/x86_64/libgcov.a /usr/local/lib/libgcov.a
Best of luck

Resources