By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
458,107 Members | 1,392 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 458,107 IT Pros & Developers. It's quick & easy.

Compile Error

P: n/a
I am on a Solaris 10 6/06 SPARC machine. I tried to compile sound player
app for Asterisk and got the following error:

Can someone provide an explanation or work around? Thanks!

xxdev2:12:24:/opt/sft/voip/asterisk-addons-1.2.5/format_mp3gmake
gcc -pipe -fPIC -Wall -Wstrict-prototypes -Wmissing-prototypes
-Wmissing-declarations -D_REENTRANT -D_GNU_SOURCE -O6
-I/usr/include/ -I/u01/app/oracle/product/primary/rdbms/public/
-I/usr/local/include -I/usr/local/openldap/include
-I/usr/local/BerkeleyDB.4.4/include -I/usr/local/ssl/include
-I/usr/local/imap-2006a/include -I/usr/local/pgsql/include
-I/usr/local/mysql/include/mysql/include -I/opt/asterisk/usr/include -c
-o format_mp3.o format_mp3.c
In file included from /opt/asterisk/usr/include/asterisk/channel.h:109,
from format_mp3.c:21:
/opt/asterisk/usr/include/asterisk/frame.h:289: error: syntax error
before 'u_int16_t'
/opt/asterisk/usr/include/asterisk/frame.h:289: warning: no semicolon at
end of struct or union
/opt/asterisk/usr/include/asterisk/frame.h:299: warning: type defaults
to 'int' in declaration of 'data'
/opt/asterisk/usr/include/asterisk/frame.h:299: warning: data definition
has no type or storage class
/opt/asterisk/usr/include/asterisk/frame.h:300: error: syntax error
before '}' token
In file included from format_mp3.c:21:
/opt/asterisk/usr/include/asterisk/channel.h: In function 'ast_select':
/opt/asterisk/usr/include/asterisk/channel.h:1159: warning: implicit
declaration of function 'timersub'
gmake: *** [format_mp3.o] Error 1
Offending lines of code:

struct ast_option_header {
/* Always keep in network byte order */
#if __BYTE_ORDER == __BIG_ENDIAN
u_int16_t flag:3;
u_int16_t option:13;
#else
#if __BYTE_ORDER == __LITTLE_ENDIAN
u_int16_t option:13;
u_int16_t flag:3;
#else
#error Byte order not defined
#endif
#endif
u_int8_t data[0];
}; //line 300 frame.h

GCC version:

xxdev2:12:24:/opt/sft/voip/asterisk-addons-1.2.5/format_mp3gcc -v
Using built-in specs.
Target: sparc-sun-solaris2.10
Configured with:
/net/tibia/export/bldmstr/nightly/20060817_mars_gcc.s10.opt.tarbuild/src/configure
--prefix=/opt/gcc --enable-shared --with-system-zlib
--enable-checking=release --disable-libmudflap --enable-languages=c,c++
--enable-version-specific-runtime-libs
--with-gxx-include-dir=/opt/gcc/include/c++/4.0.3 --with-cpu=v9
Thread model: posix
gcc version 4.0.3 (gccfss)
Dec 13 '06 #1
Share this Question
Share on Google+
3 Replies


P: n/a
Did you include stdint.h?

Dec 13 '06 #2

P: n/a


On Wed, 13 Dec 2006, Mikail Dellovich wrote:
I am on a Solaris 10 6/06 SPARC machine. I tried to compile sound player app
for Asterisk and got the following error:

Can someone provide an explanation or work around? Thanks!

xxdev2:12:24:/opt/sft/voip/asterisk-addons-1.2.5/format_mp3gmake
gcc -pipe -fPIC -Wall -Wstrict-prototypes -Wmissing-prototypes
-Wmissing-declarations -D_REENTRANT -D_GNU_SOURCE -O6 -I/usr/include/
-I/u01/app/oracle/product/primary/rdbms/public/ -I/usr/local/include
-I/usr/local/openldap/include -I/usr/local/BerkeleyDB.4.4/include
-I/usr/local/ssl/include -I/usr/local/imap-2006a/include
-I/usr/local/pgsql/include -I/usr/local/mysql/include/mysql/include
-I/opt/asterisk/usr/include -c -o format_mp3.o format_mp3.c
In file included from /opt/asterisk/usr/include/asterisk/channel.h:109,
from format_mp3.c:21:
/opt/asterisk/usr/include/asterisk/frame.h:289: error: syntax error before
'u_int16_t'
/opt/asterisk/usr/include/asterisk/frame.h:289: warning: no semicolon at end
of struct or union
/opt/asterisk/usr/include/asterisk/frame.h:299: warning: type defaults to
'int' in declaration of 'data'
/opt/asterisk/usr/include/asterisk/frame.h:299: warning: data definition has
no type or storage class
/opt/asterisk/usr/include/asterisk/frame.h:300: error: syntax error before
'}' token
In file included from format_mp3.c:21:
/opt/asterisk/usr/include/asterisk/channel.h: In function 'ast_select':
/opt/asterisk/usr/include/asterisk/channel.h:1159: warning: implicit
declaration of function 'timersub'
gmake: *** [format_mp3.o] Error 1
Offending lines of code:

struct ast_option_header {
/* Always keep in network byte order */
#if __BYTE_ORDER == __BIG_ENDIAN
u_int16_t flag:3;
u_int16_t option:13;
#else
#if __BYTE_ORDER == __LITTLE_ENDIAN
u_int16_t option:13;
u_int16_t flag:3;
#else
#error Byte order not defined
#endif
#endif
u_int8_t data[0];
}; //line 300 frame.h
<snip>

I suppose the problem is that the compiler could not find a definition of
the u_int16_t type. A workaround would be to add an appropriate definition
of u_int16_t before the usage. As far as I know, Solaris defines the
uint16_t type (notice the missing underscore between after 'u'). So adding
the following lines before the definition of struct ast_option_header
might help:

#include <stdint.h>

typedef uint8_t u_int8_t;
typedef uint16_t u_int16_t;

You should bracket the definitions with a platform-specific
#ifdef / #endif

Posting to a Solaris specific programming group might help as well.

Emil

Dec 13 '06 #3

P: n/a
dc*****@connx.com writes:
Did you include stdint.h?
stdint.h will not (should not) help with u_int16_t, because
that's not a standard name. I bet you're thinking of uint16_t.
--
"Given that computing power increases exponentially with time,
algorithms with exponential or better O-notations
are actually linear with a large constant."
--Mike Lee
Dec 13 '06 #4

This discussion thread is closed

Replies have been disabled for this discussion.