Linux - SoftwareThis 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.
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
I am using Ubuntu 6.06, and am trying to install some new software. For example, one program I am trying to install is Baduki, a Go program. I untarred the tar.gz into /usr/local/src, cd'd to the new directory and entered ./configure. Everything configured smoothly, but when I try to 'make' it gives me a series of identical errors reading "patternsdat.h:400: error: initializer-string for array of chars is too long". After this it halts the make, and I can go no further. It pretty much does this when I try to make any piece of software. It is rather frustrating. I dunno if it makes a difference, but I had to apt-get the basic compiler packs (can't remember the pkg name at the moment) before I could even attempt this, as Ubuntu does not seem to come with gcc or anything of the sort.
Anyway, I would very much appreciate any help.
Look for a file named patternsdat.h and look at line 400.
It's a little odd that something would be initialized in a header file in C (though C++ developers don't seem to mind), but hopefully you will see something like this:
char variable = "abcd";
I think that would compile with no error with compiler gcc 2.9x. But recent versions of gcc have gotten very good at catching all manner of even insignificant errors.
If it is something as simple as my example, you can just change the 4 to a 5. But it's probably not that simple.
You could post it here and ask for comments. There may be a switch you can put in an environment variable and pass to configure or make to ignore the error. If you are desparate, you could see if there is an older version of gcc available.
Thanks for the response. I checked out line 400 (I am familiar with C to an extent, but it has been a while) and expected to find something simple. But as it turns out, line 400 is the final line in the file, containing only "};". At the top of the document there was a comment saying it was generated automatically by ./patterns.h, so I think I will check that out.
Do you think perhaps there is a problem with defining the variable indirectly like that? I tried replacing pat[MAX_PATTERN_SIZE] with pat and just getting rid of the line defining MAX_PATTERN_SIZE, but it gave me the same error messages when I tried to build it again. Any ideas?
In this example, there are exactly 36 characters in the array of 36 characters. But that leaves no room for the terminating NUL character that the compiler automatically adds to strings. Increasing the array size to 37 would give the needed space.