CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Dec 2006
    Posts
    4

    Lib LNK2001 why?

    hi all ! Im trying to compile a project and everything works fine, now Im adding a new lib for handling a database. I got the files from http://www.sqlite.org/

    all Im trying to do is this :
    Code:
    #include "sqlite3.h" //DB
    
    Player::LoadPlayerDataDB()
    {
      #pragma comment (lib, "lib/sqlite.lib") /* link with Microsoft OpenGL lib */
     sqlite3 *db;
     char *zErrMsg = 0;
     int rc;
     const char *sqlite3_libversion(void);
    
      const char *filename="/Database/player.db";
    
      rc = sqlite3_open(filename, &db);
      if( rc ){
        sqlite3_close(db);
        exit(1);
      }
    But I get the link error, the thing is that I ave worked with Libs before and I actually use some atm and I had no probs, I added the lib to my project and all but still have the same error.

    Any help is appreciated.

    THanks!

  2. #2
    Join Date
    Mar 2005
    Location
    Romania,Cluj-Napoca
    Posts
    1,073

    Re: Lib LNK2001 why?

    Can you post the full link error ?
    Or perhaps you move the
    Code:
    #pragma comment (lib, "lib/sqlite.lib") /* link with Microsoft OpenGL lib */'
    to your header file . ( I'm not sure if this will fix your problem ).
    Please use code tags [code] [/code]

    We would change the world, but God won't give us the sourcecode..
    Undocumented futures are fun and useful....
    ___
    ______
    Gili

Posting Permissions

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





Click Here to Expand Forum to Full Width

Featured