tudelft3d / val3dity

Validation of 3D primitives according to the international standard ISO19107
GNU General Public License v3.0
93 stars 24 forks source link

problem running Val3dity as library (in WSL) #172

Closed Lkeurentjes closed 11 months ago

Lkeurentjes commented 1 year ago

When Using Val3dity as a library (in cmakelist.txt as target_link_libraries([projectname] LINK_PUBLIC val3dity)). I get the following error:

/mnt/c/Users/Lisa/Documents/Github/val3dity/thirdparty/tclap/MultiArg.h: At global scope:
/mnt/c/Users/Lisa/Documents/Github/val3dity/thirdparty/tclap/MultiArg.h:228:21: error: expected unqualified-id before ‘const’
228 |         MultiArg<T>(const MultiArg<T>& rhs);
|                     ^~~~~
/mnt/c/Users/Lisa/Documents/Github/val3dity/thirdparty/tclap/MultiArg.h:228:21: error: expected ‘)’ before ‘const’
228 |         MultiArg<T>(const MultiArg<T>& rhs);
|                    ~^~~~~
|                     )

I can easily discard the error by comment the private part of Multiarg.h & Valuearg.h:

//private:

//  /**
//   * Prevent accidental copying
//   */
//  MultiArg<T>(const MultiArg<T>& rhs);
//  MultiArg<T>& operator=(const MultiArg<T>& rhs);
//private:
//       /**
//        * Prevent accidental copying
//        */
//       ValueArg<T>(const ValueArg<T>& rhs);
//       ValueArg<T>& operator=(const ValueArg<T>& rhs);
}

But I cannot find why this error should occur. I run cmakelist on a windows dekstop through WSL. with the following versions used:

Lkeurentjes commented 1 year ago

Expiernced the same issue on a Ubuntu native 22.04.2, find out it has to do with g++-11 version (see this issue).

He solved the bug by: Fixed in [commit] for 1.4, and [commit] for 1.2. So probably Tclap needs to be updated (or maybe in the readme that you need a lower version of g++)

hugoledoux commented 1 year ago

I put v1.2.5 which should fix the issue, can you confirm it works for you?

this branch: https://github.com/tudelft3d/val3dity/tree/tclap-gcc

Lkeurentjes commented 11 months ago

Yes! It works now thanks!