• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Linux Error compilation

Natan Beckman

Well-Known Member
Joined
Aug 1, 2010
Messages
548
Reaction score
52
Location
Teresina-PI/Br
Code:
otserv.cpp: In function âvoid otserv(StringVec, ServiceManager*)â:
otserv.cpp:580:40: error: suggest parentheses around assignment used as truth value [-Werror=parentheses]
if(result = db->storeQuery(query.str()))
                                        ^
otserv.cpp:588:55: error: suggest parentheses around assignment used as truth value [-Werror=parentheses]
  if(result_ = db->storeQuery(query_playeritems.str()))
                                                      ^
otserv.cpp:607:60: error: suggest parentheses around assignment used as truth value [-Werror=parentheses]
  if(result_ = db->storeQuery(query_playerdepotitems.str()))
                                                            ^
otserv.cpp:626:53: error: suggest parentheses around assignment used as truth value [-Werror=parentheses]
  if(result_ = db->storeQuery(query_tileitems.str()))
                                                    ^
cc1plus: all warnings being treated as errors
make[1]: *** [otserv.o] Error 1
make[1]: *** Waiting for unfinished jobs....
make[1]: Leaving directory `/home/teste'
make: *** [all] Error 2
root@ns4010900:/home/teste#


Does anyone have any idea?
 
Looks like you got 1 extra paranthese around those functions, try removing them on lines 588, 607, 626 and see if it works.
 
Looks like you got 1 extra paranthese around those functions, try removing them on lines 588, 607, 626 and see if it works.
Code:
otserv.cpp:580:40: error: suggest parentheses around assignment used as truth value [-Werror=parentheses]
if(result = db->storeQuery(query.str()))
                                        ^
otserv.cpp:589:3: error: expected â)â before â{â token
  {
  ^
otserv.cpp:604:27: error: suggest parentheses around assignment used as truth value [-Werror=parentheses]
  query_playeritems.clear();
                          ^
otserv.cpp:604:28: error: suggest braces around empty body in an âifâ statement [-Werror=empty-body]
  query_playeritems.clear();
                            ^
otserv.cpp:608:3: error: expected â)â before â{â token
  {
  ^
otserv.cpp:623:32: error: suggest parentheses around assignment used as truth value [-Werror=parentheses]
  query_playerdepotitems.clear();
                                ^
otserv.cpp:623:33: error: suggest braces around empty body in an âifâ statement [-Werror=empty-body]
  query_playerdepotitems.clear();
                                ^
otserv.cpp:627:3: error: expected â)â before â{â token
  {
  ^
otserv.cpp:639:25: error: suggest parentheses around assignment used as truth value [-Werror=parentheses]
  query_tileitems.clear();
                        ^
otserv.cpp:639:26: error: suggest braces around empty body in an âifâ statement [-Werror=empty-body]
  query_tileitems.clear();
                          ^
cc1plus: all warnings being treated as errors
make[1]: *** [otserv.o] Error 1
make[1]: *** Waiting for unfinished jobs....
make[1]: Leaving directory `/home/teste'
make: *** [all] Error 2
root@ns4010900:/home/teste#

I compiled on windows I had no problem and everything worked normal!
 
You can change the settings so that warnings aren't treated as errors.
Better would be to fix the "errors" by adding extra parentheses around the assignments.
Example:

Replace
Code:
if(result = db->storeQuery(query.str()))
With
Code:
if((result = db->storeQuery(query.str())))
 
You can change the settings so that warnings aren't treated as errors.
Better would be to fix the "errors" by adding extra parentheses around the assignments.
Example:

Replace
Code:
if(result = db->storeQuery(query.str()))
With
Code:
if((result = db->storeQuery(query.str())))

Code:
otserv.cpp: In function âvoid otserv(StringVec, ServiceManager*)â:
otserv.cpp:581:41: error: suggest parentheses around assignment used as truth value [-Werror=parentheses]
  if(result = db->storeQuery(query.str())))
                                        ^
otserv.cpp:581:42: error: expected primary-expression before â)â token
  if(result = db->storeQuery(query.str())))
                                          ^
otserv.cpp:581:42: error: expected â;â before â)â token
otserv.cpp:579:7: error: unused variable âduplicatedâ [-Werror=unused-variable]
  bool duplicated = false;
      ^
