Problem with undefined reference in make

Support and queries relating to all previous versions of ZoneMinder
Locked
Fivern
Posts: 17
Joined: Tue Jun 20, 2006 11:01 am

Problem with undefined reference in make

Post by Fivern »

Hi!
I'm building the Zoneminder 1.22.2 on an arm-xscale using Montavista Linux, but when I get to the compiling of zmc, I get the following error:

Code: Select all

if gcc -DHAVE_CONFIG_H -I. -I. -I..  -I/usr/local/mysql/include -I/usr/include -I/usr/local/mysql/include  -g -O2 -MT zm_jpeg.o -MD -MP -MF ".deps/zm_
jpeg.Tpo" -c -o zm_jpeg.o zm_jpeg.c; \
then mv -f ".deps/zm_jpeg.Tpo" ".deps/zm_jpeg.Po"; else rm -f ".deps/zm_jpeg.Tpo"; exit 1; fi
zm_jpeg.c: In function `jpeg_mem_src':
zm_jpeg.c:392: warning: assignment discards qualifiers from pointer target type
if gcc -DHAVE_CONFIG_H -I. -I. -I..  -I/usr/local/mysql/include -I/usr/include -I/usr/local/mysql/include  -lm -MT zm_regexp.o -MD -MP -MF ".deps/zm_r
egexp.Tpo" -c -o zm_regexp.o zm_regexp.cpp; \
then mv -f ".deps/zm_regexp.Tpo" ".deps/zm_regexp.Po"; else rm -f ".deps/zm_regexp.Tpo"; exit 1; fi
gcc: -lm: linker input file unused because linking not done
if gcc -DHAVE_CONFIG_H -I. -I. -I..  -I/usr/local/mysql/include -I/usr/include -I/usr/local/mysql/include  -lm -MT zm_signal.o -MD -MP -MF ".deps/zm_s
ignal.Tpo" -c -o zm_signal.o zm_signal.cpp; \
then mv -f ".deps/zm_signal.Tpo" ".deps/zm_signal.Po"; else rm -f ".deps/zm_signal.Tpo"; exit 1; fi
gcc: -lm: linker input file unused because linking not done
if gcc -DHAVE_CONFIG_H -I. -I. -I..  -I/usr/local/mysql/include -I/usr/include -I/usr/local/mysql/include  -lm -MT zm_buffer.o -MD -MP -MF ".deps/zm_b
uffer.Tpo" -c -o zm_buffer.o zm_buffer.cpp; \
then mv -f ".deps/zm_buffer.Tpo" ".deps/zm_buffer.Po"; else rm -f ".deps/zm_buffer.Tpo"; exit 1; fi
gcc: -lm: linker input file unused because linking not done
if gcc -DHAVE_CONFIG_H -I. -I. -I..  -I/usr/local/mysql/include -I/usr/include -I/usr/local/mysql/include  -g -O2 -MT zm_debug.o -MD -MP -MF ".deps/zm
_debug.Tpo" -c -o zm_debug.o zm_debug.c; \
then mv -f ".deps/zm_debug.Tpo" ".deps/zm_debug.Po"; else rm -f ".deps/zm_debug.Tpo"; exit 1; fi
gcc  -lm  -L/usr/lib -L/usr/local/mysql/lib/mysql   -o zmc  zmc.o zm.o zm_db.o zm_config.o zm_coord.o zm_box.o zm_poly.o zm_image.o zm_event.o zm_zone
.o zm_camera.o zm_local_camera.o zm_remote_camera.o zm_file_camera.o zm_monitor.o zm_user.o zm_mpeg.o zm_jpeg.o zm_regexp.o zm_signal.o zm_buffer.o zm
_debug.o  -lmysqlclient -ldl -lz -ljpeg
zmc.o(.text+0x5bc): In function `main':
: undefined reference to `operator new[](unsigned)'
zmc.o(.text+0x6b8): In function `main':
: undefined reference to `operator new[](unsigned)'
zmc.o(.text+0x6cc): In function `main':
: undefined reference to `operator new[](unsigned)'
zmc.o(.text+0x6e0): In function `main':
: undefined reference to `operator new[](unsigned)'
zmc.o(.text+0x6f4): In function `main':
: undefined reference to `operator new[](unsigned)'
zmc.o(.text+0xd10): In function `main':
: undefined reference to `operator delete(void*)'
zmc.o(.text+0xd34): In function `main':
: undefined reference to `operator delete[](void*)'
zmc.o(.text+0xd48): In function `main':
: undefined reference to `operator delete[](void*)'
zmc.o(.text+0xd5c): In function `main':
: undefined reference to `operator delete[](void*)'
zm_config.o(.text+0x468): In function `ConfigItem::ConfigItem[unified](char const*, char const*, char const*)':
: undefined reference to `operator new[](unsigned)'
zm_config.o(.text+0x498): In function `ConfigItem::ConfigItem[unified](char const*, char const*, char const*)':
: undefined reference to `operator new[](unsigned)'
zm_config.o(.text+0x4c8): In function `ConfigItem::ConfigItem[unified](char const*, char const*, char const*)':
: undefined reference to `operator new[](unsigned)'
and the list just go on and on, ending with:

Code: Select all

collect2: ld returned 1 exit status
make[2]: *** [zmc] Error 1
The configure script looks good and reports no errors with only sigcontext.eip, pcre and some optional mpeg and perl modules with "no".
I use:
CC=gcc CXX=gcc CFLAGS="-lm" CXXFLAGS="-lm" CPPFLAGS="-I/usr/local/mysql/include" ./configure --with-webdir=/opt/www/htdocs/html --with-cgidir=/opt/www/htdocs/cgi-bin --with-webuser=www --with-webgroup=www --with-mysql=/usr/local/mysql --disable-crashtrace ZM_DB_USER=zm ZM_DB_PASS=zm ZM_DB_NAME=zone

If you are wondering about any of the options, -lm used in order for libmysqlclient to work and CXX=gcc to get libjpeg to work (think g++ is broken).

Hope somebody can help me as I have no clue whatsoever how to approach this.. :shock:

Regards, Jon
jameswilson
Posts: 5111
Joined: Wed Jun 08, 2005 8:07 pm
Location: Midlands UK

Post by jameswilson »

Cant help with the error but xscale (the arms in embedded devices?)
Im very curious of your hardware? Any more details
James Wilson

Disclaimer: The above is pure theory and may work on a good day with the wind behind it. etc etc.
http://www.securitywarehouse.co.uk
Fivern
Posts: 17
Joined: Tue Jun 20, 2006 11:01 am

Post by Fivern »

It's an ARM/Intel XScale IXDP425 board running an embedded linux..
User avatar
cordel
Posts: 5210
Joined: Fri Mar 05, 2004 4:47 pm
Location: /USA/Washington/Seattle

Post by cordel »

You would appear to be missing header files that are more basic than what we might be used to for a normal distro. You can try checking the configure log and see what is detected.

Try checking this post just in case you haven't seen it yet and see if something sticks out.
http://www.zoneminder.com/forums/viewtopic.php?t=3556

If you want a more current list I can email you a current build list.
I will put one on the forum (under the above thread) after I format the text in a few days or so.

Regards,
Corey
Fivern
Posts: 17
Joined: Tue Jun 20, 2006 11:01 am

Post by Fivern »

Solved it by adding -lstdc++ to the CXXFLAG in configure. Probably because g++ links this in automatically, but gcc does not..
Thanks for replying anyways :)
Jon
Locked