Closed iandinwoodie closed 3 years ago
You may be aware of this already, but I would guess that all of the LNK2019
errors:
system.obj : error LNK2019: unresolved external symbol _mysql_num_rows@4 referenced in function __catch$?RawQuery@Database@@QAE?AVDatabase_Result@@PBD_N1@Z$0 [D:\a\1\s\build\eoserv.vcxproj]
...
system.obj : error LNK2019: unresolved external symbol _mysql_close@4 referenced in function "public: void __thiscall Database::Close(void)" (?Close@Database@@QAEXXZ) [D:\a\1\s\build\eoserv.vcxproj]
are a result of the LNK4272
error:
C:\mysql-5.7.21-winx64\lib\mysqlclient.lib : warning LNK4272: library machine type 'x64' conflicts with target machine type 'x86' [D:\a\1\s\build\eoserv.vcxproj]
Where we can see the discrepancy between the 32-bit compiler and 64-bit library arise in the following two CMake output lines:
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/Enterprise/VC/Tools/MSVC/14.24.28314/bin/Hostx64/x86/cl.exe
...
-- Found MariaDB: C:/mysql-5.7.21-winx64/lib/mysqlclient.lib
The warnings in the "Install build dependencies" and "Build" jobs seem to go hand-in-hand:
WARNING: Warning: libmariadb.dll not found in $env:PATH
WARNING: Warning: no MariaDB found in $env:PATH - CMake may not be able to find the dependency
And it seems like we are expecting to use libmariadb.dll
but CMake is using mysqlclient.lib
:
-- Found MariaDB: C:/mysql-5.7.21-winx64/lib/mysqlclient.lib
I guess the question boils down to why install-deps.ps1
can't find libmariadb.dll
after installing it?
Yeah, I think this has to do with MySql client connector being pre-installed on the Azure Pipelines VMs. And apparently it has been built for x64 which is frustrating since eoserv isn't designed to build that way. We're in a catch 22 with the build:
I think I'm going to build out my own VM for Windows builds and just have it target that, but that will take a hot minute so please stand by :)
Finished in #26
There's a "hints" option for find_library
that lets you specify a path to the library, so that kept it from picking up the 64-bit version of mysql that is installed on the build VMs.
Add Windows and Linux Azure CI pipelines.