Linker error. Xcode 3.1.3 + iPhone

Hi i'm pretty new to XCode, I am extending an example project and have had no problems until now.
A small but annoying block to my progress has turned up in trying to create and use a c++ class in my project.
I have created a .cpp and .h through the NewFile menu, the .cpp has automatically been added to the "Classes", "Compile Sources" and "Implementation Files" folders.
I have renamed the view class (that will be using the c++ classes) file to .mm (obj-c++) and included the new header file.
Everything seems to be fine, there are no compiler errors but the linker cant find any symbols for code in the .cpp file, if I inline the functions in the header file all is well but if I move them to the .cpp file then the linker baulks.
The new c++ file's object has been created and is in the same folder as the other local objects.
I have tried multiple cleans and rebuilds.
I have another other example project which use cpp files and it compiles and links fine.
Are there project settings I need to change to allow linking to *.cpp files?
Thanks, hjd_uk.

Hi hjd. Welcome to the dev forum!
I would start by ruling out some of the simple errors you might have overlooked because of the unfamiliar environment.. like functions that aren't public, etc. Since you can call your inline functions from obj-C, what happens if you make an inline wrapper for one of the functions the linker can't find? That should tell you something right away. Depending on how that test goes, you might also try making another C++ class (.h + .cpp) and see if that class can call functions in the first C++ class.
I"m guessing you'll see what's going on by ignoring Xcode and just looking at the source files. If not, try to strip the project down to a minimal test bed and post the source here (in that case be sure to read the code formatting announcement, and use the Preview tab to see how your code looks).
\- Ray

Similar Messages

  • IPhone SDK - Linking error with CLLocationManager

    Hello.
    I have a linking error when I try to use thr CLLocationManager in my iPhone application by using the example of source code given in the Developer Center.
    I have the following error : ".objcclass_nameCLLocationManager", referenced from literal-pointer@_OBJC@__clsrefs@CLLocationManager in localisation.o
    symbol(s) not found.
    Do you have an idea ?
    Thank you for your answer.
    Patrick Schevenels.

    Just for clarification, there's a flood of developers now purchasing Macs to code for the iPhone platform. For those of you new to Xcode, you add a framework by doing the following:
    1. Open your iPhone project in XCode
    2. In the project window, ctrl+click (or right-click if you have 2-button mouse) on 'Frameworks' folder > Add > Existing Frameworks
    3. Navigate to /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS2.0.sdk/System/Li brary/Frameworks/CoreLocation.framework
    4. Click 'Add' button
    5. Compile
    Also, for anyone coming for the ActionScript Java or C# world, I've been blogging on transitioning to iPhone OS development platform.
    http://www.digitalassassin.com/?p=15
    Message was edited by: P120D1GY

  • HT1212 How do i restore my iphone when it has been disabled and can not be restored through itunes because of the error message that says "The iphone software update server could not be contacted.

    How do i restore my iphone when it has been disabled and cannot be restored through itunes because of the error message that says "The iphone software update server could not be contacted

    Have you jailbroken this device? This will make the iPhone not talk to the Software Update Server (that signs and accepts software updates) please refer to the following link? Error 3194, Error 17, or "This device isn't eligible for the requested build"
    The iPhone will talk to the software update servers, just need to change the host files, it's a simple process, sorry if you were confused about the wording in to top?

  • /System/Library/Extensions/USBAtTable.kext installation error (Xcode)

    While installing Xcode 3.2 and iPhone SDK 3.1 for Mac OS X 10.6 Snow Leopard, the following error message is shown "/System/Library/Extensions/USBAtTable.kext installation error". Could anyone help.
    Regards,
    MKS

    Try the developer forums under OS X Technologies. Alternatively, download and install Xcode Tools 3.2.1, followed by the latest iPhone SDK.

  • Build Collada DOM 2.2 in X-Code and got _unZOpen, Close a link errors

    I am trying to build Collada DOM 2.2 in XCode and getting following link error.
    Collada DOM is providing minizip (library) which contains zip.h and unzip.h, which is called after calling mac libraries; Is any way I can specify in XCode project build specifications to read minizip from Collada first?
    Building target “viewer” of project “viewer” with configuration “Debug” — (8 errors)
    "_unzGoToNextFile", referenced from:
    daeZAEUncompressHandler::extractArchive(void*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)in libdom.a(daeZAEUncompressHandler.o)
    "_unzGetCurrentFileInfo", referenced from:
    daeZAEUncompressHandler::extractFile(void*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)in libdom.a(daeZAEUncompressHandler.o)
    "_unzCloseCurrentFile", referenced from:
    daeZAEUncompressHandler::extractFile(void*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)in libdom.a(daeZAEUncompressHandler.o)
    "_unzOpenCurrentFile", referenced from:
    daeZAEUncompressHandler::extractFile(void*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)in libdom.a(daeZAEUncompressHandler.o)
    "_unzReadCurrentFile", referenced from:
    daeZAEUncompressHandler::extractFile(void*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)in libdom.a(daeZAEUncompressHandler.o)
    "_unzGetGlobalInfo", referenced from:
    daeZAEUncompressHandler::extractArchive(void*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)in libdom.a(daeZAEUncompressHandler.o)
    "_unzClose", referenced from:
    daeZAEUncompressHandler::~daeZAEUncompressHandler()in libdom.a(daeZAEUncompressHandler.o)
    "_unzOpen", referenced from:
    daeZAEUncompressHandler::daeZAEUncompressHandler(daeURI const&)in libdom.a(daeZAEUncompressHandler.o)
    Your help greatly appreciated.
    Thanks

    Please look into following link
    https://sourceforge.net/forum/forum.php?threadid=2643729&forumid=531263

  • CS6:Server Link Error:"file not found: @executable_path/ObjectModelLib.dylib" ?

    Hi all,
    I'm trying to update my old code in CS5.5 for building new CS6( Server build), i get the link error "file not found: @executable_path/ObjectModelLib.dylib  " not sure what I missing in my project settings/items? Any thoughts or help would greatly appreciated.
    Thanks,
    Kamran
    P.S I use Mac OS X 10.6.8 and Xcode 3.2.6. for Model & UI build for the same project it builds fine.

    Never mind guys, I can compile it fine now :-)
    -Kamran

  • [CS4] IDFactory link error - affects release only

    update: forgot to mention this only happens whily building release. debug version builds and loads.
    Hello,
    I ported a plugin from CS3 and CS4 and getting following link error (one for each DECLARE_PMID) while linking ID file. SDK samples compile and link just fine.
    Undefined symbols:
      "IDFactory::IDFactory(long const&, char*, long const&)", referenced from:
          __static_initialization_and_destruction_0(int, int)in ITMID.o
    Environment
    Mac 10.6.3 64-bit
    XCode 3.2.1 w GCC 4.0
    Linked against 10.4 SDK
    I am sure I am missing something obvious. Would save me lot of time if you could point it out or send me in right direction.
    Thanks
    Kapil

    BTW I have tried selecting all of the shapes before enabling
    bone tool...saw that as a possible solution on another forum,
    however no luck

  • Linker error while packaging iOS app with my ANE

    While trying to write a iOS Native Extension for ZXingObjC (https://github.com/TheLevelUp/ZXingObjC), the following link error shows up when exporting in Flash Builder 4.x:
    Error occurred while packaging the application:
    Undefined symbols for architecture armv7:
      "___divmodsi4", referenced from:
          +[ZXEncoder numDataBytesAndNumECBytesForBlockID:numDataBytes:numRSBlocks:blockID:numDataBytesInBlock: numECBytesInBlock:error:] in libcom.google.zxing.ZXingNativeExtension.a(ZXEncoder.o)
          +[ZXAztecEncoder encode:len:minECCPercent:] in libcom.google.zxing.ZXingNativeExtension.a(ZXAztecEncoder.o)
          +[ZXAztecEncoder generateCheckWords:totalSymbolBits:wordSize:] in libcom.google.zxing.ZXingNativeExtension.a(ZXAztecEncoder.o)
    ld: symbol(s) not found for architecture armv7
    Compilation failed while executing : ld64
    This happens in Flash Builder 4.6 or 4.7 using AIR SDK 3.7
    This isn't my first Native Extension for iOS. No amount of fiddling around with adding frameworks or libraries in Xcode to the static library works.
    Looking for guidance on what to try next to resolve this linker error...

    I am also receiving an error related to ___divmodsi4 (using different libraries which use that symbol) which appears to be a compiler level math function. It should be packaged automatically but apparently AIR isn't doing it.  No idea what additional library should be linked, attempts to link the 3rd party libraries (and/or packagedDepenency them) failed.
    Undefined symbols for architecture armv7:
      "___divmodsi4", referenced from: (methods in a third party library)
    My Platform.xml is as such:
    <platform xmlns="http://ns.adobe.com/air/extension/3.7">
        <sdkVersion>6.0</sdkVersion>
        <linkerOptions>
        <option>-ObjC</option>   
        <option>-weak_framework Accounts</option>
        <option>-framework AddressBook</option>
        <option>-framework AddressBookUI</option>
        <option>-weak_framework AdSupport</option>
        <option>-framework CoreAudio</option>
        <option>-framework CoreLocation</option>
        <option>-framework CoreMotion</option>
        <option>-framework CoreTelephony</option>
        <option>-framework EventKit</option>
        <option>-framework EventKitUI</option>
        <option>-framework iAd</option>
        <option>-framework MapKit</option>
        <option>-framework MediaPlayer</option>
        <option>-framework MessageUI</option>
        <option>-framework OpenAL</option>
        <option>-weak_framework PassKit</option>
        <option>-framework StoreKit</option>
        <option>-weak_framework Twitter</option>
        <option>-framework UIKit</option>
        <option>-lsqlite3</option>
        <option>-lxml2</option>
        <option>-lz</option>
        </linkerOptions>
    </platform>
    If the author or anyone manages a solution, please post it in this thread!

  • Mac CS4 Linker Error with IAIColorSpace.cpp

    Hi Folks,
    I'm trying to use AIColorSpace in my Mac AICS4 Plug-In using Xcode 3.1.1 on Leopard 10.5.7, but I'm getting a linker errors (see below).
    Has anyone here included "IAIColorSpace.cpp" in their project and successfully compile an AICS4 plug-in using Xcode 3.1.1 on Leopard?
    When I include IAIColorSpace.cpp in my project, I get a linker error of:
    _sAIColorSpace, referenced from
    _sAIColorSpace$non_lazy_ptr in IAIColorSpace.o
    symbol(s) not found
    collect2: Id returned 1 exit status
    There are many Google hits of "non_lazy_ptr" errors with Xcode, but nothing has helped me solve this issue. Any help would be most appreciated!
    Thanks!
    -- Jim

    The usual culprit is that sAIColorSpace needs to be defined in all the right places. Typically its EXTERN'd in both a header & a cpp, as well as included in a list of suites to load (along with the version of the suite to load). Have you added it to all three places? Usually you just find the spots where all the other suties are and cut & paste it into their number. Where that would be depends on whether you're using your own plugin setup or if you're working off one of the Adobe skeleton samples plugins.

  • Applescript is starting Xcode instead of the iPhone Simulator

    Hi,
    When I use applescript to start the iPhone Simulator (using the following command), it's starting Xcode instead of the iPhone Simulator.
    osascript -e "tell application \"iPhone Simulator\" to activate"
    The command osascript -e 'id of app "iPhone Simulator"' return the value "com.apple.dt.Xcode".
    So the program name "iPhone Simulator" has a reference to the wrong application. Is there a file on the system that links the name of the program to actual App?
    Thanks in advance,
    Robbert

    If you want to use applescript to launch the iOS simulator this script should work, but your Xcode project needs to be open first.
    tell application "Xcode"
         tell project "test"
              activate
         end tell
    end tell
    tell application "System Events"
         tell process "Xcode"
              click menu item "Run Without Building" of menu 1 of menu item "Perform Action" of menu "Product" of menu bar item "Product" of menu bar 1
                    end tell
    end tell

  • IDCS3 Mac: Strange Link error

    I am compiling a CS3 plugin and getting a link error I cannot track down. It looks like this:
    Linking /source code/.../CRF(1 error)
    can't locate file for: -lPublicPlugin
    file: - lPublicPlugin is not an object file (not allowed in a library)
    I have done several searches on variations of lPublicPlugin, including IPublicPlugin, and PublicPlugin,and the only thing that comes close is a reference to the libpublicplugin.a library that is included by DollyXs when I generate the project.
    Can anyone suggest a method for tracking down this problem?
    TIA!
    John

    I have found my problem and all InDesign developers who are using Xcode needs to know what it was.
    This project was originally created by DollyXs, which included all appropriate library search paths for a successful link. However, I needed to add the mysqlclient.a library as well, so I did so by dragging and dropping. The result was that Xcode erased the library search path that pointed to the InDesign static library "libPublicPlugIn.a," replacing it with the path that pointed to the dropped library.
    So, if you need to add additional libraries to the project, take care that you somehow preserve the library search paths that already exist in that field, if you intend to drag and drop the library onto the project.
    I do not know if this error will be prevented if the programmer uses the Add Files dialog to add the library.
    Because of the importance of this information, I am also placing this message in its own thread on the forum.
    R,
    John

  • Linker Error during compiling ODBC WinCE C++_Sample Project

    I am devloping a ODBC application for PocketPC2003 using OLite 10g Release 10.3.0.2. before that i am understanding the sample application provided with Olite.
    I followed all the instructions provided in ReadMe.txt file available before using VC++ sample. After making all the settings and compiling i am getting following linker errors as mentioned below.
    Any solution for this problem at the earliest will be appreciated, i have tried link all the libraries provided with WinCE armv4.
    Linker Error Messages:
    Error     1     error LNK2019: unresolved external symbol SQLExecDirect referenced in function "public: virtual __cdecl CSQLResult::~CSQLResult(void)" (??1CSQLResult@@UAA@XZ)     dbaccess.obj     
    Error     2     error LNK2019: unresolved external symbol SQLFreeStmt referenced in function "public: virtual __cdecl CSQLResult::~CSQLResult(void)" (??1CSQLResult@@UAA@XZ)     dbaccess.obj     
    Error     3     error LNK2019: unresolved external symbol SQLGetData referenced in function "public: class CRowObj const * __cdecl CSQLResult::Fetch(int)" (?Fetch@CSQLResult@@QAAPBVCRowObj@@H@Z)     dbaccess.obj     
    Error     4     error LNK2019: unresolved external symbol SQLFetch referenced in function "public: class CRowObj const * __cdecl CSQLResult::Fetch(int)" (?Fetch@CSQLResult@@QAAPBVCRowObj@@H@Z)     dbaccess.obj     
    Error     5     error LNK2019: unresolved external symbol SQLFreeEnv referenced in function "public: void __cdecl COLiteDB::Disconnect(void)" (?Disconnect@COLiteDB@@QAAXXZ)     dbaccess.obj     
    Error     6     error LNK2019: unresolved external symbol SQLFreeConnect referenced in function "public: void __cdecl COLiteDB::Disconnect(void)" (?Disconnect@COLiteDB@@QAAXXZ)     dbaccess.obj     
    Error     7     error LNK2019: unresolved external symbol SQLDisconnect referenced in function "public: void __cdecl COLiteDB::Disconnect(void)" (?Disconnect@COLiteDB@@QAAXXZ)     dbaccess.obj     
    Error     8     error LNK2019: unresolved external symbol SQLConnect referenced in function "public: int __cdecl COLiteDB::Connect(void)" (?Connect@COLiteDB@@QAAHXZ)     dbaccess.obj     
    Error     9     error LNK2019: unresolved external symbol SQLAllocConnect referenced in function "public: int __cdecl COLiteDB::Connect(void)" (?Connect@COLiteDB@@QAAHXZ)     dbaccess.obj     
    Error     10     error LNK2019: unresolved external symbol SQLAllocEnv referenced in function "public: int __cdecl COLiteDB::Connect(void)" (?Connect@COLiteDB@@QAAHXZ)     dbaccess.obj     
    Error     11     error LNK2019: unresolved external symbol SQLError referenced in function "public: class CSQLResult * __cdecl COLiteDB::Execute(wchar_t const *)" (?Execute@COLiteDB@@QAAPAVCSQLResult@@PB_W@Z)     dbaccess.obj     
    Error     12     error LNK2019: unresolved external symbol SQLDescribeCol referenced in function "public: class CSQLResult * __cdecl COLiteDB::Execute(wchar_t const *)" (?Execute@COLiteDB@@QAAPAVCSQLResult@@PB_W@Z)     dbaccess.obj     
    Error     13     error LNK2019: unresolved external symbol SQLNumResultCols referenced in function "public: class CSQLResult * __cdecl COLiteDB::Execute(wchar_t const *)" (?Execute@COLiteDB@@QAAPAVCSQLResult@@PB_W@Z)     dbaccess.obj     
    Error     14     error LNK2019: unresolved external symbol SQLAllocStmt referenced in function "public: class CSQLResult * __cdecl COLiteDB::Execute(wchar_t const *)" (?Execute@COLiteDB@@QAAPAVCSQLResult@@PB_W@Z)     dbaccess.obj

    Hi,
    The OLITE forum (Database Mobile Server (inc. legacy Database Lite) would be a better place to post your issue. This forum deals with the ODBC driver that connects to a "normal" Oracle database.
    Hope it helps,
    Greg
    Edited by: gdarling on Nov 12, 2008 8:31 AM

  • The broken link error

    Hi,
    Please help me with this broken link error in Office Excel 2010. Thank you.
    The problem is: a broken link cannot be removed from the file. The link was used in data validation, which refers to a list of values. After the path was corrected, it still shows there’s a broken link. Here are the details:
    I have 4 files named “000TVA_Test – 3”, “000TVA_Test – 4”, “000TVA_Test – 5”, and “000TVA_Test – 6”. The posterior files were developed based on the previous files.
    In Test-3, sheet “Template “, cell “L4”, “O4”, “R4”… were built as dropdown list using data validation. The list source is in the “Library” worksheet. There’s no problem so far.
    Test-4 was firstly copied from Test-3. In this file I renamed the worksheet from “Library” to “Setting” and the link was broken from here. I can also fix the broken link in this file. (While I didn’t realize there was a broken link.)
    In Test-5 I fixed the path, but every time when opening the file, the broken link still shows.
    In Test-6 I’ve removed the data validations. The broken link is still there.
    I tried to find solutions online. I tried common methods, cannot find anything in the files is still using links. I also tried the “findlink.xla” add-in, but it only worked for Test-4, and couldn’t find the link in other files.
    Please help. Thank you!
    I uploaded files here: https://onedrive.live.com/redir?resid=1A97736E0ABBAA41!113&authkey=!AF5wAd9rwUPnYyE&ithint=folder%2cxlsm
    Thanks again!

    Hi,
    Based on my tested the files downloaded, I found that Test-5 & Test-6 included the "A defined name that refers to an external workbook", Test-4 had not. (Please click Formula Tab>Name Manage, you'll see them.)
    However, the Break Links command cannot break the following types of links:   
    A defined name that refers to an external workbook
    A ListBox control with an input range that refers to an external workbook.
    A DropDown control with an input range that refers to an external workbook.
    http://support2.microsoft.com/kb/291984/en-us (It also applies to Excel 2010)
    Thus, we'd better try the workaround: re-build the Test-5 & Test 6.
    Regards,
    George Zhao
    TechNet Community Support
    It's recommended to download and install
    Configuration Analyzer Tool (OffCAT), which is developed by Microsoft Support teams. Once the tool is installed, you can run it at any time to scan for hundreds of known issues in Office
    programs.

  • I tried to install the new iOs 7 on my iphone 4, but it wasn't completed (showing error 4005). Now, my iphone is stuck on the itunes' logo with the usb cord, and I can't use my phone. And itunes doesn't detect my iphone when I connect it on my computer.

    Hi everyone! I tried to install the new iOs 7 on my iphone 4, but it wasn't completed (showing error 4005). Now, my iphone is stuck on the itunes' logo with the usb cord, and I can't use my phone. And itunes doesn't detect my iphone when I connect it on my computer, so I can't put it in recovery mode or someting like that... What can I do?? I tried everything they tell me to do in the apple support but nothing seems to work. Thank you!

    No problem, glad to help!
    Update: my PC USB hub was connected to a USB 3 port, I connected the 30 pin cable directly to my PC, And the restore worked just fine. Restored phone from iCloud backup and seems to be working fine.

  • How can I change the email address linked to my iCloud account on iPhone 4S running iOS 7?

    How can I change the email address linked to my iCloud account for iPhone 4s?

    Welcome to the Apple Community.
    If it's your non-iCloud mail address, start here, change your country if necessary and go to manage your account
    If it is your iCloud mail address you want to change, you can't.

  • I am getting error (-1) while updating my iPhone 4 to iOS 5.1. The phone has gone into a recovery mode. Restore fails every time at "restoring the firmware" stage. Striped bar remains for a long time, then shows "error (-1)" and the restore fails. Help!

    I am getting error (-1) while updating my iPhone 4 to iOS 5.1. The phone has gone into a recovery mode. Restore fails every time at "restoring the firmware" stage. Striped bar remains for a long time, then shows "error (-1)" and the restore fails. I have been doing it for last 12 hours. Help!

    Thanks for your reply Michalo. I am in India and here Apple care does not work on Sundays. I have been without my phone for the entire day. Perhaps tomorrow will bring some respite. There is not solution to "error (-1)" on any forum it seems. I found one forum which suggested use of Tiny Umbrella. Any idea about that?

Maybe you are looking for