🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: csu.cs.200
Article #191

Re: Help with aCC compiling errors

#191
From: Adam Carheden
Date: Thu, 01 Oct 1998 00:00
38 lines
1841 bytes
spasm wrote:
> 1. Error (future) 355: "Main3.C", line 46 # Function 'main' must return
> type 'int'.
>     void main()
>          ^^^^

I think Chuck spoke about this in class.  The new standard is for main
to return an int to tell the OS that it has executed successfully.  Just
change void main() to int main() and add return 1; to the end of main. 
(I think 1 means okay, 0 means there was an error.)


> 2. Error 409: "Main3.C", line 128 # Cannot convert a non-lvalue to a
> pointer.
> 
> if(strcmp((LIST_Get(list,j)).name,(LIST_Get(list,index)).name) >
> 0)                        ^^^^^^^^^^^^^^^^^^^^^^
> 
> 3. Error 409: "Main3.C", line 128 # Cannot convert a non-lvalue to a
> pointer.
> 
> if(strcmp((LIST_Get(list,j)).name,(LIST_Get(list,index)).name) >
> 0)
> ^^^^^^^^^^^^^^^^^^^^^^^^^^

I'm not sure that this makes sense for the error, but LIST_Get should
return type LISTdata; make sure it's LISTdata and not a pointer to
LISTdata.  I would think this would have given you errors under CC too
though.

Try compiling with g++ too.  I find that sometimes different compilers
will give more understandable errors.

Good luck.
-- 
Adam
carheden@holly.colostate.edu
http://holly.ColoState.edu/~carheden
Technical Details
Message-ID: <3613BE2F.D8A376D9@holly.colostate.edu>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail
References: <3612620F.C024CCAE@holly.colostate.edu>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 127144,ebc15a71af1aa21f
X-Google-Attributes: gid127144,public
From: Adam Carheden <carheden@holly.colostate.edu>
Subject: Re: Help with aCC compiling errors
Date: 1998/10/01
Message-ID: <3613BE2F.D8A376D9@holly.colostate.edu>
X-Deja-AN: 396757648
Content-Transfer-Encoding: 7bit
References: <3612620F.C024CCAE@holly.colostate.edu>
To: spasm <spasm@holly.colostate.edu>
Content-Type: text/plain; charset=us-ascii
Organization: Colorado State University, Fort Collins, CO  80523
Mime-Version: 1.0
Newsgroups: csu.cs.200