Smart questions
Smart answers
Smart people
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Member Login

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips now!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

Join Tek-Tips
*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

LINK TO THIS FORUM!

Add Stickiness To Your Site By Linking To This Professionally Managed Technical Forum.
Just copy and paste the
code below into your site.

Partner With Us!

"Best Of Breed" Forums Add Stickiness To Your Site
Partner Button
(Download This Button Today!)

Feedback

"...I think the site is just incredible....I am learning more here than anywhere else before and am looking forward to being able to help someone .... this is my idea of what the Internet is supposed to do..."

Geography

Where in the world do Tek-Tips members come from?
thegame8311 (TechnicalUser)
5 Apr 12 13:34
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?

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Back To Forum

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close