Thread: cannot convert parameter 1 from 'char *' to 'long'

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    C++ Programmer
    Join Date
    Aug 2005
    Posts
    39
    I've got this now:

    Code:
    bool Request::handle_requests()
    {
    	cout << "Started Winamp Request Handler" << endl;
    	while(true)
    	{
    		if(!Request::winamp->CurrentPos)
    		{
    			if(!mysql_query(Request::mysql_conn, "SELECT * FROM e107_wa_request ORDER BY request_id ASC LIMIT 1"))
    			{
    				cout << "Error in selecting requests:\n" << mysql_error(Request::mysql_conn) << endl;
    				return false;
    			}
    			
    			result = mysql_use_result(Request::mysql_conn);
    			row = mysql_fetch_row(result);
    			
    			long playlist_pos = reinterpret_cast<long>(row[1]);
    			
    			Request::winamp->put_PlayListPos(playlist_pos);
    			Request::winamp->Play();
    			
    			cout << "Requesting: " << Request::winamp->GetSongTitle(playlist_pos) << "..." << endl;  						
    		}
    	}
    	
    	return false;
    }
    and this works

    But now, I get some other errors..

    ------ Build started: Project: Requester, Configuration: Debug Win32 ------
    Compiling...
    main.cpp
    Linking...
    main.obj : error LNK2019: unresolved external symbol _mysql_close@4 referenced in function "public: __thiscall Request::~Request(void)" (??1Request@@QAE@XZ)
    main.obj : error LNK2019: unresolved external symbol _mysql_error@4 referenced in function "public: bool __thiscall Request::connect_to_db(void)" (?connect_to_db@Request@@QAE_NXZ)
    main.obj : error LNK2019: unresolved external symbol _mysql_real_connect@32 referenced in function "public: bool __thiscall Request::connect_to_db(void)" (?connect_to_db@Request@@QAE_NXZ)
    main.obj : error LNK2019: unresolved external symbol _mysql_init@4 referenced in function "public: bool __thiscall Request::connect_to_db(void)" (?connect_to_db@Request@@QAE_NXZ)
    main.obj : error LNK2019: unresolved external symbol _mysql_fetch_row@4 referenced in function "public: bool __thiscall Request::handle_requests(void)" (?handle_requests@Request@@QAE_NXZ)
    main.obj : error LNK2019: unresolved external symbol _mysql_use_result@4 referenced in function "public: bool __thiscall Request::handle_requests(void)" (?handle_requests@Request@@QAE_NXZ)
    main.obj : error LNK2019: unresolved external symbol _mysql_query@8 referenced in function "public: bool __thiscall Request::handle_requests(void)" (?handle_requests@Request@@QAE_NXZ)
    C:\Documents and Settings\Lucas\My Documents\Visual Studio 2005\Projects\Requester\Debug\Requester.exe : fatal error LNK1120: 7 unresolved externals
    Build log was saved at "file://c:\Documents and Settings\Lucas\My Documents\Visual Studio 2005\Projects\Requester\Requester\Debug\BuildLog.h tm"
    Requester - 8 error(s), 0 warning(s)
    ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
    I think I know how to fix this problem, just add the libmysql linker to my project. But does anyone know where I can add linkers to my project in Visual C++ 2005?
    Last edited by MrLucky; 01-24-2006 at 12:25 PM.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Sorting Linked Lists
    By DKING89 in forum C Programming
    Replies: 6
    Last Post: 04-09-2008, 07:36 AM
  2. Screwy Linker Error - VC2005
    By Tonto in forum C++ Programming
    Replies: 5
    Last Post: 06-19-2007, 02:39 PM
  3. code condensing
    By bcianfrocca in forum C++ Programming
    Replies: 4
    Last Post: 09-07-2005, 09:22 AM
  4. comparing fields in a text file
    By darfader in forum C Programming
    Replies: 9
    Last Post: 08-22-2003, 08:21 AM
  5. String sorthing, file opening and saving.
    By j0hnb in forum C Programming
    Replies: 9
    Last Post: 01-23-2003, 01:18 AM