Cocos2d-x build error windows eclipse - cocos2d-x

I am developing an android 2d game using cocos2d-x. I have imported a sample project in eclipse but when i tried to build it, it gives me an error:
Build of configuration Default for project HelloCpp **
bash E:/zAndroid/cocos2d-x-2.2/samples/Cpp/HelloCpp/proj.android/build_native.sh -k
E:/zAndroid/cocos2d-x-2.2/samples/Cpp/HelloCpp/proj.android/build_native.sh: illegal option -- k
NDK_ROOT = E:\zAndroid\android-ndk-r9b
COCOS2DX_ROOT = /e/zAndroid/cocos2d-x-2.2/samples/Cpp/HelloCpp/proj.android/../../../..
APP_ROOT = /e/zAndroid/cocos2d-x-2.2/samples/Cpp/HelloCpp/proj.android/..
APP_ANDROID_ROOT = /e/zAndroid/cocos2d-x-2.2/samples/Cpp/HelloCpp/proj.android
Using prebuilt externals
+ 'E:\zAndroid\android-ndk-r9b/ndk-build' -C /e/zAndroid/cocos2d-x-2.2/samples/Cpp/HelloCpp/proj.android -k NDK_MODULE_PATH=/e/zAndroid/cocos2d-x-2.2/samples/Cpp/HelloCpp/proj.android/../../../..:/e/zAndroid/cocos2d-x-2.2/samples/Cpp/HelloCpp/proj.android/../../../../cocos2dx/platform/third_party/android/prebuilt
make: Entering directory '/cygdrive/e/zAndroid/cocos2d-x-2.2/samples/Cpp/HelloCpp/proj.android'
"C:/program files/git/bin/rm.exe": cannot unlink `NUL': Invalid argument
Android NDK: WARNING: Ignoring unknown import directory: e
Android NDK: WARNING: Ignoring unknown import directory: \zAndroid\cocos2d-x-2.2;e
Android NDK: WARNING: Ignoring unknown import directory: \zAndroid\cocos2d-x-2.2\cocos2dx\platform\third_party\android\prebuilt
e:/zAndroid/android-ndk-r9b/build/core/prebuilt-library.mk:68: * target pattern contains no '%'. Stop.
make: Leaving directory '/cygdrive/e/zAndroid/cocos2d-x-2.2/samples/Cpp/HelloCpp/proj.android'
Build Finished **

Computer --> properties --> Advanced system settings --> Environment Variables.. --> Path( in System variables ) you need remove "C:/program files/git/bin"
Good luck.

Related

why does installing imblearn with pip is failing?

I am trying to install the python package "imblearn" to balanace datasets,
with the command pip install imblearn.
but it keeps failing.
trying from cmdand from PowerShell with admin privileges,
with regular pip command, and with git clone to the repo and then pip install.
everything is failing.
the error is:
C:\Users\ronke>pip install imblearn
Collecting imblearn
Using cached imblearn-0.0-py2.py3-none-any.whl (1.9 kB)
Collecting imbalanced-learn
Using cached imbalanced_learn-0.10.1-py3-none-any.whl (226 kB)
Requirement already satisfied: scipy>=1.3.2 in c:\networks\python3.8\lib\site-packages (from imbalanced-learn->imblearn) (1.6.3)
Collecting scikit-learn>=1.0.2
Using cached scikit-learn-1.2.0.tar.gz (7.2 MB)
Installing build dependencies ... error
error: subprocess-exited-with-error
× pip subprocess to install build dependencies did not run successfully.
│ exit code: 1
╰─> [73 lines of output]
Ignoring numpy: markers 'python_version == "3.10" and platform_system == "Windows" and platform_python_implementation != "PyPy"' don't match your environment
Collecting setuptools<60.0
Using cached setuptools-59.8.0-py3-none-any.whl (952 kB)
Collecting wheel
Using cached wheel-0.38.4-py3-none-any.whl (36 kB)
Collecting Cython>=0.29.24
Using cached Cython-0.29.32-py2.py3-none-any.whl (986 kB)
Collecting oldest-supported-numpy
Using cached oldest_supported_numpy-2022.11.19-py3-none-any.whl (4.9 kB)
Collecting scipy>=1.3.2
Using cached scipy-1.9.3.tar.gz (42.1 MB)
Installing build dependencies: started
Installing build dependencies: finished with status 'done'
Getting requirements to build wheel: started
Getting requirements to build wheel: finished with status 'done'
Installing backend dependencies: started
Installing backend dependencies: finished with status 'done'
Preparing metadata (pyproject.toml): started
Preparing metadata (pyproject.toml): finished with status 'error'
error: subprocess-exited-with-error
Preparing metadata (pyproject.toml) did not run successfully.
exit code: 1
[37 lines of output]
+ meson setup --prefix=c:\networks\python3.8 C:\Users\ronke\AppData\Local\Temp\pip-install-n9p_hxtm\scipy_cef72cd617894d719469ea6e03d892cb C:\Users\ronke\AppData\Local\Temp\pip-install-n9p_hxtm\scipy_cef72cd617894d719469ea6e03d892cb\.mesonpy-jv80z8m8\build --native-file=C:\Users\ronke\AppData\Local\Temp\pip-install-n9p_hxtm\scipy_cef72cd617894d719469ea6e03d892cb\.mesonpy-native-file.ini -Ddebug=false -Doptimization=2
The Meson build system
Version: 1.0.0
Source dir: C:\Users\ronke\AppData\Local\Temp\pip-install-n9p_hxtm\scipy_cef72cd617894d719469ea6e03d892cb
Build dir: C:\Users\ronke\AppData\Local\Temp\pip-install-n9p_hxtm\scipy_cef72cd617894d719469ea6e03d892cb\.mesonpy-jv80z8m8\build
Build type: native build
Project name: SciPy
Project version: 1.9.3
Activating VS 17.1.3
C compiler for the host machine: cl (msvc 19.31.31105 "Microsoft (R) C/C++ Optimizing Compiler Version 19.31.31105 for x64")
C linker for the host machine: link link 14.31.31105.0
C++ compiler for the host machine: cl (msvc 19.31.31105 "Microsoft (R) C/C++ Optimizing Compiler Version 19.31.31105 for x64")
C++ linker for the host machine: link link 14.31.31105.0
Host machine cpu family: x86_64
Host machine cpu: x86_64
Compiler for C supports arguments -Wno-unused-but-set-variable: NO
Compiler for C supports arguments -Wno-unused-but-set-variable: NO (cached)
Compiler for C supports arguments -Wno-unused-function: NO
Compiler for C supports arguments -Wno-conversion: NO
Compiler for C supports arguments -Wno-misleading-indentation: NO
Compiler for C supports arguments -Wno-incompatible-pointer-types: NO
Library m found: NO
..\..\meson.build:57:0: ERROR: Unknown compiler(s): [['ifort'], ['gfortran'], ['flang'], ['pgfortran'], ['g95']]
The following exception(s) were encountered:
Running `ifort --version` gave "[WinError 2] The system cannot find the file specified"
Running `ifort -V` gave "[WinError 2] The system cannot find the file specified"
Running `gfortran --version` gave "[WinError 2] The system cannot find the file specified"
Running `gfortran -V` gave "[WinError 2] The system cannot find the file specified"
Running `flang --version` gave "[WinError 2] The system cannot find the file specified"
Running `flang -V` gave "[WinError 2] The system cannot find the file specified"
Running `pgfortran --version` gave "[WinError 2] The system cannot find the file specified"
Running `pgfortran -V` gave "[WinError 2] The system cannot find the file specified"
Running `g95 --version` gave "[WinError 2] The system cannot find the file specified"
Running `g95 -V` gave "[WinError 2] The system cannot find the file specified"
A full log can be found at C:\Users\ronke\AppData\Local\Temp\pip-install-n9p_hxtm\scipy_cef72cd617894d719469ea6e03d892cb\.mesonpy-jv80z8m8\build\meson-logs\meson-log.txt
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed
Encountered error while generating package metadata.
See above for output.
note: This is an issue with the package mentioned above, not pip.
hint: See above for details.
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error
× pip subprocess to install build dependencies did not run successfully.
│ exit code: 1
╰─> See above for output.
note: This error originates from a subprocess, and is likely not a problem with pip.
Does someone know how to fix it?
thanks
Ron
I've condensed this to show the key part of the error:
Collecting scipy>=1.3.2
Using cached scipy-1.9.3.tar.gz (42.1 MB)
...
..\..\meson.build:57:0: ERROR: Unknown compiler(s): [['ifort'], ['gfortran'], ['flang'], ['pgfortran'], ['g95']]
Which is saying that scipy==1.9.3 failed to compile because a Fortran compiler was not availalbe.
This is probably caused by a 32-bit version of Python / Windows, since pre-compiled scipy and scikit-learn wheels are being phased out for 32-bit systems, and we're no longer testing 32-bit Windows in imblearn (see PR#936).
One possible fix is to install a copy of Python with Anaconda or Miniconda, then:
conda install -c conda-forge imbalanced-learn

Unable to install couchbase in python on macOs

I am trying to install couchbase on my macOS. I am using pip3 install couchbase to install it.
And I am getting error as
`note: '__uint128_t' declared here
/Library/Developer/C
ommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/sys/_types.h:76:9: error: unknown type name '__uint32_t'; did you mean '__uint128_t'?
typedef __uint32_t __darwin_useconds_t; /* [???] microseconds */
^
note: '__uint128_t' declared here
In file included from src/bucket.c:18:
In file included from src/pycbc.h:45:
In file included from src/python_wrappers.h:20:
In file included from /Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/include/python3.8/Python.h:25:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/stdio.h:64:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/_stdio.h:71:
/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/_types.h:43:9: error: unknown type name '__uint32_t'; did you mean '__uint128_t'?
typedef __uint32_t __darwin_wctype_t;
^
note: '__uint128_t' declared here
In file included from src/bucket.c:18:
In file included from src/pycbc.h:45:
In file included from src/python_wrappers.h:20:
In file included from /Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/include/python3.8/Python.h:25:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/stdio.h:64:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/_stdio.h:75:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/sys/_types/_va_list.h:31:
/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/machine/types.h:37:2: error: architecture not supported
#error architecture not supported
^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
/private/tmp/pip-install-46t38raq/couchbase_25d29b67ce814e2badeb9f2deaba5d2c/cbuild_config.py:271: UserWarning: Adding /usr/local to lib search path for OS X
warnings.warn('Adding /usr/local to lib search path for OS X')
error: command 'clang' failed with exit status 1
----------------------------------------
ERROR: Failed building wheel for couchbase Failed to build couchbase
ERROR: Could not build wheels for couchbase which use PEP 517 and cannot be installed directly
I also tried pip3 install --no-use-pep517 couchbase then also I am getting could not build a wheel for couchbase
I have upgraded my pip to the latest. I have python3.8. I also installed pep517.

