Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

LNK 1104 error

Status
Not open for further replies.

thegame8311

Technical User
Jan 6, 2012
133
0
0
US
I have been all over the place with this and I can't seem to get past the linker errors, and this last one is getting to me

fatal error LNK1104: cannot open file 'C:\Program Files\MySQL\MySQL Server 5.5\lib\\.obj'

here is the code:
Code:
// Test2.cpp : Defines the entry point for the console application.
//

#include "stdafx.h"
#include <Windows.h>
#include <stdio.h>
#include <urlmon.h>
#include <iostream>
#include <tchar.h>
#include <fstream>
#include <string>
#include <sqlext.h>

#include <stdlib.h>
#include <stddef.h>

#include <winsock.h>
#include <cstdio>
#include <mysql.h>

#pragma comment (lib, "urlmon.lib")
//#pragma comment (lib, "libmysql.lib")
using namespace std;
void ProcsLink(string plink);
string Team_Name(string team);
string PName(string name);
void Playerfunc();

int _tmain(int argc, _TCHAR* argv[])
{
    system("del LivePlayers.txt");
    Playerfunc();
    system("del testA.txt");
    system("del testB.txt");


    // create a pointer of the type mysql
MYSQL *conn;
// initialize your mysql connection
conn = mysql_init(NULL);
// connect to your database
mysql_real_connect(conn,"localhost","username","password","database",0,NULL,0);
// perform a query
mysql_query(conn,"UPDATE my_table SET somevalue = somevalue + 1 WHERE id = 5");
// close the connection
mysql_close(conn);
}
This has been driving me nuts I have include the lib and include from mysql folder, so what is going on?

Also I have quoted the folder name with spaces in it, albiet there is not a obj file in that directory.

if I removed that entry i get
Code:
1>Test2.obj : error LNK2019: unresolved external symbol _mysql_close@4 referenced in function _main
1>Test2.obj : error LNK2019: unresolved external symbol _mysql_query@8 referenced in function _main
1>Test2.obj : error LNK2019: unresolved external symbol _mysql_real_connect@32 referenced in function _main
1>Test2.obj : error LNK2019: unresolved external symbol _mysql_init@4 referenced in function _main
1>C:\Users\Sasuke\documents\visual studio 2010\Projects\Test2\Debug\Test2.exe : fatal error LNK1120: 4 unresolved externals
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

so what do i do now?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top