This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Error in polymutt2 tool compilation

Dear all,

I am trying to make genetic map file from vcf using polymutt2 tool. While compiling it by typing make, following error occurs:

  make[1]: Entering directory '/media/tania/TM/polymutt2_v0.2/base' 
g++ -c -O4 -I. -I../third/tabix Argument.cpp In file included from Argument.cpp:1: Argument.h: In member function ‘void ParameterParser::Read(int, char**)’: Argument.h:366:34: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]   
366 |  if (argv[i+1] == '\0') {
          |                                  ^~~~ 
make[1]: *** [Makefile:34: Argument.o] Error 1 
make[1]: Leaving directory '/media/tania/TM/polymutt2_v0.2/base' 
make: *** [Makefile:10: all] Error 2

Kindly help me in resolving the issue. Any help would be highly appreciated.

Thanks in advance!

argument.h vcf2map polymutt2

it's a programming error, the author of this software compares a string/pointer (char*) to a char. 1) tell the author

2) find the file Argument.h and at line 366, replace

if (argv[i+1] == '\0')

with

if (argv[i+1]==NULL || argv[i+1][0]== '\0')

use at you own risk.

I am really grateful to you for your help. I have made changes in argument.h file as per your suggestion. But now i am getting the following error

make[1]: Entering directory '/media/tania/TM/polymutt2_v0.2/base'
g++ -c -O4 -I. -I../third/tabix Argument.cpp
In file included from Argument.cpp:1:
Argument.h: In constructor ‘ParameterParser::ParameterParser()’:
Argument.h:44:15: error: ‘class ParameterParser’ has no member named ‘currentParameterGroupName’
   44 |         this->currentParameterGroupName = "Default Parameter Group";
      |               ^~~~~~~~~~~~~~~~~~~~~~~~~
Argument.h: In member function ‘void ParameterParser::AddParameterGroup(const char*)’:
Argument.h:48:15: error: ‘class ParameterParser’ has no member named ‘currentParameterGroupName’
   48 |         this->currentParameterGroupName = name;
      |               ^~~~~~~~~~~~~~~~~~~~~~~~~
Argument.h: In member function ‘void ParameterParser::AddRemainingArg(void*)’:
Argument.h:51:15: error: ‘class ParameterParser’ has no member named ‘ptrRemainingArg’; did you mean ‘AddRemainingArg’?
   51 |         this->ptrRemainingArg = (std::vector<std::string>*) data;
      |               ^~~~~~~~~~~~~~~
      |               AddRemainingArg