Error Compiling cocos2d-x 3.14.1 for Android Studio : Android NDK: jni/Android.mk: Cannot find module with tag ‘cocos’ in import path

I'm trying to run cpp-test example project, which is packed in the cocos2d-x 3.14.1 download, on Android Studio. I'm following this tutorial : http://www.cocos2d-x.org/docs/installation/Android-Studio/, which requires complete this first: http://www.cocos2d-x.org/docs/installation/Android-terminal/index.html.
However, I got error when run
python android-build.py -p 22 cpp-tests:
I got this log from cmd :
Android NDK: WARNING: APP_PLATFORM android-22 is larger than android:minSdkVersi
on 9 in ./AndroidManifest.xml
Android NDK: WARNING: Ignoring unknown import directory: D:\cocos2d-x-3.14.1
Android NDK: jni/Android.mk: Cannot find module with tag 'cocos' in import path
Android NDK: Are you sure your NDK_MODULE_PATH variable is properly defined ?
Android NDK: The following directories were searched:
Android NDK:
make: Entering directory `D:/cocos2d-x-3.14.1/tests/cpp-tests/proj.android'
jni/Android.mk:170: *** Android NDK: Aborting. . Stop.
make: Leaving directory `D:/cocos2d-x-3.14.1/tests/cpp-tests/proj.android'
Error running command, return code: 2.
Build dynamic library for project [ D:\cocos2d-x-3.14.1\build\..\tests\cpp-tests
] failed!
I tried another way to compile the project for Android Studio following Sonar Systems's tutorial here: https://www.youtube.com/watch?v=gdOkbXYsf04 . And I got the same error.
Android NDK: WARNING: Ignoring unknown import directory: D:\cocos2d-x-3.14.1
Android NDK: jni/Android.mk: Cannot find module with tag 'cocos' in import path
Android NDK: Are you sure your NDK_MODULE_PATH variable is properly defined ?
Android NDK: The following directories were searched:
Android NDK:
make: Entering directory `D:/cocos2d-x-3.14.1/tests/cpp-tests/proj.android-studi
o/app'
jni/Android.mk:170: *** Android NDK: Aborting. . Stop.
make: Leaving directory `D:/cocos2d-x-3.14.1/tests/cpp-tests/proj.android-studio
/app'
Error running command, return code: 2.
A part of the Android.mk file of the example project:
../../../Classes/SpriteFrameCacheTest/SpriteFrameCacheTest.cpp \
../../../Classes/controller.cpp \
../../../Classes/testBasic.cpp
LOCAL_C_INCLUDES := $(LOCAL_PATH)/../../../Classes \
$(LOCAL_PATH)/../../../../..
LOCAL_STATIC_LIBRARIES := cocos2dx_static
include $(BUILD_SHARED_LIBRARY)
$(call import-module,cocos)
I'm using:
Windows 7
Android Studio 2.2.3.
Cocos2d-x 3.14.1
Python 2.7.13
Ant 1.10.1
NDK r13b
Any solution for this please?
Hmm, it seems you are not reading the errors
First:
Android NDK: WARNING: Ignoring unknown import directory:
D:\cocos2d-x-3.14.1
Android NDK: jni/Android.mk: Cannot find module with tag 'cocos' in
import path
Android NDK: Are you sure your NDK_MODULE_PATH variable is properly
defined ?
Android NDK: The following directories were searched: Android NDK:
You must setup cocos properly - run setup.py , and make sure your Android NDK path is pointing to the right directory. Likewise make sure ANT and Python are in the right directories.
Second:
Android NDK: WARNING: APP_PLATFORM android-22 is larger than
android:minSdkVersi on 9 in ./AndroidManifest.xml
Either change the platform, or the minimum sdk...
If you do not even read the errors, how can you possibly solve your problem.... Bye! :D

