Menu

next linker problem

2005-08-03
2012-09-26
  • Nobody/Anonymous

    to dwaye,

    thanks for the link to the FAQ section, very helpufll but still have the same errr. Now i have included the log file and the ( small ) .c file:

    • indeed as you mentioned in the faq, the GCC is compiling as c, and not c++, so that part seems to be ok,

    greetings, Peter

    Bezig met uitvoeren van gcc.exe...
    gcc.exe "C:\Dev-Cpp\UIPCHello.c" -o "C:\Dev-Cpp\UIPCHello.exe" -I"C:\Dev-Cpp\include" -L"C:\Dev-Cpp\lib" -L"C:\Dev-Cpp\lib"
    C:\DOCUME~1\USER1\LOCALS~1\Temp/ccaIbaaa.o(.text+0x18):UIPCHello.c: undefined reference to FSUIPC_Open' C:\DOCUME~1\USER1\LOCALS~1\Temp/ccaIbaaa.o(.text+0x4d):UIPCHello.c: undefined reference toFSUIPC_Write'
    C:\DOCUME~1\USER1\LOCALS~1\Temp/ccaIbaaa.o(.text+0x5c):UIPCHello.c: undefined reference to FSUIPC_Process' C:\DOCUME~1\USER1\LOCALS~1\Temp/ccaIbaaa.o(.text+0x81):UIPCHello.c: undefined reference toFSUIPC_Read'
    C:\DOCUME~1\USER1\LOCALS~1\Temp/ccaIbaaa.o(.text+0x90):UIPCHello.c: undefined reference to FSUIPC_Process' C:\DOCUME~1\USER1\LOCALS~1\Temp/ccaIbaaa.o(.text+0x113):UIPCHello.c: undefined reference toFSUIPC_Version'
    C:\DOCUME~1\USER1\LOCALS~1\Temp/ccaIbaaa.o(.text+0x11f):UIPCHello.c: undefined reference to FSUIPC_Version' C:\DOCUME~1\USER1\LOCALS~1\Temp/ccaIbaaa.o(.text+0x14f):UIPCHello.c: undefined reference toFSUIPC_Version'
    C:\DOCUME~1\USER1\LOCALS~1\Temp/ccaIbaaa.o(.text+0x161):UIPCHello.c: undefined reference to `FSUIPC_Version'

    C:\DOCUME~1\USER1\LOCALS~1\Temp/ccaIbaaa.o(.text+0x173):UIPCHello.c: undefined reference to FSUIPC_Version' C:\DOCUME~1\USER1\LOCALS~1\Temp/ccaIbaaa.o(.text+0x185):UIPCHello.c: more undefined references toFSUIPC_Version' follow
    C:\DOCUME~1\USER1\LOCALS~1\Temp/ccaIbaaa.o(.text+0x198):UIPCHello.c: undefined reference to FSUIPC_FS_Version' C:\DOCUME~1\USER1\LOCALS~1\Temp/ccaIbaaa.o(.text+0x1a1):UIPCHello.c: undefined reference toFSUIPC_FS_Version'
    C:\DOCUME~1\USER1\LOCALS~1\Temp/ccaIbaaa.o(.text+0x1a9):UIPCHello.c: undefined reference to FSUIPC_FS_Version' C:\DOCUME~1\USER1\LOCALS~1\Temp/ccaIbaaa.o(.text+0x23f):UIPCHello.c: undefined reference toFSUIPC_Close'
    collect2: ld returned 1 exit status

    Uitvoering voltooid

    / UIPChello.c Displays UIPC link data in a message box /

    include <windows.h>

    include "FSUIPC_User.h"

    char *pszErrors[] =
    { "Okay",
    "Attempt to Open when already Open",
    "Cannot link to FSUIPC or WideClient",
    "Failed to Register common message with Windows",
    "Failed to create Atom for mapping filename",
    "Failed to create a file mapping object",
    "Failed to open a view to the file map",
    "Incorrect version of FSUIPC, or not FSUIPC",
    "Sim is not version requested",
    "Call cannot execute, link not Open",
    "Call cannot execute: no requests accumulated",
    "IPC timed out all retries",
    "IPC sendmessage failed all retries",
    "IPC request contains bad data",
    "Maybe running on WideClient, but FS not running on Server, or wrong FSUIPC",
    "Read or Write request cannot be added, memory for Process is full",
    };

    int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, PSTR szCmdLine, int iCmdShow)
    { DWORD dwResult;

    if (FSUIPC_Open(SIM_ANY, &amp;dwResult))
    {   char chMsg[128], chTimeMsg[64];
        char chTime[3];
        BOOL fTimeOk = TRUE;
        static char *pFS[] = { &quot;FS98&quot;, &quot;FS2000&quot;, &quot;CFS2&quot;, &quot;CFS1&quot;, &quot;Fly!&quot;, &quot;FS2002&quot;, &quot;FS2004&quot; };  // Change made 060603
    
        // Okay, we're linked, and already the FSUIPC_Open has had an initial
        // exchange with FSUIPC to get its version number and to differentiate
        // between FS's.
    
        // Now to auto-Register with FSUIPC, to save the user of an Unregistered FSUIPC
        // having to Register UIPCHello for us:
        static char chOurKey[] = &quot;IKB3BI67TCHE&quot;; // As obtained from Pete Dowson
    
        if (FSUIPC_Write(0x8001, 12, chOurKey, &amp;dwResult))
            FSUIPC_Process(&amp;dwResult); // Process the request(s)
    
        // I've not checked the reslut of the above -- if it didn't register us,
        // and FSUIPC isn't fully user-Registered, the next request will not
        // return the FS lock time
    
        // As an example of retrieving data, well also get the FS clock time too:
        if (!FSUIPC_Read(0x238, 3, chTime, &amp;dwResult) ||
                // If we wanted other reads/writes at the same time, we could put them here
                !FSUIPC_Process(&amp;dwResult)) // Process the request(s)
            fTimeOk = FALSE;
    
        // Now display all the knowledge we've
    

    accrued:
    if (fTimeOk)
    wsprintf(chTimeMsg, "Request for time ok: FS clock = %02d:%02d:%02d", chTime[0], chTime[1], chTime[2]);

        else
            wsprintf(chTimeMsg, &quot;Request for time failed: %s&quot;, pszErrors[dwResult]);
    
        wsprintf(chMsg, &quot;Sim is %s,   FSUIPC Version = %c.%c%c%c%c\r%s&quot;,
            (FSUIPC_FS_Version &amp;&amp; (FSUIPC_FS_Version &lt;= 7)) ? pFS[FSUIPC_FS_Version - 1] : &quot;Unknown FS&quot;, // Change made 060603
            '0' + (0x0f &amp; (FSUIPC_Version &gt;&gt; 28)),
            '0' + (0x0f &amp; (FSUIPC_Version &gt;&gt; 24)),
            '0' + (0x0f &amp; (FSUIPC_Version &gt;&gt; 20)),
            '0' + (0x0f &amp; (FSUIPC_Version &gt;&gt; 16)),
            (FSUIPC_Version &amp; 0xffff) ? 'a' + (FSUIPC_Version &amp; 0xff) - 1 : ' ',
            chTimeMsg);
        MessageBox (NULL, chMsg, &quot;UIPChello: Link established to FSUIPC&quot;, 0) ;
    }
    
    else
        MessageBox (NULL, pszErrors[dwResult], &quot;UIPChello: Failed to open link to FSUIPC&quot;, 0) ;
    
    FSUIPC_Close(); // Closing when it wasn't open is okay, so this is safe here
    

    return 0 ;
    }

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.