LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 12-05-2008, 08:43 AM   #1
osc~
Member
 
Registered: Apr 2007
Location: brazil
Distribution: Arch Linux
Posts: 70

Rep: Reputation: 15
compile error: expected ‘;’ before ‘*’ token


hi i am trying to compile a program, but it gives this output:

Code:
In file included from ../src/include/impl_layers.h:48,
                 from freej.cpp:38:
../src/include/video_layer.h:34: error: ISO C++ forbids declaration of ‘AVPicture’ with no type
../src/include/video_layer.h:34: error: expected ‘;’ before ‘*’ token
../src/include/video_layer.h:46: error: ISO C++ forbids declaration of ‘AVCodec’ with no type
../src/include/video_layer.h:46: error: expected ‘;’ before ‘*’ token
../src/include/video_layer.h:47: error: ISO C++ forbids declaration of ‘AVInputFormat’ with no type
../src/include/video_layer.h:47: error: expected ‘;’ before ‘*’ token
../src/include/video_layer.h:48: error: ISO C++ forbids declaration of ‘AVFormatContext’ with no type
../src/include/video_layer.h:48: error: expected ‘;’ before ‘*’ token
../src/include/video_layer.h:49: error: ISO C++ forbids declaration of ‘AVStream’ with no type
../src/include/video_layer.h:49: error: expected ‘;’ before ‘*’ token
../src/include/video_layer.h:50: error: ISO C++ forbids declaration of ‘AVPicture’ with no type
../src/include/video_layer.h:50: error: expected ‘;’ before ‘*’ token
../src/include/video_layer.h:51: error: ‘AVPacket’ does not name a type
../src/include/video_layer.h:52: error: ISO C++ forbids declaration of ‘AVCodecContext’ with no type
../src/include/video_layer.h:52: error: expected ‘;’ before ‘*’ token
../src/include/video_layer.h:53: error: ISO C++ forbids declaration of ‘AVCodec’ with no type
../src/include/video_layer.h:53: error: expected ‘;’ before ‘*’ token
../src/include/video_layer.h:54: error: ‘AVFrame’ does not name a type
../src/include/video_layer.h:100: error: ‘AVPicture’ has not been declared
../src/include/video_layer.h:103: error: ‘AVPicture’ has not been declared
../src/include/video_layer.h:104: error: ‘AVPicture’ has not been declared
make[3]: ** [freej.o] Erro 1
make[3]: Saindo do diretório `/home/livre/Desktop/AUR/freej/src/freej-0.10/src'
make[2]: ** [all-recursive] Erro 1
make[2]: Saindo do diretório `/home/livre/Desktop/AUR/freej/src/freej-0.10/src'
make[1]: ** [all-recursive] Erro 1
make[1]: Saindo do diretório `/home/livre/Desktop/AUR/freej/src/freej-0.10'
make: ** [all] Erro 2
==> ERRO: Compilação Falhou.
    Abortando...
it is probably a gcc version problem, but i could make a patch. i just need to know what to type.

cheers
 
Old 12-05-2008, 11:05 AM   #2
weibullguy
ReliaFree Maintainer
 
Registered: Aug 2004
Location: Kalamazoo, Michigan
Distribution: Slackware 14.2
Posts: 2,815
Blog Entries: 1

Rep: Reputation: 261Reputation: 261Reputation: 261
Those undeclared AV's are defined by ffmpeg. Do you have ffmpeg installed including the development files? If so, it may be too new. ffmpeg used to install its headers in /usr/include/ffmpeg, but that has changed to /usr/include/libavcodec. I don't know when it changed, I only know that I had problems recently trying to build a package against ffmpeg.

Looking at the freej file video_layer.h I see the following
Code:
#include <ffmpeg/avcodec.h>
#include <ffmpeg/avformat.h>
If I'm remembering the chronological order of the ffmpeg header paths, it looks like freej hasn't been updated to reflect the newer ffmpeg paths.

Last edited by weibullguy; 12-05-2008 at 11:07 AM.
 
Old 12-05-2008, 11:47 AM   #3
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,511

Rep: Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641
If you look at the lines, where the errors start,
you will see : missing avcodec.h, avformat.h,
swscale.h

It might be solved by running the 'autogen.sh'
to make a better 'configure'
EDIT. : No, 'autogen.sh' didn't solve that
problem, but solved issues appearing later.

Lines 25,26,28 in freej-x.x/src/include/video_layer.h
can be edited to

#include <libavcodec/avcodec.h>
#include <libavformat/avformat.h>
#include <libswscale/swscale.h>

All depending on your ffmpeg, could also be
like #2, by weibullguy.

You will also need fftw-3 and swig, which are
not asked for in 'configure'

The executeable 'freej' will look for libs in
/usr/lib only, so it might be an idea to have
"--prefix=/usr"

The above was made on Slackware 12.1
....

Last edited by knudfl; 12-05-2008 at 12:36 PM.
 
Old 12-05-2008, 03:02 PM   #4
weibullguy
ReliaFree Maintainer
 
Registered: Aug 2004
Location: Kalamazoo, Michigan
Distribution: Slackware 14.2
Posts: 2,815
Blog Entries: 1

Rep: Reputation: 261Reputation: 261Reputation: 261
Quote:
Originally Posted by knudfl View Post
If you look at the lines, where the errors start,
you will see : missing avcodec.h, avformat.h,
swscale.h
You must have actually tried to build freej because I don't see those in the OP's post. Or am I completely losing it?
Quote:
Originally Posted by knudfl View Post
The executeable 'freej' will look for libs in
/usr/lib only, so it might be an idea to have
--prefix=/usr
Passing --prefix=/usr to the configure script sets the prefix that freej will be installed in, not the prefix for freej to look for libraries when it is linking.
 
Old 12-05-2008, 03:46 PM   #5
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,511

Rep: Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641
weibullguy : add.1 Yes, I have build freej on slack 12.1.

add.2 If freej is build for /usr/local/, default prefix,
it will refuse to see its own lib = 'libfreej.so.0'

So I just linked it to /usr/lib
....
 
Old 12-06-2008, 06:36 AM   #6
weibullguy
ReliaFree Maintainer
 
Registered: Aug 2004
Location: Kalamazoo, Michigan
Distribution: Slackware 14.2
Posts: 2,815
Blog Entries: 1

Rep: Reputation: 261Reputation: 261Reputation: 261
Do you have /usr/local/lib in your /etc/ld.so.conf? If so, freej should find its own library once ldconfig is executed (usually executed by the install target, but not always). If not, add it and execute ldconfig, then freej should pick up its library in /usr/local. However, there's nothing wrong with putting it in /usr.
 
Old 12-07-2008, 05:04 AM   #7
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,511

Rep: Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641
Quote:
/usr/local/lib in your /etc/ld.so.conf?
No, sorry, weibullguy, that's not the issue,
have seen it a couple of times over the last
6 years, had one yesterday too, 'midori' on
Debian Lenny.

/usr/local/lib is in ld.so.conf on both OS.
....

Last edited by knudfl; 12-07-2008 at 10:36 AM.
 
Old 12-07-2008, 04:52 PM   #8
osc~
Member
 
Registered: Apr 2007
Location: brazil
Distribution: Arch Linux
Posts: 70

Original Poster
Rep: Reputation: 15
i did as knudfl recomended. but now i reached to this stage.
as far as i know img_convert is deprecated and now it uses swscale.

Code:
video_layer.o: In function `VideoLayer::feed()':
video_layer.cpp:(.text+0x9a9): undefined reference to `img_convert'
collect2: ld returned 1 exit status
make[3]: ** [freej] Erro 1
make[3]: Saindo do diretório `/home/livre/Desktop/AUR/freej/src/freej-0.10/src'
make[2]: ** [all-recursive] Erro 1
make[2]: Saindo do diretório `/home/livre/Desktop/AUR/freej/src/freej-0.10/src'
make[1]: ** [all-recursive] Erro 1
make[1]: Saindo do diretório `/home/livre/Desktop/AUR/freej/src/freej-0.10'
make: ** [all] Erro 2
==> ERRO: Compilação Falhou.
    Abortando...
