Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

compilation issue with windows #5

Open
fmichonneau opened this issue Dec 1, 2014 · 1 comment
Open

compilation issue with windows #5

fmichonneau opened this issue Dec 1, 2014 · 1 comment

Comments

@fmichonneau
Copy link

These lines:
https://github.com/mtholder/ncl/blob/master/ncl/nxstaxablock.cpp#L278-280

are causing issue when compiling NCL under windows (specifically using the winbuilder tool for R packages):

g++ -m64 -I"D:/RCompile/recent/R/include"            -I"d:/RCompile/CRANpkg/lib/3.2/Rcpp/include" -I"d:/Rcompile/CRANpkg/extralibs215/local215/include"  -I. -DHAVE_INTTYPES_H -DASSERTS_TO_EXCEPTIONS   -O3 -Wall  -mtune=core2            -c nxstaxablock.cpp -o nxstaxablock.o
nxstaxablock.cpp: In member function 'void NxsTaxaBlock::CheckCapitalizedTaxonLabel(const string&) const':
nxstaxablock.cpp:279:54: error: ambiguous overload for 'operator<<' in 'e.NxsString::operator<<(((const char*)"Number of stored labels (")) << ((const NxsTaxaBlock*)this)->NxsTaxaBlock::taxLabels.std::vector<_Tp, _Alloc>::size [with _Tp = NxsString, _Alloc = std::allocator<NxsString>, std::vector<_Tp, _Alloc>::size_type = long long unsigned int]()'
nxstaxablock.cpp:279:54: note: candidates are:
./ncl/nxsstring.h:617:19: note: NxsString& NxsString::operator<<(int)
./ncl/nxsstring.h:626:19: note: NxsString& NxsString::operator<<(unsigned int)
./ncl/nxsstring.h:635:19: note: NxsString& NxsString::operator<<(long int)
./ncl/nxsstring.h:644:19: note: NxsString& NxsString::operator<<(long unsigned int)
./ncl/nxsstring.h:653:19: note: NxsString& NxsString::operator<<(double)
./ncl/nxsstring.h:662:19: note: NxsString& NxsString::operator<<(const char*) <near match>
./ncl/nxsstring.h:662:19: note:   no known conversion for argument 1 from 'std::vector<NxsString>::size_type {aka long long unsigned int}' to 'const char*'
./ncl/nxsstring.h:671:19: note: NxsString& NxsString::operator<<(char)
./ncl/nxsstring.h:680:19: note: NxsString& NxsString::operator<<(const string&) <near match>
./ncl/nxsstring.h:680:19: note:   no known conversion for argument 1 from 'std::vector<NxsString>::size_type {aka long long unsigned int}' to 'const string& {aka const std::basic_string<char>&}'
make: *** [nxstaxablock.o] Error 1
@mtholder
Copy link
Owner

mtholder commented Dec 1, 2014

hmm. that looks ominous (in the sense that defeating the error might lead you to encounter several similar ones; it looks like this compiler is quite picky...

I'd suggest an explicit cast:

e << "Number of stored labels (" << (long unsigned int) taxLabels.size() << ") exceeds the NTax specified (" << dimNTax<<").";

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants