Compilation errors with 03 optimization

Forum for questions and support relating to the 1.24.x releases only.
Locked
User avatar
erict35
Posts: 12
Joined: Thu May 26, 2011 9:08 am
Location: Rennes FRANCE

Compilation errors with 03 optimization

Post by erict35 »

Hi

I'm using a Ubuntu 11.04 Desktop 64 bits.

As recommended in the Wiki documentation, I tried using -O3 in order to optimize code
The parameters are :

export CFLAGS="-march=native -O3 -pipe"

export CXXFLAGS="${CFLAGS}"

export CPPFLAGS="${CFLAGS}"


When compiling graphic components like x264 and ffmpeg, I got no problems with these options

When compiling ZoneMinder 1.24.4 I got one :

zm_rtp_source.o: In function `RtpSource::handlePacket(unsigned char const*, unsigned long)':

zm_rtp_source.cpp:(.text+0xf15): undefined reference to `ThreadData<bool>::updateValueSignal(bool)'

zm_rtp_source.cpp:(.text+0xf32): undefined reference to `ThreadData<bool>::getUpdatedValue(int) const'

zm_rtp_source.cpp:(.text+0xf43): undefined reference to `ThreadData<bool>::getUpdatedValue(int) const'

zm_rtp_source.cpp:(.text+0xf54): undefined reference to `ThreadData<bool>::getUpdatedValue(int) const'

zm_rtp_source.o: In function `RtpSource::getFrame(Buffer&)':

zm_rtp_source.cpp:(.text+0x10c2): undefined reference to `ThreadData<bool>::getUpdatedValue(int) const'

zm_rtp_source.cpp:(.text+0x10d3): undefined reference to `ThreadData<bool>::getUpdatedValue(int) const'

zm_rtp_source.o:zm_rtp_source.cpp:(.text+0x10e6): more undefined references to `ThreadData<bool>::getUpdatedValue(int) const' follow

zm_rtp_source.o: In function `RtpSource::getFrame(Buffer&)':

zm_rtp_source.cpp:(.text+0x113f): undefined reference to `ThreadData<bool>::updateValueSignal(bool)'

zm_timer.o: In function `Timer::TimerThread::run()':

zm_timer.cpp:(.text+0x4b): undefined reference to `ThreadData<bool>::setValue(bool)'

zm_timer.cpp:(.text+0x61): undefined reference to `ThreadData<bool>::getUpdatedValue(int) const'

zm_timer.o: In function `Timer::TimerThread::cancel()':

zm_timer.cpp:(.text+0x34d): undefined reference to `ThreadData<bool>::updateValueSignal(bool)'

zm_timer.o: In function `Timer::TimerThread::reset()':

zm_timer.cpp:(.text+0x4c3): undefined reference to `ThreadData<bool>::updateValueSignal(bool)'

collect2: ld returned 1 exit status

make[2]: *** [zmc] Erreur 1



If I change the compiler parameters as these :
export CFLAGS="-march=native -O2 -pipe"
export CXXFLAGS="${CFLAGS}"
export CPPFLAGS="${CFLAGS}"

I can compile ZoneMinder and launch it without problem

Any help appreciated
Best Regards
Eric
Locked