Jump to content
  • 0

Compile in Linux


Driw

Question


  • Group:  Members
  • Topic Count:  11
  • Topics Per Day:  0.00
  • Content Count:  28
  • Reputation:   1
  • Joined:  03/18/12
  • Last Seen:  

Hi, I update rAthena last days manually and I have the usual use for (int i =0; ...; i++) but the compilar not accept this. It just accept with I declare int i outside of loop for:

 

error: 'for' loop initial declaration used outside C99 mode

 

 

Someone can help-me to solve this without change all loops for??

In the case, how can I compile in C99 mode?

Link to comment
Share on other sites

4 answers to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  16
  • Topics Per Day:  0.00
  • Content Count:  737
  • Reputation:   216
  • Joined:  11/29/11
  • Last Seen:  

you have to alter ther makefile to tell them to use -std=c99

Or you could use the c99 compiler which is the same. (This is assuming you're using gcc)

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  11
  • Topics Per Day:  0.00
  • Content Count:  28
  • Reputation:   1
  • Joined:  03/18/12
  • Last Seen:  

Where exactly ai add this?

 

map: $(MAP_SQL_DEPENDS)
@$(MAKE) -C -std=c99 src/map sql
 
I'm a noob in linux/makefile e.e sorry
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  16
  • Topics Per Day:  0.00
  • Content Count:  737
  • Reputation:   216
  • Joined:  11/29/11
  • Last Seen:  

you doesn't say much about your system you're using so I can't tell you much neither.

Anyway if you wish to alter the makefile do it in "src/map/Mafefile.in" "src/char/Makefile.in", then rerun ./configure to recreate the Makefile then you could compile.

In Makefile.in

change (where ... = reste of the line)

@@CC@ @LDFLAGS@ ....

@@CC@ @CFLAGS@ ....

into something like

@@CC@ -std=c99 @LDFLAGS@ .....

@@CC@ -std=c99 @CFLAGS@ .....

 

Or assuming you using bash you could also do :

export CC=c99

./configure

...

 

The second option is the fatest and probably the better for you imo. (The second change your default compiler for gcc -std=c99, instead gcc)

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  11
  • Topics Per Day:  0.00
  • Content Count:  28
  • Reputation:   1
  • Joined:  03/18/12
  • Last Seen:  

Thanks for help, I serch this in google but I dont found where put -std=c99 >.< I will test

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...