Log in

View Full Version : Syntax Errors, Circular Buffer, STLPort


pushkin
3rd April 2007, 06:41
Hi
I found 2 syntax errors on Avisynth-3.0 for Linux from CVS:

1. Planar_yuv.h: Syntax error before ";" token
File: avisynth/src/core/colorspace/importer/planar_yuv.h
Line: 70 and 71:

owned_block<1> blockU = blockY.Split( dimY.BMPSize<alignY>() + offset );
owned_block<1> blockV = blockU.Split( dimUV.BMPSize<alignUV>() );

2. encode.c: missing 2nd parameter.
File: avisynth/bin/encode.c
Line: 251

data->clip = avs_clip_new_from_file (data->filename, data->env);

Possible solution: the 2nd parameter is "&error" or something with the type of "AVS_Error". See "avisynth/bin/decode.c".

Circular_Buffer Boost extension version 3.6 and 3.7 is NOT AVAILABLE on Internet. I had uploaded the latest version from Jano Gaspar at the file section of Boost group at Yahoogroups. It is impossible to download the complete Circular Buffer "tar.gz" file from Sourceforge sandbox.

http://groups.yahoo.com/group/boost

I found "undefined reference" related to STLPort when I compile Avisynth. The header file of old STLPort (version 4.X) use "stl/config.h". Unfortunately this header file IS NOT available on new STLPort (version 5.1). The configure scripts of Avisynth-3.0 on Linux searched for this missing "stl/config.h" file.

What is the BEST/Correct version of STLPort for compiling Avisynth?

Thank you.

d'Oursse
3rd April 2007, 08:10
Can you tell me which compiler (and its version) you use to compile avs3 ?

For 1) I don't understand the problem (I have not that error). Can you please paste some lines before the current error (especailly from which file the header is included)
For 2) indeed, there is a missing parameter. But the error message is wrong :) It is fixed in CVS. It's quite strange that I didn't see that error.

As stated in the documentation (http://avisynth3.unite-video.com/documentation.html), the circular buffer lib can be found in build/. You can also get it from cvs sandbox. I should update the archive, as Jano has introduced some fixes.

About STLport, the version 5.* is required (prefer the 5.1.* version, as it contains a lot of fixes).

I changed the way stlport headers are detected 2 months ago, and it does not look for stl/config.h anymore. Are you sure that you have the latest source code ?

Thank you for your report :)

pushkin
3rd April 2007, 10:17
Thank you for your help.

Compiler Version: official/standard GCC from Linux Mandriva 10.0:

gcc (GCC) 3.3.2 (Mandrake Linux 10.0 3.3.2-6mdk)

Error messages from "planar_yuv.h":

In file included from ../../src/export/vfw/bitmapinfoheader.cpp:31:
../../src/core/colorspace/importer/planar_yuv.h: In member function `virtual avs::CPVideoFrame avs::colorspace::importer::planar_yuv<alignY, alignUV>::CreateFrame(const avs::Dimension&, avs::FrameType, const avs::owned_block<1>&, long int) const':
../../src/core/colorspace/importer/planar_yuv.h:70: error: syntax error before `;' token
../../src/core/colorspace/importer/planar_yuv.h:70: error: syntax error before `;' token
../../src/core/colorspace/importer/planar_yuv.h:71: error: syntax error before `;' token
../../src/export/vfw/bitmapinfoheader.cpp:67:8: warning: multi-character character constant
../../src/export/vfw/bitmapinfoheader.cpp:68:8: warning: multi-character character constant
make: *** [export/vfw/bitmapinfoheader.o] Error 1

There is another problem with configure and libboost: There is no such file as:
libboost.................mt-gdp.so
The only available library file is:
libboost..................mt.so

I had compiled boost directly from source code 2 times, but I CANNOT find any library file with "-gdp".

configure:10342: checking for main in -lboost_thread-gcc-mt-gdp
configure:10367: g++ -o conftest -g -O2 -L/usr/lib conftest.cc -lboost_thread-gcc-mt-gdp -pthread
/usr/bin/ld: cannot find -lboost_thread-gcc-mt-gdp

d'Oursse
3rd April 2007, 10:53
If you have installed STLport and/or Boost from a package, then, I might be normal : packagers often rename the libraries, install the libraries / headers in another location, etc...

