Hey everybody,
I'm a pretty new Mac user, but have had trouble compiling DBD::ODBC on a new Mac mini machine. I don't want to scare off any non-mac users, cause I don't think it's really a mac problem.. But I'm really stumped on this!
Background:
- Running on a Mac mini
- It's an intel chip, but seems like things are compiled with two -arch flags? i386 and ppc
- cc is a link to gcc-4.0.1
- Perl that came with leopard is 5.8.8. Activestate perl is also 5.8.8. (I can include 'perl -V' if anybody thinks that would be helpful.)
Setup:
- I got DBD::ODBC-1.15 from CPAN (same build results with 1.14 and 1.13)
- Got the libodbc library and installed it locally
- Set $ODBCHOME to that path
- Although the DBD::ODBC README says to set some other variables for data sources etc. I figured i could set those after I could build it
Problem:
When trying to compile DBD::ODBC I get error messages like:
dbdimp.c:3046: error: syntax error before '*' token
dbdimp.c:3047: error: syntax error before '*' token
dbdimp.c: In function 'S_dbOption':
dbdimp.c:3050: error: 'pars' undeclared (first use in this function)
dbdimp.c:3050: error: (Each undeclared identifier is reported only onc
+e
dbdimp.c:3050: error: for each function it appears in.)
dbdimp.c:3051: error: 'key' undeclared (first use in this function)
dbdimp.c:3051: error: 'len' undeclared (first use in this function)
then finally at the end of the build I get a lipo message about a file not existing..
I don't have ANY C experience, but this sure looks like a compiler thing to me.. The makefile is using a link cc -> gcc-4.0.1. I would have given up right there and thought that something is wrong with the gcc compiler. On a suggestion I tried installing ActivePerl for the mac machine. Tried the exact same steps and it built!!
So how can that be? Diffing the Makefile created by ActiverPerl and the leopard perl shows a lot of differences. I went through them one by one and found that when I change the leopard-perl Makefile's PERL_INC to the Activestate directory the code compiles!!
eg. PERL_INC = /System/Library/Perl/5.8.8/darwin-thread-multi-2level/CORE
to
PERL_INC = /usr/local/ActivePerl-5.8/lib/CORE
There are a lot of header files in there, so really not sure to look for the root cause..
I'm so confused? I don't understand how different header files can make syntax errors appear/disappear? Has anybody seen something like this before?
The goal is to install DBD::ODBC on leopard perl..
Thanks for any advice! :-)
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.