poco icon indicating copy to clipboard operation
poco copied to clipboard

Could NOT find MySQL (missing: MYSQL_INCLUDE_DIR)

Open DemKKK opened this issue 3 years ago • 2 comments

In my computer I install mysql8.0 from source code, and has set MYSQL_ROOT_DIR, but still does't work. I have notice that in FindMySQL.cmake file, poco find mysql as mysql/mysql.h after poco-1.10.1, but in mysql8.0 mysql.h installed in “inlcude” dircetory, which means we could't use mysql.h as <mysql/mysql.h>,so what should I do to solve this problem?it's same as this issue image

DemKKK avatar Aug 03 '22 02:08 DemKKK

You should fix it and send the fix as pull request to devel branch. Or wait until someone else does that.

aleks-f avatar Aug 04 '22 08:08 aleks-f

@hmartinez82 @aleks-f @FreelancerCGN @DemKKK This last commit c023404a03668c179a0ee78a85093153313cb3b8 on the develbranch fixes the issue about Data/MySQL (include <mysql.h> not found. The real problem is coming from the CLang compiler that is looking for <mysql.h> into the system include diretories only when the include is in a ".h" file. When the #include <mysql.h> directory is in a *.cpp file, CLang is looking first in the local source directory. Then in Data/MySQL/scr, CLang found "MySQL.H" that is the wrong <mysql.h> include.

Look at the errors below

In file included from src/Utility.cpp:17: In file included from include/Poco/Data/MySQL/Utility.h:21: include/Poco/Data/MySQL/mysql.h:22:10: error: 'mysql.h' file not found with include; use "quotes" instead #include <mysql.h> ^~~~~~~~~ "mysql.h" In file included from src/Utility.cpp:17: include/Poco/Data/MySQL/Utility.h:23:10: error: 'mysql.h' file not found with include; use "quotes" instead #include <mysql.h> ^~~~~~~~~ "mysql.h" src/Utility.cpp:18:10: fatal error: 'mysql.h' file not found #include <mysql.h> ^~~~~~~~~ 3 errors generated.

So the fix is consisting in removing all #include <mysql.h> from the Data/MySQL/src files and reference the <mysql.h> include only in Data/MySQL/include/Poco/Data/MySQL/MySQL.h

zosrothko avatar Aug 21 '22 09:08 zosrothko

This issue is stale because it has been open for 365 days with no activity.

github-actions[bot] avatar Aug 22 '23 02:08 github-actions[bot]

This issue was closed because it has been inactive for 60 days since being marked as stale.

github-actions[bot] avatar Oct 21 '23 02:10 github-actions[bot]