From ecrist at secure-computing.net Sat Nov 25 18:48:11 2006 From: ecrist at secure-computing.net (Eric F Crist) Date: Sat Nov 25 18:48:33 2006 Subject: [X-Unix] Re: [PB] Compiling on MacOS X (source was written for winblow...) [moved from PB] In-Reply-To: References: <0EB1DA94-80FF-4DF8-99F4-A6CFD6189120@secure-computing.net> Message-ID: On Nov 25, 2006, at 3:25 PM, Philip J Robar wrote: > > On Nov 25, 2006, at 1:09 PM, Eric F Crist wrote: > >> Please help me understand the following output: >> >> root# gcc *.c -o test >> /usr/bin/ld: Undefined symbols: >> _mysql_close >> _mysql_error >> _mysql_fetch_row >> _mysql_field_count >> _mysql_free_result >> _mysql_init >> _mysql_num_fields >> _mysql_num_rows >> _mysql_options >> _mysql_query >> _mysql_real_connect >> _mysql_select_db >> _mysql_store_result >> _mysql_use_result >> collect2: ld returned 1 exit status >> >> How do I fix this? > > You don't have the MySQL database installed, or at least it's > libraries are not in the default/specified location(s). Assuming > that you're trying to compile an Open Source program, it should > include a README or INSTALL file that talks about the program's > dependencies. > > By the way, a better place to ask questions like this would be the > themacintoshguy's x-unix mailing list. > > Also, if this is an Open Source program, you might also check to > see if it is supported in MacPorts, (http://www.macports.org/), > which would simplify getting, compiling, installing and resolving > dependency issues like this. > > > Phil > -- It's not an open-source project as we would know it. It's actually a world of warcraft mod that requires and .exe to parse some log files. It's written in C, and I've moved the mysql sources/includes into a location that my compiler can find, I think. It looks to me like most things are working, should I install mysql on my laptop? Thanks for the help. ----- Eric F Crist Secure Computing Networks From philip.robar at gmail.com Sat Nov 25 21:19:54 2006 From: philip.robar at gmail.com (Philip J Robar) Date: Sat Nov 25 21:20:03 2006 Subject: [X-Unix] Re: [PB] Compiling on MacOS X (source was written for winblow...) [moved from PB] In-Reply-To: References: <0EB1DA94-80FF-4DF8-99F4-A6CFD6189120@secure-computing.net> Message-ID: On Nov 25, 2006, at 6:48 PM, Eric F Crist wrote: > On Nov 25, 2006, at 3:25 PM, Philip J Robar wrote: > >> On Nov 25, 2006, at 1:09 PM, Eric F Crist wrote: >> >>> Please help me understand the following output: >>> >>> root# gcc *.c -o test >>> /usr/bin/ld: Undefined symbols: >>> ... >>> How do I fix this? >> >> .. if this is an Open Source program, >> >> It's not an open-source project as we would know it. It's actually >> a world of warcraft mod that requires and .exe to parse some log >> files. It's written in C, and I've moved the mysql sources/includes >> into a location that my compiler can find, I think. It looks to me >> like most things are working, should I install mysql on my laptop? So, as I said, you're missing a MySQL library. Libraries are binaries - just having the source and headers isn't enough. Not only that, but you need to have MySQL itself installed as the missing library is just a door to MySQL's functionality. Getting everything in place would get us even more off topic for this list then we already are so my short suggestion is to get the MySQL installer from the MySQL folks and see if that fixes the problem. If not, I notice that you work at a high tech. company, someone there ought to be able to help you with this. Otherwise send me email directly and I'll help as best I can. Phil From philip.robar at gmail.com Sat Nov 25 21:38:07 2006 From: philip.robar at gmail.com (Philip J Robar) Date: Sat Nov 25 21:38:25 2006 Subject: [X-Unix] Re: [PB] Compiling on MacOS X (source was written for winblow...) [moved from PB] In-Reply-To: References: <0EB1DA94-80FF-4DF8-99F4-A6CFD6189120@secure-computing.net> Message-ID: On Nov 25, 2006, at 6:48 PM, Eric F Crist wrote: > > On Nov 25, 2006, at 3:25 PM, Philip J Robar wrote: > >> >> On Nov 25, 2006, at 1:09 PM, Eric F Crist wrote: >> >>> Please help me understand the following output: >>> >>> root# gcc *.c -o test >>> /usr/bin/ld: Undefined symbols: >>> >>> How do I fix this? Oops, sorry I didn't notice that you have moved this to the list I suggested. Hopefully I or someone else can help you get this working. Phil From ecrist at secure-computing.net Sun Nov 26 06:44:27 2006 From: ecrist at secure-computing.net (Eric F Crist) Date: Sun Nov 26 06:44:50 2006 Subject: [X-Unix] Re: [PB] Compiling on MacOS X (source was written for winblow...) [moved from PB] In-Reply-To: References: <0EB1DA94-80FF-4DF8-99F4-A6CFD6189120@secure-computing.net> Message-ID: On Nov 25, 2006, at 11:38 PM, Philip J Robar wrote: > > On Nov 25, 2006, at 6:48 PM, Eric F Crist wrote: > >> >> On Nov 25, 2006, at 3:25 PM, Philip J Robar wrote: >> >>> >>> On Nov 25, 2006, at 1:09 PM, Eric F Crist wrote: >>> >>>> Please help me understand the following output: >>>> >>>> root# gcc *.c -o test >>>> /usr/bin/ld: Undefined symbols: >>>> >>>> How do I fix this? > > Oops, sorry I didn't notice that you have moved this to the list I > suggested. Hopefully I or someone else can help you get this working. > > Phil Ok, So I installed mysql on my Mac from fink, and I have the following files under /sw/lib/mysql: Swordfish:/sw/lib/mysql ecrist$ ls libmysqlclient.15.0.0.dylib libmysqlclient_r.15.0.0.dylib libmysqlclient.15.dylib libmysqlclient_r.15.dylib When I run the compile with the options people suggest, here's what I get: gcc *.c -o test -L/sw/lib/mysql -lmysqlclient /usr/bin/ld: can't locate file for: -lmysqlclient collect2: ld returned 1 exit status ----- Eric F Crist Secure Computing Networks From ecrist at secure-computing.net Sun Nov 26 06:55:19 2006 From: ecrist at secure-computing.net (Eric F Crist) Date: Sun Nov 26 06:55:39 2006 Subject: [X-Unix] Re: [PB] Compiling on MacOS X (source was written for winblow...) [moved from PB] In-Reply-To: References: <0EB1DA94-80FF-4DF8-99F4-A6CFD6189120@secure-computing.net> Message-ID: On Nov 26, 2006, at 8:44 AM, Eric F Crist wrote: > On Nov 25, 2006, at 11:38 PM, Philip J Robar wrote: > >> >> On Nov 25, 2006, at 6:48 PM, Eric F Crist wrote: >> >>> >>> On Nov 25, 2006, at 3:25 PM, Philip J Robar wrote: >>> >>>> >>>> On Nov 25, 2006, at 1:09 PM, Eric F Crist wrote: >>>> >>>>> Please help me understand the following output: >>>>> >>>>> root# gcc *.c -o test >>>>> /usr/bin/ld: Undefined symbols: >>>>> >>>>> How do I fix this? >> >> Oops, sorry I didn't notice that you have moved this to the list I >> suggested. Hopefully I or someone else can help you get this working. >> >> Phil > > Ok, > > So I installed mysql on my Mac from fink, and I have the following > files under /sw/lib/mysql: > > Swordfish:/sw/lib/mysql ecrist$ ls > libmysqlclient.15.0.0.dylib libmysqlclient_r.15.0.0.dylib > libmysqlclient.15.dylib libmysqlclient_r.15.dylib > > When I run the compile with the options people suggest, here's what > I get: > > gcc *.c -o test -L/sw/lib/mysql -lmysqlclient > /usr/bin/ld: can't locate file for: -lmysqlclient > collect2: ld returned 1 exit status > > > ----- > Eric F Crist > Secure Computing Networks So that some of you may see what I'm dealing with, you can download the source I'm working with at the following location: http://www.secure-computing.net/~ecrist/gts-core-src.tar All the mysql*.h files you see were put there by me to try and get this damn thing to compile. Thanks for all the help. ----- Eric F Crist Secure Computing Networks From ecrist at secure-computing.net Sun Nov 26 14:44:33 2006 From: ecrist at secure-computing.net (Eric F Crist) Date: Sun Nov 26 14:45:03 2006 Subject: [Tcbug] Re: [X-Unix] Re: [PB] Compiling on MacOS X (source was written for winblow...) [moved from PB] In-Reply-To: <200611261343.49535.josh@tcbug.org> References: <0EB1DA94-80FF-4DF8-99F4-A6CFD6189120@secure-computing.net> <200611261343.49535.josh@tcbug.org> Message-ID: <93FF4451-6B3D-4ACF-845F-E1A7B54B8943@secure-computing.net> On Nov 26, 2006, at 1:43 PM, Josh Paetzel wrote: [snip] >> So that some of you may see what I'm dealing with, you can download >> the source I'm working with at the following location: >> >> http://www.secure-computing.net/~ecrist/gts-core-src.tar >> >> All the mysql*.h files you see were put there by me to try and get >> this damn thing to compile. >> >> Thanks for all the help. >> >> ----- >> Eric F Crist >> Secure Computing Networks >> > > Well.....here's what I did to make it go. > > --- GBMuploader.c.old Sun Nov 26 13:37:44 2006 > +++ GBMuploader.c Sun Nov 26 13:38:35 2006 > @@ -10,7 +10,9 @@ > #include > #include > #include > -#include "mysql.h" > +#include > +#include > +#include > > //banker structure > struct banker { > > and then.... > > # gcc -o > test -L/usr/local/lib/mysql -lmysqlclient -lz -lcrypt -lm -I/usr/ > local/include/mysql > *.c > > mysql_config --cflags and mysql_config --libs are handy little tools > for determining what sorts of goo you need to compile stuff that > includes mysql stuffs. > > -- > Thanks, > > Josh Paetzel Is this going to work on Mac OS X? ----- Eric F Crist Secure Computing Networks From ecrist at secure-computing.net Sun Nov 26 16:34:02 2006 From: ecrist at secure-computing.net (Eric F Crist) Date: Sun Nov 26 16:34:29 2006 Subject: [Tcbug] Re: [X-Unix] Re: [PB] Compiling on MacOS X (source was written for winblow...) [moved from PB] In-Reply-To: <93FF4451-6B3D-4ACF-845F-E1A7B54B8943@secure-computing.net> References: <0EB1DA94-80FF-4DF8-99F4-A6CFD6189120@secure-computing.net> <200611261343.49535.josh@tcbug.org> <93FF4451-6B3D-4ACF-845F-E1A7B54B8943@secure-computing.net> Message-ID: <3D70E53F-80F5-449A-8C98-13368745958F@secure-computing.net> On Nov 26, 2006, at 4:44 PM, Eric F Crist wrote: > On Nov 26, 2006, at 1:43 PM, Josh Paetzel wrote: > > [snip] > >>> So that some of you may see what I'm dealing with, you can download >>> the source I'm working with at the following location: >>> >>> http://www.secure-computing.net/~ecrist/gts-core-src.tar >>> >>> All the mysql*.h files you see were put there by me to try and get >>> this damn thing to compile. >>> >>> Thanks for all the help. >>> >>> ----- >>> Eric F Crist >>> Secure Computing Networks >>> >> >> Well.....here's what I did to make it go. >> >> --- GBMuploader.c.old Sun Nov 26 13:37:44 2006 >> +++ GBMuploader.c Sun Nov 26 13:38:35 2006 >> @@ -10,7 +10,9 @@ >> #include >> #include >> #include >> -#include "mysql.h" >> +#include >> +#include >> +#include >> >> //banker structure >> struct banker { >> >> and then.... >> >> # gcc -o >> test -L/usr/local/lib/mysql -lmysqlclient -lz -lcrypt -lm -I/usr/ >> local/include/mysql >> *.c >> >> mysql_config --cflags and mysql_config --libs are handy little tools >> for determining what sorts of goo you need to compile stuff that >> includes mysql stuffs. >> >> -- >> Thanks, >> >> Josh Paetzel > > Is this going to work on Mac OS X? > > ----- > Eric F Crist > Secure Computing Networks Here's what I did on Mac OS X: 1) copied the entirety of mysql's include directory to my build directory on my local machine. Then, I typed the following and got the posted results: Swordfish:/Applications/World of Warcraft/Interface/AddOns/GTS_Core/ apps/src ecrist$ gcc -o test -L/sw/lib/mysql -lmysqlclient -lz - lcrypt -lm -I/Applications/World\ of\ Warcraft/Interface/AddOns/ GTS_Core/apps/src *.c /usr/bin/ld: can't locate file for: -lmysqlclient collect2: ld returned 1 exit status Swordfish:/Applications/World of Warcraft/Interface/AddOns/GTS_Core/ apps/src ecrist$ I think we're making headway. ----- Eric F Crist Secure Computing Networks From ecrist at secure-computing.net Sun Nov 26 16:49:23 2006 From: ecrist at secure-computing.net (Eric F Crist) Date: Sun Nov 26 16:50:09 2006 Subject: [Tcbug] Re: [X-Unix] Re: [PB] Compiling on MacOS X (source was written for winblow...) [moved from PB] In-Reply-To: <456A34EA.8030902@scruss.com> References: <0EB1DA94-80FF-4DF8-99F4-A6CFD6189120@secure-computing.net> <200611261343.49535.josh@tcbug.org> <93FF4451-6B3D-4ACF-845F-E1A7B54B8943@secure-computing.net> <3D70E53F-80F5-449A-8C98-13368745958F@secure-computing.net> <456A34EA.8030902@scruss.com> Message-ID: On Nov 26, 2006, at 6:44 PM, Stewart C. Russell wrote: > Just a thought -- do you have the mysql-dev package installed? > > Stewart No, but I finally installed the Mac OS X package available on the MySQL site, and I get the results I saw at the beginning, once all the files are put in their right place: Swordfish:/Applications/World of Warcraft/Interface/AddOns/GTS_Core/ apps/src ecrist$ gcc -o test -L/usr/local/mysql/lib -lmysqlclient -I/ usr/local/mysql/include *.c /usr/bin/ld: Undefined symbols: _mysql_close _mysql_error _mysql_fetch_row _mysql_field_count _mysql_free_result _mysql_init _mysql_num_fields _mysql_num_rows _mysql_options _mysql_query _mysql_real_connect _mysql_select_db _mysql_store_result _mysql_use_result collect2: ld returned 1 exit status Swordfish:/Applications/World of Warcraft/Interface/AddOns/GTS_Core/ apps/src ecrist$ This is with the Mac OS X package from MySQL.org installed, with all the includes/etc. ----- Eric F Crist Secure Computing Networks From jerry at ieee.org Tue Nov 28 11:42:54 2006 From: jerry at ieee.org (Jerry Krinock) Date: Tue Nov 28 11:43:04 2006 Subject: [X-Unix] Stop Terminal truncating stdout to window width? Message-ID: Whenever I a run a command which produces stdout wider than the window, it gets truncated immediately. For example, say I'm trying to find a process named "myProcess" ps -alx | grep myProcess If I save this in a .command script, give it to someone and they run it, myProcess is usually not found because the ps stdout will be longer than 80 characters, and some not-so-smart ass decided to truncate this to the Terminal window width, ^before^ it even gets piped to grep. If the user then make the window wider and re-runs the command, it works. ARGGGHHH!!!! I've been searching without success for a way to change this infantile behavior. Seems like it should be an environment variable of some kind. Is there? Jerry Krinock From simon-lists at ldml.com Tue Nov 28 11:59:08 2006 From: simon-lists at ldml.com (Simon Forster) Date: Tue Nov 28 11:59:30 2006 Subject: [X-Unix] Stop Terminal truncating stdout to window width? In-Reply-To: References: Message-ID: On 28 Nov 2006, at 19:42, Jerry Krinock wrote: > ps -alx | grep myProcess > I've been searching without success for a way to change this infantile > behavior. Seems like it should be an environment variable of some > kind. Is > there? www. As in ps -alxwww. Actually, you probably don't need that many Ws but hey, who cares! HTH Simon Forster _______________________________________________________ LDML Ltd, 62 Pall Mall, London, SW1Y 5HZ, UK Tel: +44 (0)20 8133 0528 Fax: +44 (0)70 9230 5247 _______________________________________________________ From rossman at columbia.edu Tue Nov 28 12:31:55 2006 From: rossman at columbia.edu (rossman@columbia.edu) Date: Tue Nov 28 12:32:19 2006 Subject: [X-Unix] Stop Terminal truncating stdout to window width? In-Reply-To: References: Message-ID: <1164745915.456c9cbbb84e6@cubmail.cc.columbia.edu> Its 'ps' that is doing the not-so-smart ass truncations. Try "ps -alxww" Quoting Jerry Krinock : > Whenever I a run a command which produces stdout wider than the > window, it gets truncated immediately. For example, say I'm > trying to find a process named "myProcess" > > ps -alx | grep myProcess > > If I save this in a .command script, give it to someone and they > run it, myProcess is usually not found because the ps stdout > will be longer than 80 characters, and some not-so-smart ass > decided to truncate this to the Terminal window width, ^before^ > it even gets piped to grep. If the user then make the window > wider and re-runs the command, it works. ARGGGHHH!!!! > > I've been searching without success for a way to change this > infantile behavior. Seems like it should be an environment > variable of some kind. Is there?