error: initializer expression list treated as compound expression


 
Thread Tools Search this Thread
Top Forums Programming error: initializer expression list treated as compound expression
# 8  
Old 11-14-2007
1. Where is the error being raised? During compilation of which file, and what line does the line number indicate?

2. Do you have a common header file defining the prototype for "setup_ipc()"?
# 9  
Old 11-14-2007
Also I want to tell that I am using Makefile for compilation of my code and I had created my makefile with the help of qmake tool....

error being raised during compilation......in main.cpp file

and error was in main.cpp indicating line having that function call------->>>>
setup_ipc("msqueue",1234,INPUT_IPC,LARGE_QUEUE);

Also i am using the common header file for defining the prototype of setup_ipc()..
# 10  
Old 11-14-2007
It looked like it was trying to treat setup_ipc as a variable rather than a function.

Do you use

Code:
extern "C" 
{
...
}

around function declarations?
# 11  
Old 11-14-2007
no I hadn't used extern

I had made the change that is :::::::
collecting whatever my function is returning like this::::::::
i=setup_temp_ipc("msqueue",1234,INPUT_IPC,LARGE_QUEUE);

then its compiled correctly without any error....
# 12  
Old 11-15-2007
So what is setup_temp_ipc()? I thought you had a function called setup_ipc().
# 13  
Old 11-16-2007
oh.....sorry thats another function...........

I mean to say that I had used....
i=setup_ipc("msqueue",1234,INPUT_IPC,LARGE_QUEUE);
instead of
just calling ::
setup_ipc("msqueue",1234,INPUT_IPC,LARGE_QUEUE);
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Why Relational Expression is Writing to a Expression?

Hello All, Not sure why this is happening... When the following If Statement is evaluated for some reason it is creating a file in the CWD called '0'. I've seen this happen before, just not in an If Statement... CODE: if then DIR_NAME="$1" DIR_SIZE=0 STATUS="" else... (3 Replies)
Discussion started by: mrm5102
3 Replies

2. UNIX for Advanced & Expert Users

sed: -e expression #1, char 0: no previous regular expression

Hello All, I'm trying to extract the lines between two consecutive elements of an array from a file. My array looks like: problem_arr=(PRS111 PRS213 PRS234) j=0 while } ] do k=`expr $j + 1` sed -n "/${problem_arr}/,/${problem_arr}/p" problemid.txt ---some operation goes... (11 Replies)
Discussion started by: InduInduIndu
11 Replies

3. Shell Programming and Scripting

Getting error in this expression: value of value

HI , I have a variable "TYPE" which may contain different values. and another variable $TYPE"_SOURCE" I am using ${$TYPE"_SOURCE"} to get the value TYPE_SOURCE for eg. TYPE=ABC ABC_SOURCE=/abc/xyz On using above command I am getting error : BAD SUBSTITUTION eval is not installed... (2 Replies)
Discussion started by: aashish.sharma8
2 Replies

4. Programming

Perl: How to read from a file, do regular expression and then replace the found regular expression

Hi all, How am I read a file, find the match regular expression and overwrite to the same files. open DESTINATION_FILE, "<tmptravl.dat" or die "tmptravl.dat"; open NEW_DESTINATION_FILE, ">new_tmptravl.dat" or die "new_tmptravl.dat"; while (<DESTINATION_FILE>) { # print... (1 Reply)
Discussion started by: jessy83
1 Replies

5. Shell Programming and Scripting

Integer expression expected: with regular expression

CA_RELEASE has a value of 6. I need to check if that this is a numeric value. if not error. source $CA_VERSION_DATA if * ] then echo "CA_RELESE $CA_RELEASE is invalid" exit -1 fi + source /etc/ncgl/ca_version_data ++ CA_PRODUCT_ID=samxts ++ CA_RELEASE=6 ++ CA_WEEK_NO=7 ++... (3 Replies)
Discussion started by: ketkee1985
3 Replies

6. Shell Programming and Scripting

if expression syntax error

#! /bin/csh set umr=UMR foreach i ( `ls`) set file_nm=$i set bh_nm=`echo $file_nm | cut -d"_" -f2` if($bh_nm !=$umr) then { set bh_ext=`echo $file_nm | cut -d"_" -f4` set bh_num_nm="$bh_nm $bh_ext a .txt" mv $file_nm $bh_num_nm } ... (1 Reply)
Discussion started by: jdsignature88
1 Replies

7. Shell Programming and Scripting

Error with Expression

Hi All, am trying to add two Inputs i.e., $1 and $2, Code #!/bin/sh $num_sum=`expr $1+$2` echo "Sum = $num_sum" am giving statement sh arithemetic.sh 20 10 am getting error arithemetic.sh: line 2: =20+10: command not found Sum = I want Output as Sum = 30, (5 Replies)
Discussion started by: sunnix
5 Replies

8. Shell Programming and Scripting

One more expression syntax error

HI again, still working on the assignment, which is really hard given we just started unix 4 weeks ago. This script should change the permission for the user depending if its x, w or r, to the opposite. When i try to run it, I am getting expression error. Can you spot where the problem is? I really... (3 Replies)
Discussion started by: morava
3 Replies

9. Shell Programming and Scripting

Regular Expression + Aritmetical Expression

Is it possible to combine a regular expression with a aritmetical expression? For example, taking a 8-numbers caracter sequece and casting each output of a grep, comparing to a constant. THX! (2 Replies)
Discussion started by: Z0mby
2 Replies

10. UNIX for Dummies Questions & Answers

compound expression in unix

I am using the code below to write a command to launch a script only if the number of users on the system is less than 10. The code below isn't working. Any suggestions? HELP.. if && ; then frizzle ; fi (3 Replies)
Discussion started by: spalmer
3 Replies
Login or Register to Ask a Question