These days want to debug Erlang nif call C CPI so download the source code, the main want to generate a Mysql_nif.dll link library.
Win under:
Extract source code out, Lib directory under Libmysql.dll, Libmysql.lib, Mysqlclient.lib three files, feel very strange, and then asked Tatsu da colleagues also GG a bit, and found that if you use link libmysql.lib, you must have Libmysql.dll in the same directory as the build DLL. If you use Mysqlclient.lib, the code must be linked
#pragma COMMENT (linker, "/nodefaultlib:libcmt.lib")
#pragma COMMENT (linker, "/nodefaultlib:msvcrtd.lib").
Then the VS2010 configuration properties can be generated mysql_nif.dll ...
Under Linux:
Simpler, press the following compile.
Gcc-fpic-shared-o mysql_nif.so mysql_nif.c-i/usr/local/mysql/include/mysql-l/usr/local/mysql/lib/mysql-l mysqlcli Ent-i/usr/local/lib/erlang/erts-5.8/include