On Sat, 24 Mar 2012 12:55:11 +0100, Lars Jahr Røine <lar...@ifi.uio.no> wrote: > Hello, > > I'm trying to figure out how to add source files to the existing > Octave code so that they are compiled and linked correctly. > > I've succeeded in including a simple test file, but when I try to add > more complicated files I get a compiler error I don't fully > understand. > The problem occurs when I use #include in the files I try to add. > > Attached are two simple files that produce the error: > include_test_func.cc and include_test_func.h > > I've modified the Makefile.am (also attached) in /src to signal that > the files should be compiled and linked. > > Everything works fine if I don't include iostream in > include_test_func.h, but when included I get the following error: > > > making defaults.h from defaults.h.in > defaults.h is unchanged > making oct-conf.h from oct-conf.h.in > oct-conf.h is unchanged > make all-am > make[1]: Entering directory > `/home/lars/master/master_repo/larsjr-master/octave-dev/octave/src' > making defaults.h from defaults.h.in > defaults.h is unchanged > /bin/bash ../libtool --tag=CXX --mode=compile g++ -DHAVE_CONFIG_H > -I. -I.. -I../libgnu -I../libgnu -I../libcruft/misc -I../liboctave > -I../liboctave -I. -I. -g -O2 -DHAVE_CONFIG_H > -I/usr/include/freetype2 -Wall -W -Wshadow -Wold-style-cast -Wformat > -Wpointer-arith -Wwrite-strings -Wcast-align -Wcast-qual -g -O2 > -pthread -g -O2 -MT liboctinterp_la-include_test_func.lo -MD -MP -MF > .deps/liboctinterp_la-include_test_func.Tpo -c -o > liboctinterp_la-include_test_func.lo `test -f 'include_test_func.cc' > || echo './'`include_test_func.cc > libtool: compile: g++ -DHAVE_CONFIG_H -I. -I.. -I../libgnu > -I../libgnu -I../libcruft/misc -I../liboctave -I../liboctave -I. -I. > -g -O2 -DHAVE_CONFIG_H -I/usr/include/freetype2 -Wall -W -Wshadow > -Wold-style-cast -Wformat -Wpointer-arith -Wwrite-strings > -Wcast-align > -Wcast-qual -g -O2 -pthread -g -O2 -MT > liboctinterp_la-include_test_func.lo -MD -MP -MF > .deps/liboctinterp_la-include_test_func.Tpo -c include_test_func.cc > -fPIC -DPIC -o .libs/liboctinterp_la-include_test_func.o > In file included from /usr/include/pthread.h:26, > from > /usr/include/c++/4.4/x86_64-linux-gnu/bits/gthr-default.h:41, > from > /usr/include/c++/4.4/x86_64-linux-gnu/bits/gthr.h:162, > from /usr/include/c++/4.4/ext/atomicity.h:34, > from /usr/include/c++/4.4/bits/ios_base.h:41, > from /usr/include/c++/4.4/ios:43, > from /usr/include/c++/4.4/ostream:40, > from /usr/include/c++/4.4/iostream:40, > from include_test_func.h:4, > from include_test_func.cc:1: > ../libgnu/time.h:471: error: expected ‘,’ or ‘...’ before ‘__timer’ > ../libgnu/time.h:471: error: nonnull argument with out-of-range > operand number (argument 1, operand 2) > ../libgnu/time.h:471: error: declaration of C function ‘tm* > localtime_r(const time_t*)’ conflicts with > /usr/include/time.h:248: error: previous declaration ‘tm* > localtime_r(const time_t*, tm*)’ here > ../libgnu/time.h:493: error: expected ‘,’ or ‘...’ before ‘__timer’ > ../libgnu/time.h:493: error: nonnull argument with out-of-range > operand number (argument 1, operand 2) > ../libgnu/time.h:493: error: declaration of C function ‘tm* > gmtime_r(const time_t*)’ conflicts with > /usr/include/time.h:243: error: previous declaration ‘tm* > gmtime_r(const time_t*, tm*)’ here > make[1]: *** [liboctinterp_la-include_test_func.lo] Error 1 > make[1]: Leaving directory > `/home/lars/master/master_repo/larsjr-master/octave-dev/octave/src' > make: *** [all] Error 2 > > > It would be great if someone could please explain what's going on > here, and what I'm doing wrong. > > Kind regards > > Lars J. R.
I forgot to mention that I'm trying to use the test function in the draw_patch in the file gl-render.cc, so I've included "include_test_func" in gl-render.h. ------------------------------------------------------------------------------ This SF email is sponsosred by: Try Windows Azure free for 90 days Click Here http://p.sf.net/sfu/sfd2d-msazure _______________________________________________ Octave-dev mailing list Octave-dev@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/octave-dev