2 solutions:

1) you create a .spec file and I add it to the cvs, so that any distro based on a rpm can install avs3 with it.
2) use the options of configure of avs3 (see configure --help). I've added options to specify the library and its path, etc... So try with those options.

I can't say much about the name of the boost thread library. I compile boost 1.33.1 from source code, and that's the name I have.

Anyway, Boost 1.34 will be released soon. I have to report the potential problem that that version can have with stlport 5.1. Then, I'll require that Boost version (it contains several fixes for the thread lib)

for the problem in planar_yuv.h, I's strange, as that code should not be compiled (vfw code). I'll check that.

pushkin
3rd April 2007, 12:26
> RPM

I hope someone can create "avisynth.....src.rpm" for Fedora, Mandriva, SuSE, DAG and Freshrpms.

> Version of boost libraries.

I heard that "-gdp" extension to the library name is added if you compile boost with "debug" option.
Do you enable "Debug" option?

Thank you.

pushkin
3rd April 2007, 13:37
After commenting out lines related to "Planar_YUV.h" I managed to compile the avisynth package, but there are 1790 undefined reference error.
IMO this had something to do with libstlport.
How to solve this problem?

Thank you.

The first 4 undefined reference errors:
libavisynth.a(clip_c.o)(.text+0x52): In function `__static_initialization_and_destruction_0(int, int)':
: undefined reference to `_STL::ios_base::_Loc_init::_Loc_init[in-charge]()'
libavisynth.a(clip_c.o)(.text+0x8d): In function `__static_initialization_and_destruction_0(int, int)':
: undefined reference to `_STL::ios_base::Init::Init[in-charge]()'
libavisynth.a(clip_c.o)(.text+0x1d9): In function `avs_clip_new_from_script':
: undefined reference to `_STL::__node_alloc<(bool)1, (int)0>::_M_deallocate(void*, unsigned)'
libavisynth.a(clip_c.o)(.text+0x270): In function `avs_clip_new_from_script':
: undefined reference to `_STL::__node_alloc<(bool)1, (int)0>::_M_deallocate(void*, unsigned)'

d'Oursse
3rd April 2007, 16:59
did you compile boost with STLport support, that is, did you follow precisely the documentation page I gave ?

pushkin
4th April 2007, 08:00
Thank you for your help.
After re-compiling boost from source code with STLport support, all problem is solved except the syntax errors at "planar_yuv.h"

Can you split the line into 2 lines/more to catch the error/bug using a new temporay_variable?

From:

owned_block<1> blockU = blockY.Split( dimY.BMPSize<alignY>() + offset );
owned_block<1> blockV = blockU.Split( dimUV.BMPSize<alignUV>() );

To:

temporary_variable = dimY.BMPSize<alignY>();
temporary_variable = temporary_variable + offset;
owned_block<1> blockU = blockY.Split( temporary_variable );

temporary_variable = dimUV.BMPSize<alignUV>();
owned_block<1> blockV = blockU.Split( temporary_variable );

What is the correct type /declaration for temporary_variable?

Thank you

d'Oursse
4th April 2007, 08:32
The error is that bitmapinfoheader.cpp should not be compiled. That files is used in the vfw part, which is specific to Windows. There is certainly a missing #ifdef somewhere. I'll check that tonight.

pushkin
4th April 2007, 10:11
What about video.cpp?
This file contain reference to "planar_yuv.h".

Thank you.

Location: avisynth/src/gstreamer/structure/video.cpp

#include "../../core/colorspace/importer/planar_yuv.h"

d'Oursse
5th April 2007, 09:46
I've disabled the compilation of all the vfw stuff by adding WIN32 guards
So, you should only have a problem with gstreamer/structure/video.cpp

can you try it (check out cvs again) ?

I really think that it's a problem with that specific compiler. I'll try to fix that later.

pushkin
5th April 2007, 15:03
> Compiler problem

I had installed gcc-3.4.3 from Mandriva 10.2 and the syntax errors disappeared.
However libavisynth.so.3.0 is now an empty file and there are 4000 warnings.

The 3 first warning after "L libavisynth.so.3.0":