Argument.h: In member function ‘void ParameterParser::AddParameter(ParameterType, void*, const char*, const char*)’:
Argument.h:80:19: error: ‘flagVec’ was not declared in this scope; did you mean ‘flag’?
   80 |         for (it = flagVec.begin(); it != flagVec.end(); it++) {
      |                   ^~~~~~~
      |                   flag
Argument.h:87:34: error: ‘class ParameterParser’ has no member named ‘flagVec’
   87 |         unsigned int idx = this->flagVec.size();
      |                                  ^~~~~~~
Argument.h:88:15: error: ‘class ParameterParser’ has no member named ‘flagVec’
   88 |         this->flagVec.push_back(f);
      |               ^~~~~~~
Argument.h:89:9: error: ‘groupNameFlagIndexMap’ was not declared in this scope
   89 |         groupNameFlagIndexMap[this->currentParameterGroupName].push_back(idx);
      |         ^~~~~~~~~~~~~~~~~~~~~
Argument.h:89:37: error: ‘class ParameterParser’ has no member named ‘currentParameterGroupName’
   89 |         groupNameFlagIndexMap[this->currentParameterGroupName].push_back(idx);
      |                                     ^~~~~~~~~~~~~~~~~~~~~~~~~
Argument.h:93:9: error: ‘flagInfoMap’ was not declared in this scope; did you mean ‘FlagInfo’?
   93 |         flagInfoMap[idx] = fi;
      |         ^~~~~~~~~~~
      |         FlagInfo
Argument.h: In member function ‘void ParameterParser::WriteToFileWithComment(FILE*, const char*)’:
Argument.h:243:45: error: ‘class ParameterParser’ has no member named ‘flagVec’
  243 |         for (unsigned int i = 0; i != this->flagVec.size(); i++){
      |                                             ^~~~~~~
Argument.h:244:34: error: ‘class ParameterParser’ has no member named ‘flagInfoMap’
  244 |             FlagInfo& fi = this->flagInfoMap[i];
      |                                  ^~~~~~~~~~~
Argument.h:254:35: error: ‘flagVec’ was not declared in this scope
  254 |                 fprintf(fp, "%s", flagVec[i].c_str());
      |                                   ^~~~~~~
Argument.h:268:101: error: ‘class ParameterParser’ has no member named ‘flagVec’
  268 |                     fprintf(stderr, "WARNING: Unrecognized parameter type for flag \"%s\"\n", this->flagVec[i].c_str());
      |                                                                                                     ^~~~~~~
Argument.h:274:45: error: ‘class ParameterParser’ has no member named ‘ptrRemainingArg’; did you mean ‘AddRemainingArg’?
  274 |         for (unsigned int i = 0; i != this->ptrRemainingArg->size(); i++) {
      |                                             ^~~~~~~~~~~~~~~
      |                                             AddRemainingArg
Argument.h:279:44: error: ‘class ParameterParser’ has no member named ‘ptrRemainingArg’; did you mean ‘AddRemainingArg’?
  279 |             fprintf(fp, " \"%s\"", (*this->ptrRemainingArg)[i].c_str());
      |                                            ^~~~~~~~~~~~~~~
      |                                            AddRemainingArg
Argument.h: In member function ‘void ParameterParser::Read(int, char**)’:
Argument.h:292:27: error: ‘class ParameterParser’ has no member named ‘ptrRemainingArg’; did you mean ‘AddRemainingArg’?
  292 |                     this->ptrRemainingArg->push_back(argv[i++]);
      |                           ^~~~~~~~~~~~~~~
      |                           AddRemainingArg
Argument.h:298:23: error: ‘class ParameterParser’ has no member named ‘ptrRemainingArg’; did you mean ‘AddRemainingArg’?
  298 |                 this->ptrRemainingArg->push_back(argv[i]);
      |                       ^~~~~~~~~~~~~~~
      |                       AddRemainingArg
Argument.h:327:23: error: ‘flagVec’ was not declared in this scope; did you mean ‘flag’?
  327 |             for (it = flagVec.begin(); it != flagVec.end(); it++) {
      |                       ^~~~~~~
      |                       flag
Argument.h:333:29: error: ‘class ParameterParser’ has no member named ‘flagVec’
  333 |             if (it == this->flagVec.end()) {
      |                             ^~~~~~~
Argument.h:334:23: error: ‘class ParameterParser’ has no member named ‘ptrRemainingArg’; did you mean ‘AddRemainingArg’?
  334 |                 this->ptrRemainingArg->push_back(argv[i]);
      |                       ^~~~~~~~~~~~~~~
      |                       AddRemainingArg
Argument.h:342:43: error: ‘class ParameterParser’ has no member named ‘flagVec’
  342 |             unsigned int idx = it - this->flagVec.begin();
      |                                           ^~~~~~~
Argument.h:343:19: error: ‘class ParameterParser’ has no member named ‘flagInfoMap’
  343 |             this->flagInfoMap[idx].isLongParam = isLongParam;
      |                   ^~~~~~~~~~~
Argument.h:344:32: error: ‘class ParameterParser’ has no member named ‘flagInfoMap’
  344 |             void* data = this->flagInfoMap[idx].data;
      |                                ^~~~~~~~~~~
Argument.h:345:23: error: ‘class ParameterParser’ has no member named ‘flagInfoMap’
  345 |             if (this->flagInfoMap[idx].isParsed) {
      |                       ^~~~~~~~~~~
In file included from Argument.cpp:1:
Argument.h:348:19: error: ‘class ParameterParser’ has no member named ‘flagInfoMap’
  348 |             this->flagInfoMap[idx].isParsed = true;
      |                   ^~~~~~~~~~~
Argument.h:349:26: error: ‘class ParameterParser’ has no member named ‘flagInfoMap’
  349 |             switch(this->flagInfoMap[idx].pt) {
      |                          ^~~~~~~~~~~
Argument.h:368:19: error: ‘else’ without a previous ‘if’
  368 |                 } else if (argv[i+1][0] == '-' && argv[i+1][1] != '0') {
      |                   ^~~~
Argument.h:374:13: error: case label not within a switch statement
  374 |             default:
      |             ^~~~~~~
Argument.h: In function ‘void Status()’:
Argument.h:395:56: error: invalid use of ‘this’ in non-member function
  395 |         for (unsigned int groupIndex = 0; groupIndex < this->groupNameFlagIndexMap.size(); ++groupIndex){
      |                                                        ^~~~
Argument.h:398:13: error: invalid use of ‘this’ in non-member function
  398 |             this->groupNameFlagIndexMap.at(groupIndex, &k, &v);
      |             ^~~~
Argument.h:409:36: error: invalid use of ‘this’ in non-member function
  409 |                 std::string flag = this->flagVec[idx];
      |                                    ^~~~
Argument.h:410:32: error: invalid use of ‘this’ in non-member function
  410 |                 FlagInfo &fi = this->flagInfoMap[idx];
      |                                ^~~~
Argument.h: In function ‘void Help()’:
Argument.h:477:56: error: invalid use of ‘this’ in non-member function
  477 |         for (unsigned int groupIndex = 0; groupIndex < this->groupNameFlagIndexMap.size(); ++groupIndex){
      |                                                        ^~~~
Argument.h:480:13: error: invalid use of ‘this’ in non-member function
  480 |             this->groupNameFlagIndexMap.at(groupIndex, &k, &v);
      |             ^~~~
Argument.h:487:36: error: invalid use of ‘this’ in non-member function
  487 |                 std::string flag = this->flagVec[idx];
      |                                    ^~~~
Argument.h:488:32: error: invalid use of ‘this’ in non-member function
  488 |                 FlagInfo &fi = this->flagInfoMap[idx];
      |                                ^~~~
Argument.h: At global scope:
Argument.h:509:3: error: expected unqualified-id before ‘private’
  509 |   private:
      |   ^~~~~~~
Argument.h:521:1: error: expected declaration before ‘}’ token
  521 | };
      | ^
make[1]: *** [Makefile:34: Argument.o] Error 1
make[1]: Leaving directory '/media/tania/TM/polymutt2_v0.2/base'
make: *** [Makefile:10: all] Error 2

please help resolve this error. I shall be very thankful.

0 answers

No answers yet.

Log in to answer this question.