so, how do i go about it now???


thanks, cheers!!
 
Old 12-07-2008, 06:49 PM   #9
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,511

Rep: Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641
1) Did you do './autogen.sh' ??

2) Which gcc is used ? '4.3.x' ?
Can be found with 'gcc -v'
 
Old 12-08-2008, 04:57 AM   #10
osc~
Member
 
Registered: Apr 2007
Location: brazil
Distribution: Arch Linux
Posts: 70

Original Poster
Rep: Reputation: 15
yes i did use ./autogen and ./configure --prefix=/usr

gcc -v
Code:
Using built-in specs.
Target: i686-pc-linux-gnu
Configured with: ../configure --prefix=/usr --enable-shared --enable-languages=c,c++,fortran,objc,obj-c++,treelang --enable-threads=posix --mandir=/usr/share/man --infodir=/usr/share/info --enable-__cxa_atexit --disable-multilib --libdir=/usr/lib --libexecdir=/usr/lib --enable-clocale=gnu --disable-libstdcxx-pch --with-tune=generic
Thread model: posix
gcc version 4.3.2 (GCC)
 
Old 12-08-2008, 12:45 PM   #11
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,511

Rep: Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641
I'd guess, it's a gcc 4.3 problem, or more correct : the
freej code has not yet been fixed, to be used with 4.3.x

