Undefined symbols: "_NewSpeechChannel", referenced from...

Hello.
I'm an absolute beginner in developing for OSX and C programming in general.
I'm following the instructions step-by-step to writing a very simple program that makes use of the OSX Speech Synthesizer.
However the program won't compile and instead it lanuches this error:
>  Undefined symbols:
>    "_NewSpeechChannel", referenced from:
> >    _main in ccRRVBTR.o
>  ld: symbol(s) not found
>  collect2: ld returned 1 exit status
I'm aware that the problem arises from the lack of proper linking to the actual implementation of the NewSpeechChannel function.
However it is a system function and I guess it should be linked by default. In any case, what should I do next to make it compile properly?
The simple program is this (so far):
#include<stdio.h>
#include<ApplicationServices/ApplicationServices.h>
int main(int argc, char **argv, char **envp, char **apple) {
SpeechChannel speechchannel;
NewSpeechChannel( NULL, &speechchannel );
The reference of the Speech Synthesis Manager (the C API for speech synthesis) sits here:
https://developer.apple.com/library/mac/#documentation/Carbon/Reference/Speech_S ynthesis_Manager/Reference/reference.html
None of the functions listed in the reference compile, along with NewSpeechChannel.
I know it is a very basic question by any help is welcome, as I'm stuck at the very beginning of my project.
Thanks!
PS: I tried it on both OS X 10.6.8 and 10.7.5

Add the Application  Services framework to your project.

Similar Messages

  • Compile error: undefined symbols

    hello,
    i'm trying to install a software (Omnet, it's a network simulator) but while compiling it I get the following mesage. What do you think it depends on?
    Undefined symbols:
    "_xmlNewParserCtxt", referenced from:
    SAXParser::parse(char const*)in saxparser_libxml.o
    "_xmlDocGetRootElement", referenced from:
    SAXParser::parse(char const*)in saxparser_libxml.o
    "_xmlStructuredError", referenced from:
    SAXParser::parse(char const*)in saxparser_libxml.o
    "_xmlFreeParserCtxt", referenced from:
    SAXParser::parse(char const*)in saxparser_libxml.o
    SAXParser::parse(char const*)in saxparser_libxml.o
    SAXParser::parse(char const*)in saxparser_libxml.o
    "_xmlCtxtReadFile", referenced from:
    SAXParser::parse(char const*)in saxparser_libxml.o
    "_xmlFreeDoc", referenced from:
    SAXParser::parse(char const*)in saxparser_libxml.o
    SAXParser::parse(char const*)in saxparser_libxml.o
    ld: symbol(s) not found
    collect2: ld returned 1 exit status
    make[1]: * [libnedxml.so] Error 1
    make: * [nedxml] Error 2

    You should post such questions in Developer forum.
    Also, you will probably get better help from the OMNeT people themselves. They have a bug tracker and mailing list. The tool itself is based on Eclipse and is a 109 MB download. Doesn't look too enticing.

  • "_main", referenced from:

    im trying to migrate my project from windows to mac , when i use xcode to compile my code , i get the following error
    Undefined symbols:
    "_main", referenced from:
    start in crt1.10.5.o
    ld: symbol(s) not found
    collect2: ld returned 1 exit status
    please help

    The short answer to your question is that the entry point to a Windows app is named 'WinMain', while the entry point to an OS X app is named 'main'. The linker message you reported just means that no main function was found, which is to be expected.
    Of course you can't simply change the name of WinMain to main, since everything from the parameters to the API calls are going to be entirely different. If your Windows app is built on one of the libraries intended for an OS X port, a lot of the problems may be solved for you. Otherwise I think it's safe to say that the changes to WinMain are going to be the very least of your challenges.
    Have you decided on whether to port to Carbon or Cocao? The choice might depend on whether your Windows program is written in "C" with direct calls to the Win32 API or written in C++ using MFC. I wish I could be of more help, but I've never moved a Windows program to OS X without a complete re-write.
    All the very best of luck!!

  • Ild: (Performing full relink) internal free space in undefined symbol error

    I am using Sun Sparc C++ 5.4 compiler to compile some code.
    I had some issues with Makefile which I have resolved successfully for test program, which has only one string and print statetments.
    When I compile my program error_log.C program using Makefile, I am geting following errors.
    Same file for test program works ok.
    Any suggestions/pointers etc are much appreciated.
    Thanks
    Ravi
    ERRORS:
    ==================================================================================
    /opt/SUNWspro/bin/CC -g -compat=4 -V - YP,/ford/thishost/u/rbhave/mqrouter/lib:/usr/lib:/opt/SUNWspro/prod/lib -I/ford/thishost/u/rbhave/mqrouter/include -c error_log.c
    CC: Forte Developer 7 C++ 5.4 2002/03/09
    ccfe: Forte Developer 7 C++ 5.4 2002/03/09
    /opt/SUNWspro/bin/CC -g -compat=4 -V -YP,/ford/thishost/u/rbhave/mqrouter/lib:/usr/lib:/opt/SUNWspro/prod/lib -I/ford/thishost/u/rbhave/mqrouter/include error_log.o -o error_log -lXm -lXt -lX11 -lstring -lipc -lutils
    CC: Forte Developer 7 C++ 5.4 2002/03/09
    CClink: Forte Developer 7 C++ 5.4 2002/03/09
    CC: Forte Developer 7 C++ 5.4 2002/03/09
    ild: (Performing full relink) internal free space in output file exhausted (sections)
    /opt/SUNWspro/bin/../prod/bin/c++filt: Forte Developer 7 C++ 5.4 2002/03/09
    ild: Forte Developer 7 Incremental Linker 4.0 2002/03/09
    ild: Forte Developer 7 Incremental Linker 4.0 2002/03/09
    ild: (undefined symbol) ErrLog_c::ErrLog_c(void) -- referenced in the text segment of error_log.o
    ild: (undefined symbol) ErrLog_c::SetFileOutput(char*) -- referenced in the text segment of error_log.o
    ild: (undefined symbol) operator <<(ostream&, const String&) -- referenced in the text segment of /ford/thishost/u/rbhave/mqrouter/lib/libutils.a(ini_file.o)
    ild: (undefined symbol) operator <<(ostream&, const String&) -- referenced in the text segment of /ford/thishost/u/rbhave/mqrouter/lib/libutils.a(datetime.o)
    ild: (undefined symbol) IsSocketUsed(const char*, const char*) -- referenced in the text segment of /ford/thishost/u/rbhave/mqrouter/lib/libipc.a(socket_recv.o)
    ild: (undefined symbol) IsSocketUsed(const char*, const char*) -- referenced in the text segment of error_log.o
    ild: (undefined symbol) operator >>(istream&, String&) -- referenced in the text segment of /ford/thishost/u/rbhave/mqrouter/lib/libutils.a(general.o)
    ild: (undefined symbol) setsockopt -- referenced in the text segment of /ford/thishost/u/rbhave/mqrouter/lib/libipc.a(socket_recv.o)
    ild: (undefined symbol) recv -- referenced in the text segment of /ford/thishost/u/rbhave/mqrouter/lib/libipc.a(socket_recv.o)
    ild: (undefined symbol) bind -- referenced in the text segment of /ford/thishost/u/rbhave/mqrouter/lib/libipc.a(socket_recv.o)
    ild: (undefined symbol) socket -- referenced in the text segment of /ford/thishost/u/rbhave/mqrouter/lib/libipc.a(socket_dgram.o)
    ild: (undefined symbol) ErrLog_c::Rename(const ErrLogMesg_t&) -- referenced in the text segment of error_log.o
    ild: (undefined symbol) sendto -- referenced in the text segment of /ford/thishost/u/rbhave/mqrouter/lib/libipc.a(socket_dgram.o)
    ild: (undefined symbol) ErrLog_c::~ErrLog_c(void) -- referenced in the text segment of error_log.o
    *** Error code 5
    make: Fatal error: Command failed for target `error_log'
    ==================================================================================

    Try rebuilding with -xild=off to eliminate ild from the process.
    If it still doesn't link, delete the most recent .o files and try again to see how it goes.
    - Rose

  • Occidml undefined symbol problem

    Using 9i rel 2 and Solaris 6.1 I get the following error when building:
    $ make -f demo_rdbms.mk occidml
    Undefined symbol first referenced in file
    std::basic_string<char,std::char_traits<char>,dtd::allocator<char>>std::basic_string<char,std::char_traits<char>,std::allocator<char>>::__sun_concat(const std::basic_string<char,std::char_traits<char>,std::allocator<char>>&)const /cots/oracle/product/9.2.0.1/lib//liocci.so
    std::basic_string<char,std::char_traits<char>,dtd::allocator<char>>std::basic_string<char,std::char_traits<char>,std::allocator<char>>::__sun_concat(const char*)const /cots/oracle/product/9.2.0.1/lib//liocci.so
    Thanks for any help you can give me.

    Not a Solaris person, but it looks like it is missing the C++ STL header files/libraries.

  • Undefined symbols:   "___gxx_personality_v0$non_lazy_ptr",referenced from:

    Hi,
    I am getting following error while building . I tried searching on web as well for this error,but could not find a solution, suited for my problem. Searching on the web, I found two solutions :
    1.      Either use the compiler g++.
    2.      Add library stdc++ on the command, so that libstdc++ can be linked with.
    Actually both results are almost same, since g++ itself adds libstdc++ to the command before linking.
    I tried this solution, but it didn’t solve the problem. Thedifference between my problem and problem described on web is that in my case,undefined symbol is ___gxx_personality_v0$non_lazy_ptr,while all other problems described on web, describes missing___gxx_personality_v0. I tried searching for ___gxx_personality_v0$non_lazy_ptr in the libstdc++ and other libs as well using “nm”, but could not find this symbol.
    If anybody has any clue about tthis problem, please let me know.
    /usr/bin/cc  -prebind -o PROD "other .o's" "other libs"   -lgcc_eh
    Undefined symbols:
      "___gxx_personality_v0$non_lazy_ptr",referenced from:
    Error Icould found on web :
    Undefinedsymbols:
    "___gxx_personality_v0", referencedfrom:      è problems other encountered was that undefined symbol was__gxx_personality_v0.
    ___gxx_personality_v0$non_lazy_ptrin cciIlcV9.o  è In my case (see in my message), this is the undefined symbol. "std::basic_ostream<char,std::char_traits<char> >& std::endl<char,std::char_traits<char> >(std::basic_ostream<char,std::char_traits<char> >&)", referenced from:
    __ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_$non_lazy_ptrin cciIlcV9.o
    "std::ios_base::Init::~Init()",referenced from:
    Thanks& Regards,

    You're very welcome

  • Undefined symbol referenced in -n command line argument

    I am migrating from CC 4.2 to CC 6.0 and cannot determine what is causing the following error during/after linking:
    ild: (undefined symbol) void __Cimpl::cplus_init() -- referenced in -u command line argumentAll of the .o files are produced without error and a binary is produced, but without execute permissions. I read the C++ Migration Guide and have checked to be sure that all of my compile commands include -library=iostream and -compat=4.
    What can I check next?

    There is no C++ 6.0. Run the command
    CC -V
    to find out your compiler version.
    The -library=iostream option is for use only in the default standard mode. To build a compatibility-mode program, use the option
    -compat=4
    on every CC command line, compiling and linking. Do not use -library=iostream.
    I reccomend the following sequence for migrating from C++ 4.2 to a recent Sun C++ compiler:
    1. Build the entire program using -compat=4. Using the Migration Guide as a reference, fix the code to eliminate all warnings.
    2. Remove the -compat=4 option, and add the option
    -library=iostream,no%Cstd
    to every CC command line, compiling and linking. Fix all errors and fix the code to eliminate all warnings.
    3. Check the Migration Guide for language definition changes, such as the behavior of new-expressions and the scope of variables defined in the header of a for-statement. You can use -features=xxx options to restore the old compiler behavior, but I recommend fixing the code instead.
    4. Try building without the -library=iostream,no%Cstd option. Your code will then use standard iostreams instead of "classic" iostreams. Simple uses of iostreams will work either way. Some uses of iostreams need to be modified to work with standard iostreams. If your code doesn't work as-is, schedule a time to convert to standard iostreams. Using classic iostreams can interfere with the use of the rest of the C++ standard library.

  • _z_inflateInit_ referenced from symbol missing (zlib linking error)

    I am trying to compile a project that uses inflateInit, deflateInit, inflate, deflate, inflateEnd, deflateEnd, which are all from zlib.h... i know i am getting a linking error and it cannot find the implementation of these files. i have included libz.1.1.3.dylib within my project, i have tried including libz.dylib, i have also tried to put the
    OTHER_CFLAGS = -lz
    none of this has seemed to work. any help would be much appreciated ! ! !
    this is the definition for inflateInit and it calls zinflateInit which is also in zlib.h
    {#define inflateInit(strm) \
    inflateInit_((strm), ZLIB_VERSION, (int)sizeof(z_stream))
    ZEXTERN int ZEXPORT inflateInit_ OF((z_streamp strm,
    const char *version, int stream_size));
    when i build my project, the errors i get are :
    z_inflateInit, referenced from:
    foo()
    zinflate , referenced from:
    foo()
    symbols(s) not found collect2: Id returned 1 exit status

    http://discussions.apple.com/thread.jspa?threadID=1445315&tstart=0 ?

  • Undefined symbol error when calling stat from extproc

    Hi, I'm trying to call an external procedure written in C that calls stat, and am getting the following error. Note that we have other extprocs running, and we are on Oracle 8.1.7 on redhat 6.2...
    SQL Error: ORA-06520: PL/SQL: Error loading external library
    ORA-06522: /tmp/extproc.so: undefined symbol: stat
    OS/compiler
    Linux enchilada 2.2.14-5.0 #1 Tue Mar 7 21:07:39 EST 2000 i686 unknown
    gcc version egcs-2.91.66 19990314/Linux (egcs-1.1.2 release)
    Oracle version: 8.1.7
    added following lines to file plsql/demo/extproc.c:
    (at top of file)
    #include <unistd.h>
    #include <sys/types.h>
    #include <sys/stat.h>
    #include <fcntl.h>
    (inside UpdateSalary function)
    struct stat mystat;
    stat("/tmp/foo", &mystat);
    reported error:
    SQL Error: ORA-06520: PL/SQL: Error loading external library
    ORA-06522: /tmp/extproc.so: undefined symbol: stat
    NOTE: when I remove call to stat, procudure runs properly.
    null

    I've talked to support, and this is supposedly a problem with Oracle not recognizing the library path. It is supposed to be fixed in 8.1.7.1.

  • Missing prototype and Undefined Symbol errors

    So, I am using an Opal Keyy XEM3005 board.
    Depending on the documentation I read, this board has a native ANSI C interface with a C++ wrapper.
    In their forums, they say to rename the ".cpp" file to "c", and then go forward with calling the default constructor & keep track of the pointer.  Their functions are all in an externally loadable DLL.
    Well and good.
    Their API documentatin is available here:  http://www.opalkelly.com/library/FrontPanelAPI/
    I have written a REALLY simple app to ease my way in - it does nothing more than allow the user to throw a switch, and when this happens, it goes off to connect to the board:
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    #include <cvirte.h>
    #include <userint.h>
    #include "Try1.h"
    #include "XEM.h"
    #define _WIN32_WINNT 0x0501
    //#define _WIN32
    #include <windows.h>
    static int panelHandle;
    static okFrontPanel_HANDLE    XEM_Device;
    int __stdcall WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance,
    LPSTR lpszCmdLine, int nCmdShow)
    if (InitCVIRTE (hInstance, 0, 0) == 0)
    return -1;    /* out of memory */
    if ((panelHandle = LoadPanel (0, "Try1.uir", PANEL)) < 0)
            return -1;
        DisplayPanel (panelHandle);
        RunUserInterface ();
        DiscardPanel (panelHandle);
        return 0;
    int CVICALLBACK Connect (int panel, int control, int event,
            void *callbackData, int eventData1, int eventData2)
        int    Value = 0;
        switch (event)
            case EVENT_COMMIT:
                GetCtrlVal(PANEL, PANEL_CONNECT_SWITCH, &Value);
                SetCtrlVal(PANEL, PANEL_CONNECT_LED, Value);
                if( Value )
                    XEM_Connect(XEM_Device);
                else
                    XEM_Disconnect(XEM_Device);
                break;
        return 0;
    int CVICALLBACK Quit (int panel, int control, int event,
            void *callbackData, int eventData1, int eventData2)
        switch (event)
            case EVENT_COMMIT:
                QuitUserInterface (0);
                break;
        return 0;
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    This, of course, works fine by itself (with empty _Connect() and _Disconnect() functions)
    I then started working with the XEM_Connect function.
    The first step is to run their LoadDLL function as such:
    int XEM_Connect ( okFrontPanel_HANDLE    XEM_Device )
        int    NoDevices = 0;    //    Number of devices attached to the PC
        //    Load the DLL (?)
        // Load the FrontPanel DLL
        if (FALSE == okFrontPanelDLL_LoadLib(NULL))
            printf("Could not load FrontPanel DLL\n");
            exit(-1);
        return XEM_SUCCESS;
    And this would compile and run just fine.
    Now, when I added the functions to start trying to get info about the device, I started getting "missing prototype" errors.
    int XEM_Connect ( okFrontPanel_HANDLE    XEM_Device )
        int    NoDevices = 0;    //    Number of devices attached to the PC
        //    Load the DLL (?)
        // Load the FrontPanel DLL
        if (FALSE == okFrontPanelDLL_LoadLib(NULL))
            printf("Could not load FrontPanel DLL\n");
            exit(-1);
        //    Find out how many devices are attached
        XEM_Device = okFrontPanel_Construct(  );
    //    XEM_Device = okCFrontPanel( void );
    //    NoDevices = GetDeviceCount( );
        printf("%d OK devices attached\n", NoDevices);
        //    Call the contructor?    
    //    okCFrontPanel ();
        return XEM_SUCCESS;
    Now, I searched the forums and found the bits about adding #define _WIN32_WINNT 0x0501 prior to inclusion of windows.h.  Did that.  No joy.
    Then I searched some more and found the bit about changing the build options to uncheck the "prototype required" flag.
    Done.
    This seemed to work at first (the above code could be built with no errors, and appeared to run).
    So I thought maybe I had it, and added the next line, so:
    int XEM_Connect ( okFrontPanel_HANDLE    XEM_Device )
        int    NoDevices = 0;    //    Number of devices attached to the PC
        //    Load the DLL (?)
        // Load the FrontPanel DLL
        if (FALSE == okFrontPanelDLL_LoadLib(NULL))
            printf("Could not load FrontPanel DLL\n");
            exit(-1);
        //    Find out how many devices are attached
        XEM_Device = okFrontPanel_Construct(  );
        OpenBySerial( XEM_Device, "UaLgzvVpBJ" );
    //    XEM_Device = okCFrontPanel( void );
    //    NoDevices = GetDeviceCount( );
        printf("%d OK devices attached\n", NoDevices);
        //    Call the contructor?    
    //    okCFrontPanel ();
        return XEM_SUCCESS;
    Now it doesn't complain about no prototypes (duh), but instead I get linker errors:
        Undefined symbol '_OpenBySerial@0' referenced in "XEM.c".
    So, dredging through the .h and .c files, I found a couple of things:
    in the okFrontPanel.c file I found the following:
    okDLLEXPORT ok_ErrorCode DLL_ENTRY
    okFrontPanel_OpenBySerial(okFrontPanel_HANDLE hnd, const char *serial)
        if (_okFrontPanel_OpenBySerial)
    ;  return((*_okFrontPanel_OpenBySerial)(hnd, serial));
        return(ok_UnsupportedFeature);
    In the okFrontPanel.h file I found:
    and also:
    okDLLEXPORT ok_ErrorCode DLL_ENTRY okFrontPanel_OpenBySerial(okFrontPanel_HANDLE hnd, const char *serial);
    So, I see them in the .h & .c files, but the linker is bombing out.
    I smell a problem with actual code to link being in the DLL...  How do I resolve this, any ideas?  Or am I doing something so stupidly (and obviously) wrong that I'm being blinded to it?

    Hi tomii,
    My suspicion is that these issues are due to using a C++ dll in a C environment. There are inherent challenges with performing such an operation as you have to make sure all your parameters and settings are correct.
    I also could not find the documentation that the Opal Kelly dll is ANSI C but it sounds like you can use this in C with some reconfiguration. I would recommend using their forums to get more information on what steps need to take place to get things working in ANSI C.
    From the information you provided, I did find some resources on the missing prototype error and undefined symbol issue with the linker.
    For the missing prototype I found a thread of someone actually using LabWindows and seeing this compiler error you may want to look at
    http://bytes.com/topic/c/answers/695019-missing-prototype
    I found a few cases where using a function definition of int func(void) removes such issue when int func() does not.
    Another link I found that may be worth a look can be found at http://www.parashift.com/c++-faq-lite/mixing-c-and-cpp.html
    It gives some good pointers to mixing C and C++ code. Some of it may be applicible in your case.
    And, a resource for your undefined symbol linking issue.
    http://www.cprogramming.com/tutorial/compiler_linker_errors.html
    Hopefully these resources will give some context for getting things compiling and working with your dll.
    Good luck!
    James W.
    Applications Engineer
    National Instruments

  • SunStudio 11 cannot link libtiff in Solaris 10 (undefined symbol)

    Hello
    we are producing a software using multiple external libraries, among them Sam Leffler's TIFF library version 3.6.1
    This software compiles and runs well on Solaris 9 / SunStudio 11
    But in Solaris 10 / SunStudio we get an 'undefined symbol' error even if the symbol exists!!
    I have patched the OS and SunStudio to the latest level required but it's no help
    the linker error message is:
    CC -compat=4 -I../AGR -I../STA -I../SVI -I../KRN -I../COMMON_APAS -I../CXML -I../SCS -I. -I../INCLUDE -I../AFC -I../ITI -I../IEM -I../MMF -I../MMI -I../ICS -I../EIV -I../TSF -I../TTM -I../TIM -I../MIR -I../INA -I../INX -I../DEC -I../MAR -I../IXA -I../MXR -I../ICO -I../JPEG -I../LTIFF -I../OVS -I../UTIL -I../TRE -I../IRE -I../INR -I../IST -I../IXR -I/opt/SUNWspro/prod/include/CC -I/usr/include -g0 -libmil -xtarget=native -mt -xildoff -keeptmp -verbose=%all -L/usr/lib -L/usr/local/lib -LFPCSolaris10 -L../lib/FPCSolaris10 -L/opt/SUNWspro/prod/lib/rw7/CC4 -L/opt/SUNWspro/lib -L/usr/X11R6/lib -o FPCSolaris10/MainItls_ils FPCSolaris10/MainItls_ils.o FPCSolaris10/MAIN_Module_ils.o -lICS -lEIV -lMIR -lINA -lDEC -lMAR -lICO -lMXR -lIXA -lOVS -lUtil -ltiff -lSVIils -lSTAils -lKRN -lSCS -lITIils -lIEMils -lAGR -lMMF -lAFC -lMMI -lCXML -lcommon_apas -Bstatic -lrwtool -Bdynamic -lnsl -lposix4 -lsocket -lxnet -ldl -lgen -lcurses -lXm -lXt -lX11 -lxml2
    ld: Software Generation Utilities - Solaris Link Editors: 5.10-1.489
    ld: warning: symbol `clog' has differing types:
    (file /opt/SUNWspro/lib/CC4/libC.so type=OBJT; file /usr/lib/libm.so type=FUNC);
    /opt/SUNWspro/lib/CC4/libC.so definition taken
    Undefined first referenced
    symbol in file
    TIFFOpenMem ../lib/FPCSolaris10/libIXA.a(IXA_ImageManager.o)
    ld: fatal: Symbol referencing errors. No output written to FPCSolaris10/MainItls_ils
    gmake[1]: *** [FPCSolaris10/MainItls_ils] Error 1
    But if I analyse the libraries used the missing symbol is actually there:
    nm -g ../lib/FPCSolaris10/libtiff.a
    ../lib/FPCSolaris10/libtiff.a[tif_msrc.o]:
    [Index] Value Size Type Bind Other Shndx Name
    [26] | 0| 0|FUNC |GLOB |0 |UNDEF |TIFFClientOpen
    [22] | 0| 0|FUNC |GLOB |0 |UNDEF |TIFFError
    [24] | 416| 161|FUNC |GLOB |0 |2 |TIFFOpenMem
    [23] | 0| 0|FUNC |GLOB |0 |UNDEF |free
    [25] | 0| 0|FUNC |GLOB |0 |UNDEF |malloc
    [21] | 0| 0|FUNC |GLOB |0 |UNDEF |memcpy
    Does anybody have an idea of what's wrong ?
    Thank you for your help!

    The libraries are probably being linked in the wrong order.
    Libraries are processed in the order seen on the link command. When the linker sees an archive library (.a), it pulls in any .o files from it that can satisfy existing undefined references. Suppose libA needs f1 from library libtiff, but -lA appears on the command line after -ltiff. The reference will not be resolved.
    Move the -ltiff option to a spot later on the command line, after all libraries that use libtiff, but before any libraries that libtiff uses. If libraries have circular references (A uses B which uses A), leave -ltiff where it is, but add another one later on the command line. The library will be searched twice.
    Another option is to build libtiff as a shared library (.so). The position on the link command line of a shared library is less sensitive, and references to it from later files can still be resolved. You don't list a shared library twice.
    An unrelated question: Why are you using the -compat=4 option? That option is provided to allow linking code that was compiled by C++ 4.2 (shipped in 1996), or compiling code that predates the 1998 C++ Standard.
    You usually cannot mix -compat=4 binaries with standard-mode binaries, you can't use the C++ standard library in -compat=4 mode, and code using C++ features introduced after the ARM (1991) won't compile in -compat=4 mode. Unless you are stuck with 10-year-old binaries built with C++ 4.2, it is best to recompile all your code in default standard mode (without -compat=4).
    The C++ Migration Guide explains all the issues involved in converting code from old-style to standard C++.
    [http://docs.sun.com/app/docs/doc/819-3689|http://docs.sun.com/app/docs/doc/819-3689]

  • Cc - Undefined symbol

    Hi
    I'm trying to use prof and so have to use the static version of our libraries. Those are generated freshly by the build process but haven't been used for years.
    I am getting an 'Undefined symbol' linking error. The command looks something like this:
    cc -p foo.o -foo -Bstatic -lourlib1 -lourlib2 -Bdynamic <sybase libs> -lm -lsocket
    The function in question, say bar() is referenced from ourlib2 and is defined with ourlib1. I can see it using nm:
    nm libourlib1.a:
    [14] | 104| 60|FUNC |GLOB |0 |2 |bar
    I even tried referring to ourlib1 by fullpath/libourlib1.a - no luck.
    I have tried to reproduce this on a toy program - no luck again, everything links fine! Clearly something is the matter with our setup... but what could it be? My version is cc: Sun C 5.5 2003/03/12
    Thanks!

    Static libraries are searched in order for symbols that have been referenced but not yet defined. If the command line has the sequence
    lib1.a lib2.a
    and lib2.a needs a symbol from lib1.a, it is too late -- lib1 has already been searched.
    If lib1.a does not need any symbols from lib2.a, just reverse the sequence:
    lib2.a lib1.a
    If the libraries cross-reference each other, you can list the libraries more than once:
    lib1.a lib2.a lib1.a lib2.a
    Symbols from lib1.a needed by lib2.a will be picked up the second time lib1.a is scanned. These new symbols from lib1.a might need additional sybols from lib2.a, so you can list it again. In really bad cases, you would need to list the libraries several times.
    You don't have this exact problem with shared libraries, because all the symbols from a shared library are available throughout the linking process. But you have a different problem if shared libraries reference each other.
    The linker arranges for shared libraries to be initialized in reverse dependency order. If lib1 depends on (uses symbols from) lib2, the linker will arrange for lib2 to be initialized first. But if the libraries depend on each other, there is no correct initialization order. You always run the risk of trying to use something from a library that has not been initialized.
    Best practice for all kinds of libraries is to organize them in a hierarchy: If lib1 uses something from lib2, then lib2 does not use anything from lib2. If you can't achieve that effect, either combine them into a single library, or split out parts of lib1 and lib2 into a new library to create a hierarchical ordering among the three.

  • Error compiling "Undefined symbols for architecture armv6:"

    Hey, I seem to be getting errors like this a lot... I only just started making apps yesterday, so they are all still very basic, but I was wondering if I am doing something wrong when I import frameworks?
    This may be caused from something else entirely, but this is what I seem to think is causing it...
    Basically the error I'm getting is:
    Undefined symbols for architecture armv6:
    "_kUTTypeImage", referenced from:
    -[CameraViewController(CameraDelegateMethods) imagePickerController:didFinishPickingMediaWithInfo:] in CameraViewController.o
    -[CameraViewController(CameraDelegateMethods) startCameraControllerFromViewController:usingDelegate:] in CameraViewController.o
    "_kUTTypeMovie", referenced from:
    -[CameraViewController(CameraDelegateMethods) imagePickerController:didFinishPickingMediaWithInfo:] in CameraViewController.o
    "_OBJC_CLASS_$_CameraViewController", referenced from:
    objc-class-ref in CameraViewController.o
    l_OBJC_$_CATEGORY_CameraViewController_$_CameraDelegateMethods in CameraViewController.o
    ld: symbol(s) not found for architecture armv6
    collect2: ld returned 1 exit status
    As you can probably tell, I am trying to make a very simple camera app. Most of the code is copied and pasted straight from apple's site.
    If it would help I can put the full source code I have so far on these forums, just let me know.
    Thanks for any help!

    I've got this error while importing a project from XCode 3 to XCode 4
    A simple workaround which has worked for me was :
    1) Start a new project from scratch in XCode 4 using a template... I know, it should be tedious... ;-(
    2) You should change the build settings  « Architectures » of your project (under TARGETS) to compile with « armv6 » instead of the default value which is « Standard (armv7) »
    Double click « Standard (armv7) » in the « Architectures » setting 
    Add « armv6 » in the popup after clicking « + » button in the bottom-left of the popup

  • Linker error:  ild: (undefined symbol)

    I am porting a large pack of C++ from AIX to Solaris. All the modules now passed compilation. But the linker (incremental loader) complains about undefined symbol, such as
    ild: (undefined symbol) __rwstd::__rb_tree<CString,std::pair<const CString,int>,__rwstd::__select1st<std::pair<const CString,int>,CString>,std::less<CString>,std::allocator<std::pair<const CString,int> > >::iterator __rwstd::__rb_tree<CString,std::pair<const CString,int>,__rwstd::__select1st<std::pair<const CString,int>,CString>,std::less<CString>,std::allocator<std::pair<const CString,int> > >::erase(__rwstd::__rb_tree<CString,std::pair<const CString,int>,__rwstd::__select1st<std::pair<const CString,int>,CString>,std::less<CString>,std::allocator<std::pair<const CString,int> > >::iterator,__rwstd::__rb_tree<CString,std::pair<const
    CString,int>,__rwstd::__select1st<std::pair<const String,int>,CString>,std::less<CString>,std::allocator<std::pair<const CString,int> > >::iterator) -- referenced in the text segment of ../Release/solaris/libSpiderWeb.a(SpiderCommand.o)
    ild: (undefined symbol) void std::list<const Process*,std::allocator<const Process*> >::__deallocate_buffers() -- referenced in the text segment of ../Release/solaris/libDragline.a(SystemScope.o)
    I did not explicitly use those functions for sure. However, when I link a small test program using std::list and/or std::map which had at least __deallocate_buffers after template instantiation, the linker did not complain.
    Any insighgt? What could be the problem and what is the fix?
    BTW I am on SunOS 5.6 sun4u sparc SUNW,Ultra-2 and use compiler Sun WorkShop 6 2000/04/07 C++ 5.1.
    Thanks a lot!
    Lan

    There is no Solaris 6.2. To find the Solaris version, run the command
    uname -a
    Probably you mean Sun Workshop (or Forte Developer) 6 update 2. (The name of the product changed mid-stream, from "Sun Workshop" to "Forte Developer", and now is "Sun Studio".)
    To find the compiler version, run the command
    CC -V
    For Workshop 6u2, the CC version is 5.3.
    For old compiler versions like this, problems with missing template definitions can usually be fixed by clearing the template cache and rebuilding. To clear the template cache, you can just remove the directory SunWS_cache, or more conservatively, run the command
    CCadmin -clean
    There will be a cache directory in every directory where you create .o files. You need to clean all of them.
    Starting with Sun Studio 8 (C++ 5.5) in 2003, the compiler no longer uses a template cache by default. These kinds of problems no longer occur.
    You really should stop using the old compiler, and get a current one. The later compilers run faster, generate code that runs faster, are more standard-conforming, support modern hardware, and have superior program development tools (compiler, debugger, performance analyzer, thread analyzer). Best of all, the current compilers are completely free for all uses. The only license is the license you click to accept when you download the product.
    If you are running on Solaris 8, get Sun Studio 11 here:
    [http://developers.sun.com/sunstudio/products/previous/11/index.jsp]
    If you are running on Solaris 9, Solaris 10, Solaris Express, or Open Solaris, get the current release, Sun Studio 12:
    [http://developers.sun.com/sunstudio/]

  • C++ linking error Undefined symbols  AIX 5.3 xlC  bdb 4.7

    I am getting the following linking error while linking the MyCb example given in Berkley DB guide
    xlC -bnoquiet -o /ra2/frt_bld/TMPBIN/BDBtest \
    /ra2/frt_bld/TMPOBJ/DBAbs.o \
    /ra2/frt_bld/TMPOBJ/MyDb.o \
    /ra2/frt_bld/TMPOBJ/PPNum.o \
    /ra2/frt_bld/TMPOBJ/PPNumStore.o \
    /ra2/frt_bld/TMPOBJ/PPNumStoreDB.o \
    /ra2/frt_bld/TMPOBJ/UTDbtest.o \
    /ra2/frt_bld/TMPOBJ/UTPPNUm.o \
    -lC_r ../../../ACE_wrappers/ace/libACE.so -ldb_cxx -L../../../db-4.7.25/build_unix -L/usr/local/ssl -L/../../../ACE_wrappers/ace -lcrypto -lpthread -lz -lm -o /ra2/frt_bld/TMPBIN/BDBtest
    ld: 0711-318 ERROR: Undefined symbols were found.
    The following symbols are in error:
    Symbol Inpndx TY CL Source-File(Object-File) OR Import-File{Shared-object}
    RLD: Address Section Rld-type Referencing Symbol
    .Db::set_error_stream(std::basic_ostream<char,std::char_traits<char> >*) [1010] ER PR MyDb.cpp(/ra2/frt_bld/TMPOBJ/MyDb.o)
    00003b50 .text R_RBR [148] .MyDb::MyDb(std::basic_string<char,std::char_traits<char>,std::allocator<char> >&,std::basic_string<char,std::char_traits<char>,std::allocator<char> >&)
    .Db::open(DbTxn*,const char*,const char*,DBTYPE,unsigned int,int) [1012] ER PR MyDb.cpp(/ra2/frt_bld/TMPOBJ/MyDb.o)
    00003b84 .text R_RBR [148] .MyDb::MyDb(std::basic_string<char,std::char_traits<char>,std::allocator<char> >&,std::basic_string<char,std::char_traits<char>,std::allocator<char> >&)
    ER: The return code is 8.
    ld: 0711-317 ERROR: Undefined symbol: .Db::open(DbTxn*,const char*,const char*,DBTYPE,unsigned int,int)
    // File: MyDb.cpp
    #include "MyDb.h"
    #include <string>
    #include <iostream>
    // Class constructor. Requires a path to the location
    // where the database is located, and a database name
    MyDb::MyDb(std::string &path, std::string &dbName)
    : db_(NULL, 0), // Instantiate Db object
    dbFileName_(path + dbName), // Database file name
    cFlags_(DB_CREATE) // If the database doesn't yet exist,
    // allow it to be created.
    try
    // Redirect debugging information to std::cerr
    db_.set_error_stream( static_cast<std::ostream *>(&std::cerr) );
    // Open the database
    db_.open(NULL, dbFileName_.c_str(), NULL, DB_BTREE, cFlags_, 0);
    // DbException is not a subclass of std::exception, so we
    // need to catch them both.
    catch(DbException &e)
    std::cerr << "Error opening database: " << dbFileName_ << "\n";
    std::cerr << e.what() << std::endl;
    catch(std::exception &e)
    std::cerr << "Error opening database: " << dbFileName_ << "\n";
    std::cerr << e.what() << std::endl;
    //And then we need the implementation for the close() method:
    // Private member used to close a database. Called from the class
    // destructor.
    void
    MyDb::close()
    // Close the db
    try
    db_.close(0);
    std::cout << "Database " << dbFileName_
    << " is closed." << std::endl;
    catch(DbException &e)
    std::cerr << "Error closing database: " << dbFileName_ << "\n";
    std::cerr << e.what() << std::endl;
    catch(std::exception &e)
    std::cerr << "Error closing database: " << dbFileName_ << "\n";
    std::cerr << e.what() << std::endl;
    Thanks
    Anand Rathi
    Edited by: user10127683 on Jun 10, 2009 9:02 AM

    Hi Anand,
    http://www.oracle.com/technology/documentation/berkeley-db/db/ref/build_unix/aix.html <-- check FAQ #4.
    Please use a "-D_LARGE_FILES=1" when building BDB on AIX.
    Let me know how it works.
    Thanks,
    Bogdan Coman

Maybe you are looking for

  • Report design Grouping problem

    I'm currently designing a report, something like an invoice. The invoice number is usually on the page header. But now i want to create a report to list down all the invoice numbers in the 'details' but when i drag the 'invoice number' data to 'detai

  • Copying pages to the local portal

    Hi, Is it possible for me to copy the pages from our production portal to my local portal. This is because I would like to make try out something on the portal pages and I cannot do that in Production. Also, can I use WebDAV for the same? Thanks a lo

  • Planning Data Pull process failed with timeout error

    Hi Experts, Version: Oracle apps 11.5.10.2 Issue: Planning Data Pull process failed with timeout error message in the log file as follows, The Request id : 90018907 has Phase : COMPLETE and Status: ERROR Concurrent Message : Timeout error. There is a

  • Need help in reseting or restore of ipod

    My daughter bought an ipod apple now need to know how to reset it?

  • WLWPatchInitialize.cmd Missing after Integration Server Installation 9.2

    Hello, After installing BEA Integration Server 9.2 without any problem I could not find the WLWPatchInitialize.cmd file. This batch file must be executed in order that the BEA Integration 92 would be enabled in Eclipse Workshop provided by BEA. It se