'C Programming fatal error my sql.h no file or such directory on code blocks

I'm unable to use mysql on C when I do #include <mysql.h> or #include "mysql.h". Every time I try to run this program, I get a fatal error.

I put these as my linker settings to add the sql library : C:\Program Files\MySQL\Connector C++ 8.0\libmysqlclient.so C:\Program Files\MySQL\MySQL Server 8.0

also this is my search directories: C:\Program Files\MySQL\Connector C++ 8.0 C:\Program Files\MySQL\MySQL Server 8.0

Any idea how to make codeblocks work with this?

Thanks and I'll keep searching too.



Solution 1:[1]

In looking for the answer, I found it. So instead of doing what I did in the link and search directories, instead do this: Linker settings: "C:\Program Files\MySQL\MySQL Server 8.0\lib\libmysql.lib" "C:\Program Files\MySQL\MySQL Server 8.0\lib\mysqlclient.lib"

Search Directores: "C:\Program Files\MySQL\MySQL Server 8.0\lib" "C:\Program Files\MySQL\MySQL Server 8.0\include" This allowed me to compile the code with no errors

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 lagseeingz