![]() |
|
#1
|
|||
|
|||
MySQL Won't WorkI'm having a problem connecting to a MySQL database through my c++ programs. I use Borland 5.5.1 C++ Builder and I used the "MySQL++ 1.7.1 for Borland C++ 5.* for Windows (contributed by Arturs Aboltins", which can be found the sixth from the bottom at http://www.mysql.com/downloads/api-mysql++.html. I installed it, and I tried to compile this test program:
CPP / C++ / C Code:
But I get this error: Borland C++ 5.5.1 for Win32 Copyright (c) 1993, 2000 Borland test.cpp: Turbo Incremental Link 5.00 Copyright (c) 1997, 2000 Borland Error: Unresolved external 'mysql_init' referenced from C:\BORLAND\BCC55\BIN\TEST.OBJ Error: Unresolved external 'mysql_options' referenced from C:\BORLAND\BCC55\BIN\TEST.OBJ Error: Unresolved external 'mysql_real_connect' referenced from C:\BORLAND\BCC55\BIN\TEST.OBJ Error: Unresolved external 'mysql_error' referenced from C:\BORLAND\BCC55\BIN\TEST.OBJ What can I do to fix this? If I can't fix it, what other options do I have to use MySQL databases in my programs (without paying for anything!)? |
|||
|
#2
|
||||
|
||||
|
Quote:
I've never used this library, but this is a linker error. Are you linking your program with the library? This would either be a precompiled library (lib-dll) or the c file. If you are and having this problem, then it is something that I would need to look into further before I could help. |
|
#3
|
|||
|
|||
|
Thanks - I just realized you're the same person who helped me with my earlier problem, the one with cin.
Anyway, sorry for being a total idiot. But how do you do that? Is it different with different compilers, or do you include it with the code? I'm such a newbie |
|
#4
|
||||
|
||||
|
I haven't used the borland c compiler, but if it is similar to the Visual C compiler, you should be able to make a project somehow. What you want to do is include the source code for the library into that project along with your source code above. Your compiler should handle compiling both your project and the library and then passing them to the linker to be linked together.
Sorry, I can't be of more help. If you are still struggling with this let me know and I can take a closer look at the mysql library that you downloaded tommorow. ![]() |
|
#5
|
|||
|
|||
WorksI got it to work. Since Borland C++ Builder is a command-line tool, you can't make projects. But I just had to list the .lib file with the file I was compiling, and it linked it. Thanks for your help, I wouldn't have been able to figure it out without you.
|
|
#6
|
|||
|
|||
Need your helpQuote:
I am facing the same problem as you were before. I'm a newbie and don't know how to make projects to work. I'm coding with Borland CBuilder 6, need to code with mySQL++ API. If you got it work let me know how. Please help, the more details the better. Thanks. |
|
#7
|
||||
|
||||
|
Quote:
Hi Roy. I am a little unfamiliar with Borland Builder, but if it does use a command line, then you should be able to add libraries quite easily. use the -l to add a library to be linked to your project and a -L to add a search path for a library to your compile command. (This is based on gcc, but most compilers follow this convention.) So, if you compile from the commmand line, you should be able to type something like: Code:
Hopefully, TRS can give you the exact commandline that he used. Good luck! |
Recent GIDBlog
Problems with the Navy (Enlisted) by crystalattice
| Thread Tools | Search this Thread |
| Rate This Thread | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Why doesnt my form work correctly? | rhino1616 | Web Design Forum | 2 | 06-Nov-2003 17:21 |
| How do web redirection scripts work? | rhino1616 | Web Design Forum | 9 | 27-Oct-2003 09:47 |
| MySQL Syntax Error | DropZite | MySQL / PHP Forum | 3 | 09-Jul-2003 04:00 |
| Windows: From only £20p/y,Linux: from $10p/m. ASP, ASP.NET, PHP, Free MySQL, +More | EyotaHosts | Web Hosting Advertisements & Offers | 0 | 28-Jun-2003 13:54 |
| mysql vs sql - what is the difference | zabell | MySQL / PHP Forum | 2 | 14-Jun-2003 16:32 |
Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The