×

Discussion Board

Results 1 to 3 of 3
  1. #1
    Registered User
    Join Date
    Oct 2006
    Posts
    3

    Strange compilation errors

    Hi everyone, I'm trying to make a bluetooth scanner (part of a University project), but getting rather stuck with errors. I've got a function which should attempt to scan for devices, but whenever I reference the function in code, it creates compile-time errors. However, I get no line numbers for these errors, so I find it hard to debug. I'm using Carbide.c++ as an IDE, and here are the errors I get:

    Code:
    Undefined symbol: 'int RHostResolver::Open(class RSocketServ &, unsigned int, unsigned int) (?Open@RHostResolver@@QAEHAAVRSocketServ@@II@Z)' referenced from 'int PerformScan(void) (?PerformScan@@YAHXZ)' in MyProjectAppUi.cpp:88	MyProject		line 0
    
    Undefined symbol: 'int RSocketServ::Connect(unsigned int) (?Connect@RSocketServ@@QAEHI@Z)' referenced from 'int PerformScan(void) (?PerformScan@@YAHXZ)' in MyProjectAppUi.cpp:81	MyProject		line 0
    
    Undefined symbol: 'int RSocketServ::FindProtocol(class TBuf<32> const &, struct TProtocolDesc &) (?FindProtocol@RSocketServ@@QAEHABV?$TBuf@$0CA@@@AAUTProtocolDesc@@@Z)' referenced from 'int PerformScan(void) (?PerformScan@@YAHXZ)' in MyProjectAppUi.cpp:84	MyProject		line 0
    
    Undefined symbol: 'RSocketServ::RSocketServ(void) (??0RSocketServ@@QAE@XZ)' referenced from 'int PerformScan(void) (?PerformScan@@YAHXZ)' in MyProjectAppUi.cpp:80	MyProject		line 0
    
    Undefined symbol: 'TInquirySockAddr::TInquirySockAddr(void) (??0TInquirySockAddr@@QAE@XZ)' referenced from 'int PerformScan(void) (?PerformScan@@YAHXZ)' in MyProjectAppUi.cpp:91	MyProject		line 0
    
    Undefined symbol: 'TSockAddr::TSockAddr(void) (??0TSockAddr@@QAE@XZ)' referenced from 'int PerformScan(void) (?PerformScan@@YAHXZ)' in MyProjectAppUi.cpp:92 referenced from 'int PerformScan(void) (?PerformScan@@YAHXZ)' in MyProjectAppUi.cpp:93	MyProject		line 0
    
    80[>referenced from 'int PerformScan]	MyProject
    
    81[>referenced from 'int PerformScan]	MyProject
    
    84[>referenced from 'int PerformScan]	MyProject
    
    88[>referenced from 'int PerformScan]	MyProject
    
    91[>referenced from 'int PerformScan]	MyProject
    
    92[>referenced from 'int PerformScan]	MyProject
    
    93[>referenced from 'int PerformScan]	MyProject
    
    99[>referenced from 'int PerformScan]	MyProject
    
    CTags not installed or not in path	MyProject

    The function that calls it is like so (and when the bold line is removed, all errors disappear):

    Code:
    void CMyProjectAppUi::HandleCommandL(TInt aCommand)
        {
        switch ( aCommand )
            {
            case EAknSoftkeyBack:
            case EEikCmdExit:
                {
                Exit();
                break;
                }
            case 1:
                {
                iEikonEnv->InfoMsg(_L("Scanning"));
                PerformScan();
                break;
                
                }
            // TODO: Add Your command handling code here
    
            default:
                break;      
            }
        }
    And finally, here's the code it calls (copied & modifed from the help files):
    Code:
    int PerformScan()
    {
    	// 1. Connect to the socket server
    	RSocketServ socketServ;
    	socketServ.Connect();
    	TProtocolDesc pInfo;
    	User::LeaveIfError(socketServ.FindProtocol(_L("BTLinkManager"),pInfo));
    	
    	// 2. Create and initialise an RHostResolver
    	RHostResolver hr;
    	User::LeaveIfError(hr.Open(socketServ,pInfo.iAddrFamily,pInfo.iProtocol));
    	
    	// 3. Set up a discovery query and start it
    	TInquirySockAddr addr;
    	TNameEntry entry;
    	TNameEntry blankEntry;
    	addr.SetIAC(KGIAC);
    	addr.SetAction(KHostResInquiry);
    	TRequestStatus status;
    	blankEntry.Zero();
    	entry.Zero();
    	hr.GetByAddress(addr, entry, status);
    	User::WaitForRequest(status);
    	
    	if (entry == blankEntry)
    	{
    		return 0;
    	} else {
    		return 1;
    	}
    }

    Any help would be appreciated, the matter has rather confused me.

  2. #2
    Nokia Developer Champion
    Join Date
    Mar 2006
    Location
    Helsinki, Finland
    Posts
    8,344

    Smile Re: Strange compilation errors

    Hello dear,

    You need to include proper .h and .lib when you use particular API.

    As you are using RSocketServ API, You need to include:
    Location: es_sock.h
    Link against: esock.lib
    A relevant thread is as follows:
    http://discussion.forum.nokia.com/fo...ad.php?t=92497

    Refer to Carbide.c++ help for more information.

    Regards.
    Kiran.

  3. #3
    Registered User
    Join Date
    Oct 2006
    Posts
    3

    Re: Strange compilation errors

    Great, that worked, thanks!

Similar Threads

  1. Strange Compilation error
    By stefano.garusi in forum Symbian
    Replies: 7
    Last Post: 2006-10-09, 12:54
  2. Carbide compilation errors
    By Monops in forum Carbide.c++ IDE and plug-ins (Closed)
    Replies: 2
    Last Post: 2006-05-15, 09:44
  3. Replies: 3
    Last Post: 2005-08-24, 14:25
  4. strange errors???
    By rahulchavan_2000 in forum Symbian
    Replies: 1
    Last Post: 2005-02-05, 13:20
  5. Replies: 2
    Last Post: 2005-01-24, 15:38

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×