Operating System - HP-UX
1832073 Members
3147 Online
110034 Solutions
New Discussion

error 1521: Incorrect initialization

 
SOLVED
Go to solution
mannur
New Member

error 1521: Incorrect initialization

Hi all,

When i am compiling my source with cc i am getting this error,

The source code where i am getting problem is ...
int getLocation(const char* pkg)
{

/* Following is line number 92 where i am getting error Here i am using
pkg variable and getting error.*/

const char* args[] = { "/usr/sbin/swlist", pkg,0};

any help please..

Thanks,
Mannur
3 REPLIES 3
Peter Godron
Honored Contributor
Solution

Re: error 1521: Incorrect initialization

Mannur,
did you have a look at :
http://docs.hp.com/en/7132/errors.html

Looking for "Error 1521":

"An initializer for an object with static storage duration is not a valid constant. Such a constant must be an arithmetic constant expression, a null pointer constant, an address constant, or an address constant plus or minus an integral constant expression".

I think the problem is the passing of pkg into the function.
mannur
New Member

Re: error 1521: Incorrect initialization

Hi,

thanks a lot for your solutions i have got solution by making it non static.

thanks,
Madhava
mannur
New Member

Re: error 1521: Incorrect initialization

Got solution by making variable non static.