PennMUSH Community

Ticket #7408 (new build problems)

Opened 1 year ago

Last modified 8 months ago

SQL compilation problems with 1.8.3p4

Reported by: ray73864 Assigned to:
Priority: major Milestone:
Keywords: Cc:
Visibility: Public

Description

ok, so i patched up from p2 to p3 using the correct patch file (when i originally went from p1 to p2 i used the raevnos re-released one), then i went from p3 to p4, now i get the following problem when trying to compile p4:

gcc -std=gnu99 -ggdb -O -W -Wall -pedantic -Wno-comment -I/usr/include/ -I.. -I../hdrs -c -o sql.o sql.c sql.c:39:19: error: mysql.h: No such file or directory sql.c:40:20: error: errmsg.h: No such file or directory sql.c:41: error: expected â=â, â,â, â;â, âasmâ or âattributeâ before â*â token sql.c:84: error: expected â=â, â,â, â;â, âasmâ or âattributeâ before â*â token sql.c:85: error: expected â)â before â*â token sql.c: In function âsql_errorâ: sql.c:184: warning: implicit declaration of function âmysql_errorâ sql.c:184: error: âmysql_connpâ undeclared (first use in this function) sql.c:184: error: (Each undeclared identifier is reported only once sql.c:184: error: for each function it appears in.) sql.c:184: warning: return makes pointer from integer without a cast sql.c: In function âfree_sql_queryâ: sql.c:231: warning: implicit declaration of function âpenn_mysql_free_sql_queryâ sql.c:231: error: âMYSQL_RESâ undeclared (first use in this function) sql.c:231: error: expected expression before â)â token sql.c: In function âsql_queryâ: sql.c:256: warning: implicit declaration of function âpenn_mysql_sql_queryâ sql.c:256: warning: return makes pointer from integer without a cast sql.c: In function âfun_sql_escapeâ: sql.c:299: warning: implicit declaration of function âmysql_real_escape_stringâ sql.c:299: error: âmysql_connpâ undeclared (first use in this function) sql.c:312: warning: implicit declaration of function âmysql_escape_stringâ sql.c: In function âcmd_sqlâ: sql.c:329: error: âMYSQL_FIELDâ undeclared (first use in this function) sql.c:329: error: âfieldsâ undeclared (first use in this function) sql.c:360: warning: implicit declaration of function âmysql_affected_rowsâ sql.c:360: error: âmysql_connpâ undeclared (first use in this function) sql.c:361: warning: implicit declaration of function âmysql_num_fieldsâ sql.c:364: warning: implicit declaration of function âmysql_fetch_fieldsâ sql.c:385: error: âMYSQL_ROWâ undeclared (first use in this function) sql.c:385: error: expected â;â before ârow_pâ sql.c:387: error: ârow_pâ undeclared (first use in this function) sql.c:387: warning: implicit declaration of function âmysql_fetch_rowâ sql.c: In function âfun_mapsqlâ: sql.c:479: error: âMYSQL_FIELDâ undeclared (first use in this function) sql.c:479: error: âfieldsâ undeclared (first use in this function) sql.c:570: error: âMYSQL_ROWâ undeclared (first use in this function) sql.c:570: error: expected â;â before ârow_pâ sql.c:572: error: ârow_pâ undeclared (first use in this function) sql.c: In function âfun_sqlâ: sql.c:708: error: âMYSQL_ROWâ undeclared (first use in this function) sql.c:708: error: expected â;â before ârow_pâ sql.c:710: error: ârow_pâ undeclared (first use in this function) sql.c: In function âpenn_mysql_sql_shutdownâ: sql.c:786: error: âmysql_connpâ undeclared (first use in this function) sql.c:788: warning: implicit declaration of function âmysql_closeâ sql.c: In function âpenn_mysql_sql_connectedâ: sql.c:795: error: âmysql_connpâ undeclared (first use in this function) sql.c: In function âpenn_mysql_sql_initâ: sql.c:829: error: âmysql_connpâ undeclared (first use in this function) sql.c:833: warning: implicit declaration of function âmysql_initâ sql.c:836: warning: implicit declaration of function âmysql_real_connectâ sql.c:838: warning: format â%sâ expects type âchar *â, but argument 3 has type âintâ sql.c: At top level: sql.c:848: error: expected â=â, â,â, â;â, âasmâ or âattributeâ before â*â token sql.c:902: error: expected â)â before â*â token make[1]: *** [sql.o] Error 1 make[1]: Leaving directory `/home/ray73864/dev/src' make: *** [all] Error 2

for some reason it can't find the MySQL stuff yet that stuff has not moved, also, the Makefile.in and Makefile both have the following:

# - System configuration - #

VERSION=1.8.3 PATCHLEVEL=3

yet i am running 1.8.3p4 (or at least trying to).

Change History

07/10/07 09:21:54 changed by intrevis

Were there any rejected hunks when you applied the patch?

(in reply to: ↑ description ) 07/10/07 11:08:29 changed by raevnos

Replying to ray73864:

> gcc -std=gnu99 -ggdb -O -W -Wall -pedantic -Wno-comment -I/usr/include/ -I.. -I../hdrs     -c -o sql.o sql.c
> sql.c:39:19: error: mysql.h: No such file or directory
> sql.c:40:20: error: errmsg.h: No such file or directory

What do 'mysql_config --cflags' and 'mysql_config --libs' print out?

(follow-up: ↓ 4 ) 07/10/07 15:06:15 changed by ray73864

nope, no rejected hunks at all.

mysql_config --cflags comes back with '-I/usr/include/mysql -DBIG_JOINS=1'

mysql_config --libs comes back with '-L/usr/lib/mysql -lmysqlclient'

(in reply to: ↑ 3 ) 07/11/07 00:48:33 changed by raevnos

  • type changed from incoming to build problems.

Replying to ray73864:

nope, no rejected hunks at all. mysql_config --cflags comes back with '-I/usr/include/mysql -DBIG_JOINS=1' mysql_config --libs comes back with '-L/usr/lib/mysql -lmysqlclient'

The --cflags output should be getting included in the gcc options when compiling, but based on your original listing, it's not.

In the toplevel Makefile, there should be a line near the top reading: SQL_CFLAGS=-I/usr/include/mysql -DBIG_JOINS=1

SQL_CFLAGS should be passed along in the body of the all: rule.

In src/Makefile, there should be a line near the top reading: CFLAGS=$(CCFLAGS) $(SQL_CFLAGS)

Are all those there? And are you using just make 'make' or 'make all' to compile? I just noticed that the netmud rule doesn't pass the SQL flags... if you're doing 'make netmud' you'd see the exact sort of errors you're getting.

(follow-up: ↓ 6 ) 07/11/07 01:56:26 changed by ray73864

Thinking that *maybe* it was because i used the patch02 file that you posted here on Trac, i reversed that patch so i was back to p1, then downloaded the broken patch02 from http://ftp.pennmush.org/Source/1.8.3-patch02

I then used that patch to go from p1 to p2 and then downloaded 1.8.3-patch03-from-02-patch at which point i used that to go from p2 to p3 and then downloaded the patch04 patch to go up to p4.

I then did 'sh configure' (since i couldn't be bothered doing the whole chmod thing), sql.c still did not compile this time around.

The gcc line for compiling sql.c looks like this 'gcc -std=gnu99 -ggdb -O -W -Wall -pedantic -Wno-comment -I/usr/include/ -I.. -I../hdrs -c -o sql.o sql.c'

the CFLAGS line in src/Makefile looks like this: CFLAGS=$(CCFLAGS) $(SQL_CFLAGS)

and according to the Makefile in the root directory, i have the following lines:

SQL_CFLAGS=-I/usr/include/mysql -DBIG_JOINS=1 -I/usr/include SQL_LDFLAGS=-L/usr/lib/mysql -lmysqlclient -L/usr/lib -lsqlite3

also, the Makefile still has the

# - System configuration - #

VERSION=1.8.3 PATCHLEVEL=3

at the top of it, is that supposed to change?

oh, and i compile by doing 'make' and then 'make install' i have never used 'make all' or 'make netmud' or any of those other rules in the Makefile.

(in reply to: ↑ 5 ) 07/11/07 09:03:44 changed by raevnos

Replying to ray73864:

Thinking that *maybe* it was because i used the patch02 file that you posted here on Trac, i reversed that patch so i was back to p1, then downloaded the broken patch02 from http://ftp.pennmush.org/Source/1.8.3-patch02

I should never have release that patch. But reversing it and applying the official ones is the right path.

the CFLAGS line in src/Makefile looks like this: CFLAGS=$(CCFLAGS) $(SQL_CFLAGS) and according to the Makefile in the root directory, i have the following lines: SQL_CFLAGS=-I/usr/include/mysql -DBIG_JOINS=1 -I/usr/include SQL_LDFLAGS=-L/usr/lib/mysql -lmysqlclient -L/usr/lib -lsqlite3

That all looks good. Now, does Makefile have a section like:

all: config.h options.h autogen game/mush.cnf
	@echo "Making all in src."
	(cd src; /sw/bin/make all "CC=$(CC)" "CCFLAGS=$(CCFLAGS)" \
	"LDFLAGS=$(LDFLAGS)" "CLIBS=$(CLIBS)" "MAKE=$(MAKE)" \
	"MAKEFLAGS=$(MAKEFLAGS)" "SQL_CFLAGS=$(SQL_CFLAGS)" \
	"SQL_LDFLAGS=$(SQL_LDFLAGS)")
	@echo "If the make was successful, use 'make install' to install links."

(The actual path to make can vary)

oh, and i compile by doing 'make' and then 'make install' i have never used 'make all' or 'make netmud' or any of those other rules in the Makefile.

Darn. That would have been a trivial fix.

(follow-up: ↓ 8 ) 07/11/07 15:12:58 changed by ray73864

The Makefile has a rule for all as described below:

all: config.h options.h autogen game/mush.cnf

@echo "Making all in src." (cd src; /usr/bin/make all "CC=$(CC)" "CCFLAGS=$(CCFLAGS)" \ "LDFLAGS=$(LDFLAGS)" "CLIBS=$(CLIBS)" "MAKE=$(MAKE)" \ "MAKEFLAGS=$(MAKEFLAGS)" "SQL_CFLAGS=$(SQL_CFLAGS)" \ "SQL_LDFLAGS=$(SQL_LDFLAGS)") @echo "If the make was successful, use 'make install' to install links."

(in reply to: ↑ 7 ) 07/12/07 13:27:26 changed by raevnos

Replying to ray73864:

The Makefile has a rule for all as described below: all: config.h options.h autogen game/mush.cnf @echo "Making all in src." (cd src; /usr/bin/make all "CC=$(CC)" "CCFLAGS=$(CCFLAGS)" \ "LDFLAGS=$(LDFLAGS)" "CLIBS=$(CLIBS)" "MAKE=$(MAKE)" \ "MAKEFLAGS=$(MAKEFLAGS)" "SQL_CFLAGS=$(SQL_CFLAGS)" \ "SQL_LDFLAGS=$(SQL_LDFLAGS)") @echo "If the make was successful, use 'make install' to install links."

I'm stumped, then. Everything looks the way it's supposed to be, but it's not actually using the SQL_CFLAGS options like it should.

01/06/08 02:21:50 changed by raevnos

Has this problem cropped up on more recent patchlevels?

01/06/08 14:21:18 changed by ray73864

i haven't had any recent problems anymore.