otserv.cpp:879:1: error: expected â}â at end of input
}
^
otserv.cpp: At global scope:
otserv.cpp:339:6: error: unused parameter âservicesâ [-Werror=unused-parameter]
void otserv(StringVec, ServiceManager* services)
      ^
cc1plus: all warnings being treated as errors
make[1]: *** [otserv.o] Error 1
make[1]: *** Waiting for unfinished jobs....
make[1]: Leaving directory `/home/teste'
make: *** [all] Error 2
root@ns4010900:/home/teste#
 
Code:
otserv.cpp: In function âvoid otserv(StringVec, ServiceManager*)â:
otserv.cpp:581:41: error: suggest parentheses around assignment used as truth value [-Werror=parentheses]
  if(result = db->storeQuery(query.str())))
                                        ^
otserv.cpp:581:42: error: expected primary-expression before â)â token
  if(result = db->storeQuery(query.str())))
                                          ^
otserv.cpp:581:42: error: expected â;â before â)â token
otserv.cpp:579:7: error: unused variable âduplicatedâ [-Werror=unused-variable]
  bool duplicated = false;
      ^
otserv.cpp:879:1: error: expected â}â at end of input
}
^
otserv.cpp: At global scope:
otserv.cpp:339:6: error: unused parameter âservicesâ [-Werror=unused-parameter]
void otserv(StringVec, ServiceManager* services)
      ^
cc1plus: all warnings being treated as errors
make[1]: *** [otserv.o] Error 1
make[1]: *** Waiting for unfinished jobs....
make[1]: Leaving directory `/home/teste'
make: *** [all] Error 2
root@ns4010900:/home/teste#

Yes, you have to add parentheses to all assignments in those if statements.

What's up with the unused variables? Did you add them?
 
Yes, you have to add parentheses to all assignments in those if statements.

What's up with the unused variables? Did you add them?

Code:
make  all-am
make[1]: Entering directory `/home/teste'
  CXX      otserv.o
otserv.cpp: In function âvoid otserv(StringVec, ServiceManager*)â:
otserv.cpp:580:41: error: suggest parentheses around assignment used as truth value [-Werror=parentheses]
  if(result = db->storeQuery(query.str())))
                                        ^
otserv.cpp:580:42: error: expected primary-expression before â)â token
  if(result = db->storeQuery(query.str())))
                                          ^
otserv.cpp:580:42: error: expected â;â before â)â token
otserv.cpp:579:7: error: unused variable âduplicatedâ [-Werror=unused-variable]
  bool duplicated = false;
      ^
otserv.cpp:878:1: error: expected â}â at end of input
}
^
otserv.cpp: At global scope:
otserv.cpp:339:6: error: unused parameter âservicesâ [-Werror=unused-parameter]
void otserv(StringVec, ServiceManager* services)
      ^
cc1plus: all warnings being treated as errors
make[1]: *** [otserv.o] Error 1
make[1]: Leaving directory `/home/teste'
make: *** [all] Error 2
root@ns4010900:/home/teste#
 
Code:
make  all-am
make[1]: Entering directory `/home/teste'
  CXX      otserv.o
otserv.cpp: In function âvoid otserv(StringVec, ServiceManager*)â:
otserv.cpp:580:41: error: suggest parentheses around assignment used as truth value [-Werror=parentheses]
  if(result = db->storeQuery(query.str())))
                                        ^
otserv.cpp:580:42: error: expected primary-expression before â)â token
  if(result = db->storeQuery(query.str())))
                                          ^
otserv.cpp:580:42: error: expected â;â before â)â token
otserv.cpp:579:7: error: unused variable âduplicatedâ [-Werror=unused-variable]
  bool duplicated = false;
      ^
otserv.cpp:878:1: error: expected â}â at end of input
}
^
otserv.cpp: At global scope:
otserv.cpp:339:6: error: unused parameter âservicesâ [-Werror=unused-parameter]
void otserv(StringVec, ServiceManager* services)
      ^
cc1plus: all warnings being treated as errors
make[1]: *** [otserv.o] Error 1
make[1]: Leaving directory `/home/teste'
make: *** [all] Error 2
root@ns4010900:/home/teste#

Code:
if(result = db->storeQuery(query.str())))
to
Code:
if((result = db->storeQuery(query.str())))
 

Similar threads

Back
Top