Compiling/linking
Andrew Wood
andrew at gn.apc.org
Wed Jan 31 14:03:11 EST 2007
Hi Derek,
Thanks for the suggestion (which should work!):
> cd src/backend/file
> make
> make install
>
> Viola, you're now running with the new code.
>
The errors I get are below. It seems like there must have been some
problem when the initial directory structure was created, as
/opt/gnucash/lib simply doesn't exist. Why would that happen?
Initially when I built gnucash then I missed off the prefix from this:
./configure --prefix=/opt/gnucash
Later I built it with the prefix.
Could that explain it?
Andrew
--------------------------
[andrew at localhost gnucash-dev]$ cd gnucash-2.0
[andrew at localhost gnucash-2.0]$ cd src/backend/file
[andrew at localhost file]$ ls
gnc-account-xml-v2.c io-gncxml-v1.c
gnc-account-xml-v2.lo io-gncxml-v1.lo
gnc-backend-file.c io-gncxml-v2.c
gnc-backend-file.h io-gncxml-v2.c~
gnc-backend-file.lo io-gncxml-v2.h
gnc-book-xml-v2.c io-gncxml-v2.lo
gnc-book-xml-v2.lo io-utils.c
gnc-budget-xml-v2.c io-utils.h
gnc-budget-xml-v2.lo io-utils.lo
gnc-commodity-xml-v2.c libgnc-backend-file.la
gnc-commodity-xml-v2.lo libgnc-backend-file-utils.la
gnc-freqspec-xml-v2.c Makefile
gnc-freqspec-xml-v2.lo Makefile.am
gnc-lot-xml-v2.c Makefile.in
gnc-lot-xml-v2.lo original-io-gncxml-v2.c
gncmod-backend-file.c sixtp.c
gnc-pricedb-xml-v2.c sixtp-dom-generators.c
gnc-pricedb-xml-v2.lo sixtp-dom-generators.h
gnc-recurrence-xml-v2.c sixtp-dom-generators.lo
gnc-recurrence-xml-v2.lo sixtp-dom-parsers.c
gnc-schedxaction-xml-v2.c sixtp-dom-parsers.h
gnc-schedxaction-xml-v2.lo sixtp-dom-parsers.lo
gnc-transaction-xml-v2.c sixtp.h
gnc-transaction-xml-v2.lo sixtp.lo
gnc-xml.h sixtp-parsers.h
gnc-xml-helper.h sixtp-stack.c
io-example-account.c sixtp-stack.h
io-example-account.h sixtp-stack.lo
io-example-account.lo sixtp-to-dom-parser.c
io-gncbin.h sixtp-to-dom-parser.lo
io-gncbin-r.c sixtp-utils.c
io-gncxml-gen.c sixtp-utils.h
io-gncxml-gen.h sixtp-utils.lo
io-gncxml-gen.lo test
io-gncxml.h
[andrew at localhost file]$ make
Making all in .
make[1]: Entering directory
`/home/andrew/gnucash-dev/gnucash-2.0/src/backend/file'
make[1]: Nothing to be done for `all-am'.
make[1]: Leaving directory
`/home/andrew/gnucash-dev/gnucash-2.0/src/backend/file'
Making all in test
make[1]: Entering directory
`/home/andrew/gnucash-dev/gnucash-2.0/src/backend/file/test'
Making all in test-files
make[2]: Entering directory
`/home/andrew/gnucash-dev/gnucash-2.0/src/backend/file/test/test-files'
Making all in xml2
make[3]: Entering directory
`/home/andrew/gnucash-dev/gnucash-2.0/src/backend/file/test/test-files/xml2'
make[3]: Nothing to be done for `all'.
make[3]: Leaving directory
`/home/andrew/gnucash-dev/gnucash-2.0/src/backend/file/test/test-files/xml2'
make[3]: Entering directory
`/home/andrew/gnucash-dev/gnucash-2.0/src/backend/file/test/test-files'
make[3]: Nothing to be done for `all-am'.
make[3]: Leaving directory
`/home/andrew/gnucash-dev/gnucash-2.0/src/backend/file/test/test-files'
make[2]: Leaving directory
`/home/andrew/gnucash-dev/gnucash-2.0/src/backend/file/test/test-files'
make[2]: Entering directory
`/home/andrew/gnucash-dev/gnucash-2.0/src/backend/file/test'
make[2]: Nothing to be done for `all-am'.
make[2]: Leaving directory
`/home/andrew/gnucash-dev/gnucash-2.0/src/backend/file/test'
make[1]: Leaving directory
`/home/andrew/gnucash-dev/gnucash-2.0/src/backend/file/test'
[andrew at localhost file]$ make install
Making install in .
make[1]: Entering directory
`/home/andrew/gnucash-dev/gnucash-2.0/src/backend/file'
make[2]: Entering directory
`/home/andrew/gnucash-dev/gnucash-2.0/src/backend/file'
test -z "/opt/gnucash/lib" || mkdir -p -- "/opt/gnucash/lib"
/bin/sh ../../../libtool --mode=install /usr/bin/install -c
'libgnc-backend-file-utils.la'
'/opt/gnucash/lib/libgnc-backend-file-utils.la'
libtool: install: warning: relinking `libgnc-backend-file-utils.la'
(cd /home/andrew/gnucash-dev/gnucash-2.0/src/backend/file; /bin/sh
../../../libtool --tag=CC --mode=relink gcc -I.. -I../..
-DLOCALE_DIR="/opt/gnucash/share/locale" -I../../../src/backend
-I../../../src/engine -I../../../src/core-utils -I../../../lib/libc
-I/usr/include/libxml2 -I../../../lib/libqof/qof
-I../../../lib/libqof/qof -pthread -I/usr/include/glib-2.0
-I/usr/lib/glib-2.0/include -DORBIT2=1 -pthread -I/usr/include/gconf/2
-I/usr/include/orbit-2.0 -I/usr/include/glib-2.0
-I/usr/lib/glib-2.0/include -g -O2 -g -Wall -Wunused
-Wmissing-prototypes -Wmissing-declarations -Werror
-Wdeclaration-after-statement -Wno-pointer-sign -D_FORTIFY_SOURCE=2 -g
-o libgnc-backend-file-utils.la -rpath /opt/gnucash/lib
gnc-account-xml-v2.lo gnc-book-xml-v2.lo gnc-budget-xml-v2.lo
gnc-commodity-xml-v2.lo gnc-freqspec-xml-v2.lo gnc-lot-xml-v2.lo
gnc-pricedb-xml-v2.lo gnc-recurrence-xml-v2.lo
gnc-schedxaction-xml-v2.lo gnc-transaction-xml-v2.lo
io-example-account.lo io-gncxml-gen.lo io-gncxml-v1.lo io-gncxml-v2.lo
io-utils.lo sixtp-dom-generators.lo sixtp-dom-parsers.lo sixtp-stack.lo
sixtp-to-dom-parser.lo sixtp-utils.lo sixtp.lo -pthread
-Wl,--export-dynamic -L/lib -lgthread-2.0 -lgobject-2.0 -lgmodule-2.0
-ldl -lglib-2.0 -pthread -L/lib -lgconf-2 -lORBit-2 -lm -lgmodule-2.0
-ldl -lgthread-2.0 -lglib-2.0 -lxml2
../../../src/engine/libgncmod-engine.la
../../../src/core-utils/libcore-utils.la
../../../lib/libqof/qof/libgncqof.la -lpopt -lm -lm )
libtool: link: warning:
`/usr/lib/gcc/i386-redhat-linux/4.1.1/../../..//libltdl.la' seems to be
moved
libtool: link: warning:
`/usr/lib/gcc/i386-redhat-linux/4.1.1/../../..//libgwrap-guile-runtime.la'
seems to be moved
libtool: link: warning:
`/usr/lib/gcc/i386-redhat-linux/4.1.1/../../..//libgwrap-core-runtime.la'
seems to be moved
gcc -shared .libs/gnc-account-xml-v2.o .libs/gnc-book-xml-v2.o
.libs/gnc-budget-xml-v2.o .libs/gnc-commodity-xml-v2.o
.libs/gnc-freqspec-xml-v2.o .libs/gnc-lot-xml-v2.o
.libs/gnc-pricedb-xml-v2.o .libs/gnc-recurrence-xml-v2.o
.libs/gnc-schedxaction-xml-v2.o .libs/gnc-transaction-xml-v2.o
.libs/io-example-account.o .libs/io-gncxml-gen.o .libs/io-gncxml-v1.o
.libs/io-gncxml-v2.o .libs/io-utils.o .libs/sixtp-dom-generators.o
.libs/sixtp-dom-parsers.o .libs/sixtp-stack.o
.libs/sixtp-to-dom-parser.o .libs/sixtp-utils.o .libs/sixtp.o
-Wl,--rpath -Wl,/opt/gnucash/lib/gnucash -Wl,--rpath
-Wl,/opt/gnucash/lib
-L/home/andrew/gnucash-dev/gnucash-2.0/src/core-utils/.libs
-L/home/andrew/gnucash-dev/gnucash-2.0/lib/libqof/qof/.libs -L/lib
-lgobject-2.0 -lgconf-2 -lORBit-2 -lgmodule-2.0 -ldl -lgthread-2.0
-lglib-2.0 -lxml2 -L/opt/gnucash/lib/gnucash -lgncmod-engine
-L/home/andrew/gnucash-dev/gnucash-2.0/src/gnc-module/.libs
-L/usr/lib/gcc/i386-redhat-linux/4.1.1/../../../ -L/usr/lib
-L/opt/gnucash/lib -lcore-utils -lgncqof -lpopt -lm -pthread -pthread
-pthread -Wl,--export-dynamic -pthread -Wl,-soname
-Wl,libgnc-backend-file-utils.so.0 -o
.libs/libgnc-backend-file-utils.so.0.0.0
/usr/bin/ld: cannot find -lgncmod-engine
collect2: ld returned 1 exit status
libtool: install: error: relink `libgnc-backend-file-utils.la' with the
above command before installing it
/bin/sh ../../../libtool --mode=install /usr/bin/install -c
'libgnc-backend-file.la' '/opt/gnucash/lib/libgnc-backend-file.la'
libtool: install: warning: relinking `libgnc-backend-file.la'
(cd /home/andrew/gnucash-dev/gnucash-2.0/src/backend/file; /bin/sh
../../../libtool --tag=CC --mode=relink gcc -I.. -I../..
-DLOCALE_DIR="/opt/gnucash/share/locale" -I../../../src/backend
-I../../../src/engine -I../../../src/core-utils -I../../../lib/libc
-I/usr/include/libxml2 -I../../../lib/libqof/qof
-I../../../lib/libqof/qof -pthread -I/usr/include/glib-2.0
-I/usr/lib/glib-2.0/include -DORBIT2=1 -pthread -I/usr/include/gconf/2
-I/usr/include/orbit-2.0 -I/usr/include/glib-2.0
-I/usr/lib/glib-2.0/include -g -O2 -g -Wall -Wunused
-Wmissing-prototypes -Wmissing-declarations -Werror
-Wdeclaration-after-statement -Wno-pointer-sign -D_FORTIFY_SOURCE=2 -g
-o libgnc-backend-file.la -rpath /opt/gnucash/lib -module -avoid-version
gnc-backend-file.lo -pthread -Wl,--export-dynamic -L/lib -lgthread-2.0
-lgobject-2.0 -lgmodule-2.0 -ldl -lglib-2.0 -pthread -L/lib -lgconf-2
-lORBit-2 -lm -lgmodule-2.0 -ldl -lgthread-2.0 -lglib-2.0 -lxml2
../../../src/engine/libgncmod-engine.la
../../../src/core-utils/libcore-utils.la libgnc-backend-file-utils.la
../../../lib/libqof/qof/libgncqof.la -lpopt -lm -lm )
libtool: link: warning:
`/usr/lib/gcc/i386-redhat-linux/4.1.1/../../..//libltdl.la' seems to be
moved
libtool: link: warning:
`/usr/lib/gcc/i386-redhat-linux/4.1.1/../../..//libgwrap-guile-runtime.la'
seems to be moved
libtool: link: warning:
`/usr/lib/gcc/i386-redhat-linux/4.1.1/../../..//libgwrap-core-runtime.la'
seems to be moved
libtool: link: warning:
`/usr/lib/gcc/i386-redhat-linux/4.1.1/../../..//libltdl.la' seems to be
moved
libtool: link: warning:
`/usr/lib/gcc/i386-redhat-linux/4.1.1/../../..//libgwrap-guile-runtime.la'
seems to be moved
libtool: link: warning:
`/usr/lib/gcc/i386-redhat-linux/4.1.1/../../..//libgwrap-core-runtime.la'
seems to be moved
gcc -shared .libs/gnc-backend-file.o -Wl,--rpath
-Wl,/opt/gnucash/lib/gnucash -Wl,--rpath -Wl,/opt/gnucash/lib
-L/home/andrew/gnucash-dev/gnucash-2.0/src/engine/.libs
-L/home/andrew/gnucash-dev/gnucash-2.0/src/core-utils/.libs
-L/home/andrew/gnucash-dev/gnucash-2.0/lib/libqof/qof/.libs -L/lib
-lgobject-2.0 -lgconf-2 -lORBit-2 -lgmodule-2.0 -ldl -lgthread-2.0
-lglib-2.0 -lxml2 -L/opt/gnucash/lib/gnucash -lgncmod-engine
-L/home/andrew/gnucash-dev/gnucash-2.0/src/gnc-module/.libs
-L/usr/lib/gcc/i386-redhat-linux/4.1.1/../../../ -L/usr/lib
-L/opt/gnucash/lib -lcore-utils -lgnc-backend-file-utils -lgncqof -lpopt
-lm -pthread -pthread -pthread -Wl,--export-dynamic -pthread
-Wl,-soname -Wl,libgnc-backend-file.so -o .libs/libgnc-backend-file.so
/usr/bin/install -c .libs/libgnc-backend-file.soT
/opt/gnucash/lib/libgnc-backend-file.so
/usr/bin/install: cannot create regular file
`/opt/gnucash/lib/libgnc-backend-file.so': Permission denied
make[2]: *** [install-libLTLIBRARIES] Error 1
make[2]: Leaving directory
`/home/andrew/gnucash-dev/gnucash-2.0/src/backend/file'
make[1]: *** [install-am] Error 2
make[1]: Leaving directory
`/home/andrew/gnucash-dev/gnucash-2.0/src/backend/file'
make: *** [install-recursive] Error 1
> (note that this only works if you ONLY change .c files. If you
> change header files you might need to recompile/reinstall from the
> top level)
>
> -derek
>
> Quoting Andrew Wood <andrew at gn.apc.org>:
>
>> Hi,
>>
>> This is going to sound like a very dumb question, so forgive me if it
>> seems obvious but it isn't particularly transparent.
>>
>> Say I've built GNUCash and installed it with 'make install'. I then
>> change some of the code in io-gncxml-v2.c .I then run make. This will
>> recompile that file, and I presume the object file will be linked with
>> other appropriate object files. Try as I might I can't see which other
>> object files this is linked with and, more importantly, what the library
>> or executable is called that is produced by the link process. What I
>> want to do is, to replace the older version of the io-gncxml-v2.c code
>> with my amended code (this is a patch isn't it?).
>>
>> Any suggestions or advice?
>>
>> Thanks,
>>
>> Andrew Wood, Oxford.
>> _______________________________________________
>> gnucash-devel mailing list
>> gnucash-devel at gnucash.org
>> https://lists.gnucash.org/mailman/listinfo/gnucash-devel
>>
>
>
>
More information about the gnucash-devel
mailing list