Suggest : Set up 'gcc-4.2.3' and 'g++-4.2.3' ,
then use something like
'CC=gcc-4.2.3 CXX=g++-4.2.3 ./configure --prefix=/usr'
to configure freej. (no problem having more than 1 compiler)
Replace with actual names, ( see 'ls /usr/bin | grep g++' ,
etc. ) to use the "new" compiler.

Don't know if it is necessary, but you can do likewise
with 'make' : 'CC=gcc-4.2.3 CXX=g++-4.2.3 make'
....

Last edited by knudfl; 12-08-2008 at 12:57 PM.
 
Old 12-09-2008, 07:53 AM   #12
osc~
Member
 
Registered: Apr 2007
Location: brazil
Distribution: Arch Linux
Posts: 70

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by knudfl View Post
I'd guess, it's a gcc 4.3 problem, or more correct : the
freej code has not yet been fixed, to be used with 4.3.x

Suggest : Set up 'gcc-4.2.3' and 'g++-4.2.3' ,
then use something like
'CC=gcc-4.2.3 CXX=g++-4.2.3 ./configure --prefix=/usr'
to configure freej. (no problem having more than 1 compiler)
Replace with actual names, ( see 'ls /usr/bin | grep g++' ,
etc. ) to use the "new" compiler.

Don't know if it is necessary, but you can do likewise
with 'make' : 'CC=gcc-4.2.3 CXX=g++-4.2.3 make'
....
hmm seems to be a bit complicated for me.

but couldnt it be just a problem with ffmpeg's img_convert?

thanks for the help
 
Old 12-10-2009, 11:18 AM   #13
mjsurette
Member
 
Registered: May 2005
Distribution: spiral, fedora
Posts: 65

Rep: Reputation: 18
Quote:
Originally Posted by osc~ View Post
i did as knudfl recomended. but now i reached to this stage.
as far as i know img_convert is deprecated and now it uses swscale.

Code:
video_layer.o: In function `VideoLayer::feed()':
video_layer.cpp:(.text+0x9a9): undefined reference to `img_convert'
collect2: ld returned 1 exit status
make[3]: ** [freej] Erro 1
make[3]: Saindo do diretório `/home/livre/Desktop/AUR/freej/src/freej-0.10/src'
make[2]: ** [all-recursive] Erro 1
make[2]: Saindo do diretório `/home/livre/Desktop/AUR/freej/src/freej-0.10/src'
make[1]: ** [all-recursive] Erro 1
make[1]: Saindo do diretório `/home/livre/Desktop/AUR/freej/src/freej-0.10'
make: ** [all] Erro 2
==> ERRO: Compilação Falhou.
    Abortando...
so, how do i go about it now???


thanks, cheers!!
An undefined reference is a linker error. It can't find the library or object file which contains 'img_convert'

Check your library locations in your './configure'

Mike
 
  


Reply

Tags
freej



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
compile error: expected ‘;’ before ‘*’ token osc~ Linux - Software 2 12-05-2008 08:52 AM
Error Token 13585 kaplan71 Linux - Software 0 03-15-2007 08:38 AM
Many errors when 'make'ing (example: error: syntax error before `::' token) darkblade Linux - Software 5 03-02-2005 03:00 PM
authentication token manipulation error abuelmaati Linux - Newbie 3 02-04-2005 07:21 AM
Undecodable token error ?? Thymox Linux - General 3 11-18-2002 06:11 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 09:08 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration