Hi Phil.
I compiled the zmc via my IDE, rather then using the supplied make file.
All works well, but I had to make a few changes to the source files, and wanted to ask you about the possiblie issues:
1) Linker complained about undefined refrence to jpeg_mem_src and jpeg_mem_dest. After a some checking, I found that extern "C", which encloses the zm_jpeg.h inclusion, causes that. By commenting out the extern "C", it was solved:
//extern "C"
//{
#include "zm_jpeg.h"
//}
2) The linker also complained about the missing OGG functions, like ogg_write_header and ogg_write_packet, so I had to add "libogg" to the linking (which ZM doesn't require?)
3) After that, the linker still couldn't find some libavformat functions (which should be there), as a52_syncinfo, av_codec_register_all and avcodec_pix_fmt_to_codec_tag, so I had eventually to disable the libavcodec and the libavformat, from the config.h.
The zmc seems to work pretty good, and it won't need (I guess) the FFMPEG functionality anyway, but I do would like to know, whether commenting the extern was the only way, and if it hasn't impact anything.
Thanks.
ZM non-standard linking issues
ZM non-standard linking issues
Last edited by SyRenity on Fri Jul 22, 2005 3:45 pm, edited 1 time in total.
- zoneminder
- Site Admin
- Posts: 5215
- Joined: Wed Jul 09, 2003 2:07 pm
- Location: Bristol, UK
- Contact:
Hi Phil.
I'm using the SlickEdit IDE, version 10. There are no include paths defined, as I simply dropped the generated config.h in the src directory.
I should say, that not all of the files are included from the original src directory - namely, the rest of the daemons (zma, zmu and zms). All other of the files are present, as they are necessary for a successful compilation.
By the way, I will change the name of the thread, as I encounter problems in the linking, rather then in the compilation.
I'm using the SlickEdit IDE, version 10. There are no include paths defined, as I simply dropped the generated config.h in the src directory.
I should say, that not all of the files are included from the original src directory - namely, the rest of the daemons (zma, zmu and zms). All other of the files are present, as they are necessary for a successful compilation.
By the way, I will change the name of the thread, as I encounter problems in the linking, rather then in the compilation.
Hi.
Another update this time - for fedora core 4 .
All compiles fine, except for the following 2 points:
1) On FC4 the libmysqlclient.a ships with OpenSSL compiled in, which requires a bunch of other libraries included:
/usr/lib/libssl.a
/usr/lib/libcrypto.a
/usr/lib/libkrb5.a
/usr/lib/libk5crypto.a
/usr/lib/libcom_err.a
/usr/lib/libresolv.a
2) The path of the pcre.h has changed, and in the zm_regexp.h it should be changed from #include<pcre/pcre.h> to #include <pcre.h>.
The extern issue is still there - the linker will simply not build the binaries if these lines are not remarked. Phil, what was the reason of using extern?
The whole story BTW compiles on the latest GCC4 - it's nice to see that ZM works flawlessly on this version while many other OSS projects are breaking apart.
Another update this time - for fedora core 4 .
All compiles fine, except for the following 2 points:
1) On FC4 the libmysqlclient.a ships with OpenSSL compiled in, which requires a bunch of other libraries included:
/usr/lib/libssl.a
/usr/lib/libcrypto.a
/usr/lib/libkrb5.a
/usr/lib/libk5crypto.a
/usr/lib/libcom_err.a
/usr/lib/libresolv.a
2) The path of the pcre.h has changed, and in the zm_regexp.h it should be changed from #include<pcre/pcre.h> to #include <pcre.h>.
The extern issue is still there - the linker will simply not build the binaries if these lines are not remarked. Phil, what was the reason of using extern?
The whole story BTW compiles on the latest GCC4 - it's nice to see that ZM works flawlessly on this version while many other OSS projects are breaking apart.
Last edited by SyRenity on Sun Nov 06, 2005 3:28 pm, edited 1 time in total.
- zoneminder
- Site Admin
- Posts: 5215
- Joined: Wed Jul 09, 2003 2:07 pm
- Location: Bristol, UK
- Contact:
This should be handled when you run 'configure'. It will look in both places and indicate which to use.SyRenity wrote: 2) The path of the pcre.h has changed, and in the zm_regexp.h it should be changed from #include<pcre/pcre.h> to #include <pcre.h>.
The extern keyword indicates 'c' linkage. In other words the function names are not mangled to indiate argument type etc as the functions are in a .c source file. Without this it will fail to link, as it does still on my FC4 system with g++ 4.01. I'm curious what errors you get with it in and why you can compile without it.SyRenity wrote: The extern issue is still there - the linker will simply not build the binaries if these lines are not connected. Phil, what was the reason of using extern?
Good, so far so good, touch wood, cross fingers etc.SyRenity wrote: The whole story BTW compiles on the latest GCC4 - it's nice to see that ZM works flawlessy on this version while many other OSS projects are breaking apart.
Phil
Hi Phil.
This is the error I get while trying to compile with #extern uncommented:
It seems perhaps as a compiler or linker flag I didn't set? I probably have a diffrent set of compiler/linker options that these defined in your make file.
BTW, on FC3 the prce.h is located both in <pcre.h> and <pcre/pcre.h>, so changing it to former will work on both of the versions (FC3 and FC4).
This is the error I get while trying to compile with #extern uncommented:
Code: Select all
g++ -g -o "Debug/zms" Debug/zm.o Debug/zm_box.o Debug/zm_buffer.o Debug/zm_camera.o Debug/zm_config.o Debug/zm_coord.o Debug/zm_db.o Debug/zm_debug.o Debug/zm_event.o Debug/zm_image.o Debug/zm_jpeg.o Debug/zm_local_camera.o Debug/zm_monitor.o Debug/zm_mpeg.o Debug/zm_regexp.o Debug/zm_remote_camera.o Debug/zm_user.o Debug/zm_zone.o Debug/zms.o -L/usr/lib/ -L/usr/lib/mysql/ -ljpeg -lpcre -lz -lcrypto -ldl -lavcodec -lavformat -lmp3lame -lmysqlclient
Debug/zm_image.o(.text+0xb0f): In function `Image::DecodeJpeg(unsigned char*, int)':
/home/dev/DevArea/zms/zm_image.cpp:221: undefined reference to `jpeg_mem_src'
Debug/zm_image.o(.text+0xd3b): In function `Image::EncodeJpeg(unsigned char*, int*) const':
/home/dev/DevArea/zms/zm_image.cpp:264: undefined reference to `jpeg_mem_dest'
collect2: ld returned 1 exit status
gmake: *** [Debug/zms] Error 1
BTW, on FC3 the prce.h is located both in <pcre.h> and <pcre/pcre.h>, so changing it to former will work on both of the versions (FC3 and FC4).