Makefile Error after adding C mysql libs Eclipse CDT

I'm using Eclipse Juno CDT.
I added the following to my project:
the mysql/includes path to the includes path setting
the libmysql.lib and zlib.lib to libraries setting
the mysql library path to the library paths setting
Now, when I make my project, the compilation throws an error when I run the application.
This is the build:
10:08:56 **** Build of configuration Debug for project mysqlapp ****
make all
Building file: ../src/mysqlapp.c
Invoking: Cygwin C Compiler
gcc -I"C:\Program Files\MySQL\MySQL Connector C 6.0.2\include" -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"src/mysqlapp.d" -MT"src/mysqlapp.d" -o "src/mysqlapp.o" "../src/mysqlapp.c"
cygwin warning:
MS-DOS style path detected: C:\Users\Yonaton\workspace\mysqlapp\Debug
Preferred POSIX equivalent is: /cygdrive/c/Users/Yonaton/workspace/mysqlapp/Debug
CYGWIN environment variable option "nodosfilewarning" turns off this warning.
Consult the user's guide for more details about POSIX paths:
http://cygwin.com/cygwin-ug-net/using.html#using-pathnames
Finished building: ../src/mysqlapp.c
Building target: mysqlapp.exe
Invoking: Cygwin C Linker
gcc -L"C:\Program Files\MySQL\MySQL Connector C 6.0.2\lib\opt" -o "mysqlapp.exe" ./src/mysqlapp.o
Finished building target: mysqlapp.exe
And this is the run within eclipse:
10:09:55 **** Incremental Build of configuration Debug for project mysqlapp ****
make all
src/mysqlapp.d:1: *** multiple target patterns. Stop.
10:09:56 Build Finished (took 225ms)
Under Project->Properties->C/C++ General->Paths and Symbols->Libraries do not add the file name of the library, nor the path.
So if you want to link against /lib64/libz.so just add z.
Or alternativly add the z under Project->Properties->C/C++ Build->Settings->GCC Linker->Libraries.
If the library is not located under a standard path add the custom search path for a library under Project->Properties->C/C++ General->Paths and Symbols->Libraries Paths.
Update (referring "multiple target patterns"):
make does not like DOS paths. In the .d file a : after the drive letter is interpreted as target delimiter.
Switch to UNIX paths (as you were already told to do ... ;-)).
(see also: "multiple target patterns" Makefile error)
If I remember correctly "-l" ( small L) before your libraries.

