Jump to content
  • 0

Compile in Linux


Question

Posted

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?

4 answers to this question

Recommended Posts

Posted

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)

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.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...