The UNIX Forums
"Join the Network of UNIX System Users"


 
Subject: compiling in solaris
bochgoch
Newbie
Rank: 1



UID 73
Digest Posts 0
Credits 0
Posts 56
Reading Access 10
Registered Apr 25, 2007
Status Offline
Post at Jun 2, 2007 10:25 AM  Profile | P.M. 
compiling in solaris



compiling in solaris



hi,

i'm new to unix. i'm trying to compile a shared library in solaris running on x86. i get "void value not ignored as it ought to be" error when trying "make". but it compiles fine in fedora. how can this happen? i think both are using the same type of compiler. what can i do to get around this?

thanks

i think its due to differences in the compilers. however i was able to resolve some of the errors by modifying the source. now i get the following errors:

in file included from lm-socket.c:26:
/usr/include/arpa/nameser.h:124: error: syntax error before '*' token
/usr/include/arpa/nameser.h:126: error: syntax error before '*' token
/usr/include/arpa/nameser.h:129: error: syntax error before '*' token
/usr/include/arpa/nameser.h:130: error: syntax error before '}' token
/usr/include/arpa/nameser.h:148: error: syntax error before "uint16_t"

/usr/include/arpa/nameser.h:150: error: syntax error before "ttl"
/usr/include/arpa/nameser.h:151: error: syntax error before "rdlength"
/usr/include/arpa/nameser.h:152: error: syntax error before '*' token
/usr/include/arpa/nameser.h:153: error: syntax error before '}' token
/usr/include/arpa/nameser.h:233: error: syntax error before "uint8_t"
/usr/include/arpa/nameser.h:235: error: syntax error before "r_class"
/usr/include/arpa/nameser.h:236: error: syntax error before "r_type"
/usr/include/arpa/nameser.h:237: error: syntax error before "r_ttl"
/usr/include/arpa/nameser.h:238: error: syntax error before '*' token
/usr/include/arpa/nameser.h:239: error: syntax error before "r_size"
.
.
.

is there a way to avoid the above errors?

thanks


last edited by runnerb : 03-22-2007 at 01:04 am. reason: new errors


Top
forumrating
Newbie
Rank: 1



UID 149
Digest Posts 0
Credits 0
Posts 113
Reading Access 10
Registered Apr 25, 2007
Status Offline
Post at Jun 2, 2007 10:25 AM  Profile | P.M. 
does anyone know how to resolve this?
Top
MassBile
Newbie
Rank: 1



UID 253
Digest Posts 0
Credits 0
Posts 20
Reading Access 10
Registered Apr 25, 2007
Status Offline
Post at Jun 2, 2007 10:25 AM  Profile | P.M. 
quote:
modifying the source.



that's usually a clue!
unless you know what you are doing  

i suggest cut back to the original and start again.
Top
htmlindex
Newbie
Rank: 1



UID 178
Digest Posts 0
Credits 0
Posts 22
Reading Access 10
Registered Apr 25, 2007
Status Offline
Post at Jun 2, 2007 10:26 AM  Profile | P.M. 
actually i just removed some assignment operations so the above mentioned error wouldn't come up. cos the compiler says the code haven't ignored a void. so i don't think thats the problem. here, the compiler generates a syntax error which is part of a common library api. some say for some versions of glibc this error occurs when trying to compile network related libraries. i cannot download the latest version of glibc right now cos our network doesn't allow downloads larger than 5mb. but i can find a way to do that if there's some hope in doing it. is there anyone who had a similar experience?
Top
EV1L
Newbie
Rank: 1



UID 139
Digest Posts 0
Credits 0
Posts 28
Reading Access 10
Registered Apr 25, 2007
Status Offline
Post at Jun 2, 2007 10:26 AM  Profile | P.M. 
as a guess, you have header problems - with the "void" thing. the other errors are just from program changes.

semantics of some calls change - grep for "xopen_source" and "gnu_source" and "posix_source". then consult the gcc info page on the solaris box to see what you have set if any of the above are in a "#define" statement.

it would also help a lot if you posted a few lines of code where the error occurs.
gcc will point on the line number and module name with the problem.
Top
dcristo
Newbie
Rank: 1



UID 109
Digest Posts 0
Credits 0
Posts 36
Reading Access 10
Registered Apr 25, 2007
Status Offline
Post at Jun 2, 2007 10:26 AM  Profile | P.M. 
oh. and unix is not windows. each "flavor" has differences, though not usually in posix (posix 1b is the ieee's version of what unix base standard ought to be) system calls or in standard library calls. and linux (fc 5, e.g.) is not always posix compliant. you can't just assume code that compiles on unix flavor a will automatically compile on unix flavor b. gnu extensions to c are definitely not
Top
@X-I-N@
Newbie
Rank: 1



UID 33
Digest Posts 0
Credits 0
Posts 41
Reading Access 10
Registered Apr 25, 2007
Status Offline
Post at Jun 2, 2007 10:26 AM  Profile | P.M. 
ok thanks for the info. i did grep for it. it doesn't contain anything for those words. the line that gives the error is given as:

#include <arpa/nameser.h>

here are the lines in arpa/nameser.h:

typedef struct __ns_msg {
const uchar_t *_msg, *_eom; //line 124 where the first error occurs
uint16_t _id, _flags, _counts[ns_s_max];
const uchar_t *_sections[ns_s_max];
ns_sect _sect;
int _rrnum;
const uchar_t *_msg_ptr;
Top
kapengbarako
Newbie
Rank: 1



UID 212
Digest Posts 0
Credits 0
Posts 44
Reading Access 10
Registered Apr 25, 2007
Status Offline
Post at Jun 2, 2007 10:26 AM  Profile | P.M. 
back to square one. when you get errors in header files like this, it almost always means one of these things:

1. one of the defines like _posix_source is "on" for one header file and "off" for another. it doesn't have to be one of those switches i listed for you. solaris has its own switches. i chose those because they are most likely to have caused a problem.

2. somewhere in the code you wrote there is a conflicting declaration of the same object. or a redefintion that conflicts.

does the makefile use -d to define something?

if you can, try to compile everything with gcc -e. this produces cpp output - it will show you all of the "stuff" from all the header files. redirect gcc -e output to a file and grep for "ns_msg".
Top
dvirhazout
Newbie
Rank: 1



UID 127
Digest Posts 0
Credits 0
Posts 48
Reading Access 10
Registered Apr 25, 2007
Status Offline
Post at Jun 2, 2007 10:26 AM  Profile | P.M. 
quote:
originally posted by jim mcnamara
back to square one. when you get errors in header files like this, it almost always means one of these things:

1. one of the defines like _posix_source is "on" for one header file and "off" for another. it doesn't have to be one of those switches i listed for you. solaris has its own switches. i chose those because they are most likely to have caused a problem.

2. somewhere in the code you wrote there is a conflicting declaration of the same object. or a redefintion that conflicts.

does the makefile use -d to define something?

if you can, try to compile everything with gcc -e. this produces cpp output - it will show you all of the "stuff" from all the header files. redirect gcc -e output to a file and grep for "ns_msg".



can you tell me how to do that? i changed the cc switch in the makefile to gcc -e but it doesnt seem to have no effect. btw cpp switch already has gcc -e. how do i redirect the output of gcc -e? do u mean redirecting the output of make?
Top
 

 

All times are GMT, the time now is Jul 31, 2010 03:23 AM

Powered by Discuz! 5.0.0  © 2001-2006 UNIX Forums
Processed in 0.006723 second(s), 8 queries

Clear Cookies - Contact Us - UNIX Help - Archiver - WAP