/Arduino/libraries/MyLibrary/MyLibrary.cpp. Arduino add library mac.
If Perl reports that it cannot find the ./mysql/mysql.so
module, the problem is probably that Perl cannot locate the libmysqlclient.so
shared library. You should be able to fix this problem by one of the following methods:
2.15.3 Problems Using the Perl DBI/DBD Interface If Perl reports that it cannot find the./mysql/mysql.so module, the problem is probably that Perl cannot locate the libmysqlclient.so shared library. 2017-11-12 版权声明:本文内容由互联网用户自发贡献,版权归作者所有,本社区不拥有所有权,也不承担相关法律责任。如果您发现本社区中有涉嫌抄袭的内容,欢迎发送邮件至:yqgroup@service.aliyun.com 进行举报,并提供相关证据,一经查实,本社区将立刻删除涉嫌侵权内容。.
Copy libmysqlclient.so
to the directory where your other shared libraries are located (probably /usr/lib
or /lib
).
Modify the -L
options used to compile DBD::mysql
to reflect the actual location of libmysqlclient.so
.
On Linux, you can add the path name of the directory where libmysqlclient.so
is located to the /etc/ld.so.conf
file.
Add the path name of the directory where libmysqlclient.so
is located to the LD_RUN_PATH
environment variable. Some systems use LD_LIBRARY_PATH
instead.
Note that you may also need to modify the -L
options if there are other libraries that the linker fails to find. For example, if the linker cannot find libc
because it is in /lib
and the link command specifies -L/usr/lib
, change the -L
option to -L/lib
or add -L/lib
to the existing link command.
If you get the following errors from DBD::mysql
, you are probably using gcc (or using an old binary compiled with gcc):
Add -L/usr/lib/gcc-lib/.. -lgcc
to the link command when the mysql.so
library gets built (check the output from make for mysql.so
when you compile the Perl client). The -L
option should specify the path name of the directory where libgcc.a
is located on your system.
Another cause of this problem may be that Perl and MySQL are not both compiled with gcc. In this case, you can solve the mismatch by compiling both with gcc.
You may see the following error from DBD::mysql
when you run the tests:
This means that you need to include the -lz
compression library on the link line. That can be done by changing the following line in the file lib/DBD/mysql/Install.pm
:
Change that line to:
After this, you must run make realclean and then proceed with the installation from the beginning.
If Perl reports that it cannot find the ./mysql/mysql.so
module, the problem is probably that Perl cannot locate the libmysqlclient.so
shared library. You should be able to fix this problem by one of the following methods:
Compile the DBD::mysql
distribution with perl Makefile.PL -static -config
rather than perl Makefile.PL
.
Copy libmysqlclient.so
to the directory where your other shared libraries are located (probably /usr/lib
or /lib
).
Modify the -L
options used to compile DBD::mysql
to reflect the actual location of libmysqlclient.so
.
On Linux, you can add the path name of the directory where libmysqlclient.so
is located to the /etc/ld.so.conf
file.
Add the path name of the directory where libmysqlclient.so
is located to the LD_RUN_PATH
environment variable. Some systems use LD_LIBRARY_PATH
instead.
Note that you may also need to modify the -L
options if there are other libraries that the linker fails to find. For example, if the linker cannot find libc
because it is in /lib
and the link command specifies -L/usr/lib
, change the -L
option to -L/lib
or add -L/lib
to the existing link command.
If you get the following errors from DBD::mysql
, you are probably using gcc (or using an old binary compiled with gcc):
Add -L/usr/lib/gcc-lib/.. -lgcc
to the link command when the mysql.so
library gets built (check the output from make for mysql.so
when you compile the Perl client). The -L
option should specify the path name of the directory where libgcc.a
is located on your system.
Another cause of this problem may be that Perl and MySQL are not both compiled with gcc. In this case, you can solve the mismatch by compiling both with gcc.
You may see the following error from DBD::mysql
when you run the tests:
This means that you need to include the -lz
compression library on the link line. That can be done by changing the following line in the file lib/DBD/mysql/Install.pm
:
Change that line to:
After this, you must run make realclean and then proceed with the installation from the beginning.
If you want to install DBI on SCO, you have to edit the Makefile
in DBI-xxx
and each subdirectory. Note that the following assumes gcc 2.95.2 or newer:
These changes are necessary because the Perl dynaloader does not load the DBI
modules if they were compiled with icc or cc.
If you want to use the Perl module on a system that does not support dynamic linking (such as SCO), you can generate a static version of Perl that includes DBI
and DBD::mysql
. The way this works is that you generate a version of Perl with the DBI
code linked in and install it on top of your current Perl. Then you use that to build a version of Perl that additionally has the DBD
code linked in, and install that.
On SCO, you must have the following environment variables set:
Or:
First, create a Perl that includes a statically linked DBI
module by running these commands in the directory where your DBI
distribution is located:
Then, you must install the new Perl. The output of make perl indicates the exact make command you need to execute to perform the installation. On SCO, this is make -f Makefile.aperl inst_perl MAP_TARGET=perl.
Next, use the just-created Perl to create another Perl that also includes a statically linked DBD::mysql
by running these commands in the directory where your DBD::mysql
distribution is located:
Finally, you should install this new Perl. Again, the output of make perl indicates the command to use.