Undefined symbols for architecture x86_64 for mac - objective-c

I used podofo library for mac application development, while building demo app i am getting following errors.

The error messages seem to indicate that you are working with static libraries (.a libraires). So, when building your demo app, you need to link with all the librairies needed, including the ones needed by freetype and fontconfig. These are bz2, z, crypto (from the openssl distribution) and others...
If Podofo is built with cmake, you can look at the CMakeCache.txt file. It contains the path where each library Podofo depends on was found on your system.
The bz2 library is not listed in the CMakeCache.txt. It is there by default, so you may just add
-lbz2
to the "Other Linker Flags" in your Xcode project build settings.

Related

Errors building PCL 1.8 with VTK-7.0.0

Trying to build PCL 1.8 using VTK 7.0.0. Target is Visual Studio 2015.
Using the VTK OpenGL2 backend I got errors similar to those reported here and here which indicate OpenGL2 is not supported for PCL yet.
However, using the original VTK OpenGL backend I get different errors:
The list of VTK libraries PCL projects link against includes libraries whose names suggest both OpenGL and OpenGL2, even though VTK is only configured with one or the other backend. For example, "vtkDomainsChemistryOpenGL2.lib" (when VTK backend is OpenGL).
"vtkDomainsChemistryOpenGL2.lib" does not exist, causing a linker error. However, a library called "vtkDomainsChemistryOpenGL2-7.0.lib" exists, so it appears a version suffix is added when VTK is built, but is not added when CMake generates the list of libraries to link PCL projects with.
vtkVertexBufferObject.cxx(104): error C2039: 'GetExtensionManager': is not a member of 'vtkOpenGLRenderWindow'. Class vtkOpenGLRenderWindow is suspiciously tagged with VTKRENDERINGOPENGL2_EXPORT (again in an OpenGL build).
I don't know whether the problem lies in VTK or PCL. The CMake build system is completely opaque to me so I am getting nowhere with this.
Just following up to myself (again)...
The problem was that, because I had initially built the "INSTALL" project of VTK using the OpenGL2 backend, then changed the backend to OpenGL and built the "INSTALL" project of VTK again, both backends existed in the install folder. VTKConfig.cmake (which PCL uses to link with VTK) finds and links against all modules that it finds in the install folder, thus attempting to link against both incompatible backends.
The VTK build system does not detect that conflicting modules are already present when installing, and the "make clean" or "rebuild" options don't remove conflicting modules (VTK does not have an uninstaller). Deleting CMake caches, or creating a new clean build directory, is not sufficient to clear up this mess.
So the only solution was to manually find and delete the VTK install folder ("C:\Program Files (x86)\VTK", for the record) if you need to change the VTK backend.

ld: file not found: /usr/lib/libextension.dylib

ld: file not found: /usr/lib/libextension.dylib
Can some one help me to find this file. I can`t work without it. Its is used to make a .ipa when deploying marmalade project.
This file is relative to the application path from where your iOS SDK is installed. For instance, the full path might look like this:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.3.sdk/usr/lib/libextension.dylib
If it cannot be found, a new installation of the iPhoneOS SDK could have relocated it. Some of the newer Xcode updates will remove older iPhoneOS SDKs as well which might still be referenced.
Try searching for lib extension.dylib from /Applications/Xcode.app/Contents/Developer/Platforms/iPhonseOS.platform/Developer/SDKs/

Linker error for imported header file Xcode 4.5

I have downloaded a header file and static library file (.a file) from the internet. They are provided by the wireless printer which i bought for my iphone and trying to make print functionality working in my app. The problem is when I run the sample app provided by them to test printer, I get the following linker error...Obviously the app was designed in the previous versions of Xcode and Im using Xcode 4.5. Much appreciated if someone could Guide me..
If you are building an iOS project and it's using the i386 architecture, then you must be building for the simulator. What happens when you build for an actual iOS device?
It's possible that the library was compiled only for the processor architectures for real iOS devices, typically armv6, armv7, or armv7s. You can use the file command in Terminal to see what architectures are in the .a library file.
Check these answers Symbols not found for architecture i386? and symbols not found.
Check your project-> build phases -> Link Binary With Libraries whether there is libwspr240.a file is there or not.
Remove libwspr240.a file and then readd it using
Project --> Build Phases --> Link Binary with Libraries click '+' button to add.
Then Clean and Build the project

FreeImage library not found

Installed FreeImage through MacPorts. Everything looked to be OK, but when I builded my app and tried to launch on other computer where is no MacPorts and no FreeImage installed it says
dyld: Library not loaded: /opt/local/lib/libfreeimage.3.dylib
Referenced from: /Users/development/Library/Developer/Xcode/DerivedData/freeimage-dxsornyaxqlkyubqwsrlkgszvxhy/Build/Products/Debug/freeimage.app/Contents/MacOS/freeimage
Reason: image not found
Shouldn't it copy library files together with my project? I added them to my project's build phases "Copy files" list. They are being copied to my app's bundle. But when I try to link them, I get same error. I don't know why but app is still looking for library in /opt/local/lib. How can I fix it so that I could use FreeImage at my project and run it at any computer?
When you install through MacPorts the library is installed in /opt/local/lib, not in your project path. Even if you copy the whole project, the *dylib libraries won't be copied because they are usually in /opt/local/lib.
I believe you have two options here: install FreeImage in every computer that you want to run your application, or copy the libfreeimage.3.dylib to the same folder where your binnary is and, if both systems are similar, that should work. If the two computers are different in terms of operating system version, hardware architecture, etc... then probably the .dylib that you have won't be compatible for the other computer.
Another thing you might want to consider is to modify your DYLD_LIBRARY_PATH variable, which specifies the paths in which the OS will look for libraries when linking. See this answer for more information.

Static library not working in objective c. How to make it?

ld: warning: ignoring file
/Users/srm-mac10/Downloads/ICodeBlogStaticLibrarySample/MathTest/Classes/iCodeBlogsMathLibrary/libICodeMathUtils.a,
missing required architecture i386 in file Undefined symbols for
architecture i386: "_OBJC_CLASS_$_MathFunctions", referenced from:
objc-class-ref in MathTestAppDelegate.o ld: symbol(s) not found for architecture i386 clang: error: linker command failed with exit
code 1 (use -v to see invocation)
Following error coming while i am trying to make a static library in objective C. Any idea ??
Please help me.
The iOS simulator runs natively on the system's CPU, which is an x86 architecture. Hence your code needs to be built for x86 (which is presumably working already) and any libraries you link to also need to be built for x86.
If this is a static library that someone else has supplied to you (perhaps you purchased it?) then you will need to request the x86 version as well and link against that.
If you are building the static library yourself, check the build settings for that project (I'm assuming it's a separate project) and make sure it's configured to be compilable for the simulator. Then explicitly build the library for the simulator.
(I've run into some weird issues with static libraries where Xcode 4.x fails to automatically build the correct library architecture, necessitating an explicit manual build.)
I think you have to set the flag "-all_load" in the "other linker flags" in your project build settings