C language > Beginner questions

Using MySQL C Connector 6.1.11

(1/3) > >>

pjbrudal:
I try to access MySQL from Pelles C using Oracle's C connector version 6.1.11 (the most recent) with Pelles C IDE version 8.00, both in 32-bit version. But can't even compile and link a very trivial program. It's quite embarassing, since I used to be a professional C programmer from the mid-80's until around 2003 :( . I have attached the source files and the error messages and hope someone can tell me what's wrong. And yes, I have put the relevant path names into the boxes in Project Options -> Folders.

Jokaste:
try #include "crtdbg.h" rather than #include <crtdbg.h>

frankie:

--- Quote ---Building Test.exe.
POLINK: error: Unresolved external symbol '_mysql_get_client_info@0'.
POLINK: fatal error: 1 unresolved external(s).
*** Error code: 1 ***
Done.
--- End quote ---
Have added the mysql connector library to the linker?
Have you used the C connector, not the C++ connector library?

TimoVJL:
missing libmysql.lib ?

Usually this in source helps to remember what libraries program needs.

--- Code: ---#include <mysql.h>
#pragma comment(lib, "libmysql.lib")

--- End code ---

pjbrudal:
Thanks a lot for the advice, which unfortunately didn't help in any way.
a) The file crtdbg.h is part of Microsoft Visual Studio, which I don't have. It is included from the file my_global.h, which is part of Oracle's MySQL C connector. Based on advice from another forum on the internet, I wrote a small crtdbg.h stub and put it in the connector's include folder. However, I just got other problems later in the compilation. So I dropped the my_global.h and used stdio.h, windows.h and winsock.h instead.
b) I have indeed added the include and lib folders to the Folder tag in Project Options, - and I know that C and C++ are different :-)
c) I have also got all the files that came with the MySQL connector.

Today changed the folder options to use the MariaDB C connector instead. This failed in a somewhat similar way as with Oracle's MySQL, as can be seen from the attachment. There are two problem areas:
Compiler: I get complaints about _stdcall used instead of _cdecl in some places in mysql.h. Do I need to include some other header files?
Linker: I get an error message that I guess has something to do with a 'decorated' function name. How can get the names to match?

I haven't used C for 15 years and I assume that things have changed over the years. And this is the first time I use Pelles C. I suspect there is something very simple that I've overlooked.

Navigation

[0] Message Index

[#] Next page

Go to full version