/usr/bin/ld: `.L1376' referenced in section `.rodata' of core/colorspace/concrete/interleaved.o: defined in discarded section `.gnu.linkonce.t._ZN5boost2io6detail22parse_printf_directiveIcN8stlp_std11char_traitsIcEENS3_9allocatorIcEEPKcNS3_5ctypeIcEEEEbRT2_RKSC_PNS1_11format_itemIT_T0_T1_EERKT3_jh' of core/colorspace/concrete/interleaved.o

/usr/bin/ld: `.L1834' referenced in section `.rodata' of core/colorspace/concrete/interleaved.o: defined in discarded section `.gnu.linkonce.t._ZN5boost2io6detail22parse_printf_directiveIcN8stlp_std11char_traitsIcEENS3_9allocatorIcEEPKcNS3_5ctypeIcEEEEbRT2_RKSC_PNS1_11format_itemIT_T0_T1_EERKT3_jh' of core/colorspace/concrete/interleaved.o

/usr/bin/ld: `.L1834' referenced in section `.rodata' of core/colorspace/concrete/interleaved.o: defined in discarded section `.gnu.linkonce.t._ZN5boost2io6detail22parse_printf_directiveIcN8stlp_std11char_traitsIcEENS3_9allocatorIcEEPKcNS3_5ctypeIcEEEEbRT2_RKSC_PNS1_11format_itemIT_T0_T1_EERKT3_jh' of core/colorspace/concrete/interleaved.o

d'Oursse
5th April 2007, 16:31
did you recompiled everything after installing gcc 3.4.3 (that is, make clean, then make) ?

pushkin
6th April 2007, 11:19
Thank you for your help. I had re-installed every related binary rpms from Mandrake 10.2.

The warning remains, but the result on "/usr/lib":

file size: 11570376, file name: /usr/lib/libavisynth.a
file size: 2883392, file name: /usr/lib/libavisynth.so.3.0

Is this OK and the 4500 warnings should be ignored?

Perhaps the warnings are caused by incomplete upgrade procedure.
Is this true?
Thank you.

d'Oursse
6th April 2007, 12:05
I was not precise enough. I mean, did you recompile avisynth ? That is, in build/linux:


make clean
make


You should not ignore those warnings.They make me think that you compiled first avs3 with gcc 3.3.2, then, you installed gcc 3.4.3, then you run just make. Which is bad.

pushkin
8th April 2007, 11:09
Thank you for your help.

I had deleted the whole avisynth and re-install new source code from CVS, but "discarded" warning reappear.

I had posted questions about "discarded section" and updating both new GCC and Glibc without compiling on Mandriva forum, but there is no reply.

Perhaps the best solution is to wipe out the entire partition and install other newer Linux distro such as Knoppix/Debian or PCLinuxOS.

Thank you.

d'Oursse
8th April 2007, 11:29
it seems that it's a g++ and/or binutils bug. Look at "defined in discarded section" results with google.

Maybe you can try to update your binutils package too

pushkin
11th April 2007, 06:16
Hi
Thank you for the reply.

I had upgraded all GCC, glibc, binutils to Mandriva 2006 with GCC-4.0.5 and Glibc-2.3.5. All is ok except the following 3 "undefined reference"

libavisynth.a(clip_c.o): In function `avs_clip_new_from_script':
clip_c.cpp:(.text+0xc2b): undefined reference to `__cxa_get_exception_ptr'
libavisynth.a(clip_c.o): In function `avs_clip_new_from_file':
clip_c.cpp:(.text+0x11ea): undefined reference to `__cxa_get_exception_ptr'
libavisynth.a(clip_c.o): In function `avs_clip_new_to_rgb32':
clip_c.cpp:(.text+0x1842): undefined reference to `__cxa_get_exception_ptr'
collect2: ld returned 1 exit status
make: *** [avisynth_test] Error 1

IMO this exception is related to libstdc++
Apparently one of the library used by Avisynth is compiled using old GCC-3.4.3 with libstdc++ version 5, but the current version of libstdc++ on GCC-4.0.1 is 6.

There is a "cxa_get_exception_ptr" on libstdc++.so.6, but there is no such symbol on libstdc++.so.5.

What libraries are related to this error?
Thank you.

d'Oursse
11th April 2007, 09:29
maybe STLport.

pushkin
11th April 2007, 12:42
> Recompiling library

Both STLport and Boost must be re-compiled to fix the errors.

There are various warnings, but no error.

Thank you.