Installation error for DBD::MySQL on OSX v10.6.6

I'm attempting to get DBD::MySQL working on Snow Leopard (v10.6.6). The default version of Perl that comes with the OS is v5.10.0. Since I've read that's 64-bit, I went ahead and downloaded and installed a 64-bit version of MySQL (mysql-5.5.8-osx10.6-x86_64).
Installing and setting up MySQL went smoothly, here's my config and version number for reference.
I used CPAN to download DBI and the DBD::MySQL drivers. I then:
Installed DBI
Setup a Makefile.PL
Ran the make command from the command line
The Makefile.PL said it would use the following settings for compiling and testing:
I will use the following settings for compiling and testing:
cflags (mysql_config ) = -I/usr/local/mysql/include -Os -g -fno-common -fno-strict-aliasing -arch x86_64
embedded (mysql_config ) =
libs (mysql_config ) = -L/usr/local/mysql/lib -lmysqlclient -lpthread
mysql_config (guessed ) = mysql_config
nocatchstderr (default ) = 0
nofoundrows (default ) = 0
ssl (guessed ) = 0
testdb (default ) = test
testhost (default ) =
testpassword (User's choice) = r00t!
testsocket (default ) =
testuser (User's choice) = root
To change these settings, see 'perl Makefile.PL --help' and
'perldoc INSTALL'.
Multiple copies of Driver.xst found in: /Library/Perl/5.10.0/darwin-thread-multi-2level/auto/DBI/ /System/Library/Perl/Extras/5.10.0/darwin-thread-multi-2level/auto/DBI/ at Makefile.PL line 907
Using DBI 1.616 (for perl 5.010000 on darwin-thread-multi-2level) installed in /Library/Perl/5.10.0/darwin-thread-multi-2level/auto/DBI/
Writing Makefile for DBD::mysql
Everything seemed to be going fine, until I tried to run make test :
t/00base....................NOK 2/6# Tried to use 'DBD::mysql'.
# Error: Can't load '/Users/swm/.cpan/build/DBD-mysql-4.018-Pnd2qz/blib/arch/auto/DBD/mysql/mysql.bundle' for module DBD::mysql: dlopen(/Users/swm/.cpan/build/DBD-mysql-4.018-Pnd2qz/blib/arch/auto/DBD/mysql/mysql.bundle, 2): Library not loaded: libmysqlclient.16.dylib
# Referenced from: /Users/swm/.cpan/build/DBD-mysql-4.018-Pnd2qz/blib/arch/auto/DBD/mysql/mysql.bundle
# Reason: image not found at /System/Library/Perl/5.10.0/darwin-thread-multi-2level/DynaLoader.pm line 207.
# at (eval 7) line 2
# Compilation failed in require at (eval 7) line 2.
# BEGIN failed--compilation aborted at (eval 7) line 2.
FAILED--Further testing stopped: Unable to load DBD::mysql
make: *** [test_dynamic] Error 9
It's failing because it can't seem to find the mysql.bundle for DBD. Has anyone come across this problem? Or can point me in the right direction on what to try next? I need DBI/DBD::MySQL for my new job and I'm scrambling to find a solution.
Many thanks in advance.
I got around the "Library not loaded: libmysqlclient.16.dylib" problem by placing a symbolic link in /usr/lib/" to /usr/local/mysql-5.5.8-osx10.6-x86_64/lib/libmysqlclient.16.dylib
I worked around the same or a similar issue. Somehow I could build and test DBD::mysql with cpan but when I tried to use it in a script it said things like
dyld: lazy symbol binding failed: Symbol not found: _mysql_init
Referenced from: /Library/Perl/5.10.0/darwin-thread-multi-2level/auto/DBD/mysql/mysql.bundle
Expected in: flat namespace
Apparently, it's a 64-bit vs 32-bit issue.
Installing the fink dbd-mysql-pm5100 package made it work though it took kind of a long time. I also removed the cpan-installed version:
sudo rm -rf /Library/Perl/5.10.0/darwin-thread-multi-2level/auto/DBD/mysql
sudo rm -rf /Library/Perl/5.10.0/darwin-thread-multi-2level/DBD/mysql
sudo rm -rf /Library/Perl/5.10.0/darwin-thread-multi-2level/DBD/mysql.pm
also include in .profile
export VERSIONER_PERL_PREFER_32_BIT=yes;
Besides creating the link the executions of the program with DBI::mysql generated an error, thus including this variable on the environment make it works
I know this is an old post. But I suppose the best solution would be to add the library directory to the DYLD_FALLBACK_LIBRARY_PATH env variable. (reason here: https://stackoverflow.com/a/3172515/119958 )
There is no ldconfig in mac, so just add the path to this env var and rerun the install process for DBD::mysql
Donato-Vianas-MacBook-Pro:Invoicer donato$ cpanm DBD::mysql
--> Working on DBD::mysql
Fetching http://www.cpan.org/authors/id/C/CA/CAPTTOFU/DBD-mysql-4.022.tar.gz ... OK
Configuring DBD-mysql-4.022 ... OK
Building and testing DBD-mysql-4.022 ... FAIL
! Installing DBD::mysql failed. See /Users/donato/.cpanm/build.log for details.
# Failed test 'use DBD::mysql;'
# at t/00base.t line 21.
# Tried to use 'DBD::mysql'.
# Error: Can't load '/Users/donato/.cpanm/work/1359948144.491/DBD-mysql-4.022/blib/arch/auto/DBD/mysql/mysql.bundle' for module DBD::mysql: dlopen(/Users/donato/.cpanm/work/1359948144.491/DBD-mysql-4.022/blib/arch/auto/DBD/mysql/mysql.bundle, 2): Library not loaded: libmysqlclient.18.dylib
Donato-Vianas-MacBook-Pro:Invoicer donato$ export DYLD_FALLBACK_LIBRARY_PATH=/usr/local/mysql/lib/:$DYLD_FALLBACK_LIBRARY_PATH
Donato-Vianas-MacBook-Pro:Invoicer donato$ cpanm DBD::mysql--> Working on DBD::mysql
Fetching http://www.cpan.org/authors/id/C/CA/CAPTTOFU/DBD-mysql-4.022.tar.gz ... OK
Configuring DBD-mysql-4.022 ... OK
Building and testing DBD-mysql-4.022 ... OK
Successfully installed DBD-mysql-4.022
1 distribution installed
Donato's solution works for install, but the var has to be present at runtime as well or I get the same error. The following fixes this at runtime for shell and _www user:
# For command line use, add following line to ~/.bash_profile:
export DYLD_FALLBACK_LIBRARY_PATH=/usr/local/mysql/lib/:$DYLD_FALLBACK_LIBRARY_PATH
# If Apache needs it, add following line to /etc/apache2/httpd.conf:
# On Lion Server, I put it after <IfDefine MACOSXSERVER>, but shouldn't matter
SetEnv DYLD_FALLBACK_LIBRARY_PATH /usr/local/mysql/lib/:$DYLD_FALLBACK_LIBRARY_PATH
It's somewhat of an aside, but I strongly recommend setting up a separate perl on the machine -- either by fink / macports, or from source -- and leaving the Mac's system perl (and its libraries) alone.
Once I did this on my own Mac, I had very few troubles installing modules thereafter, and I didn't have to worry about accidentally blowing a hole in my OS by breaking the perl that the system uses.
If it were my Mac, I'd install a new perl from source (the Perl source distribution is smart enough to install itself see that it's on a Mac and install itself safely into /usr/local/bin) and the proceed from thee to install DBD::Mysql (and the other modules you require).