﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc	revision
657	Cannot compile LEMON with MSVC and clang	Máté Lugosi	Alpar Juttner	"Hi! I've been successfully using LEMON in my project in a linux environment using gcc compiler. However when building for windows and macos I've run into the following problems:

- MSVC (Visual C++ 2019):

{{{
2>main.obj : error LNK2019: unresolved external symbol ""public: __cdecl lemon::bits::WinLock::WinLock(void)"" (??0WinLock@bits@lemon@@QEAA@XZ) referenced in function ""public: __cdecl lemon::bits::Lock::Lock(void)"" (??0Lock@bits@lemon@@QEAA@XZ)
2>main.obj : error LNK2019: unresolved external symbol ""public: __cdecl lemon::bits::WinLock::~WinLock(void)"" (??1WinLock@bits@lemon@@QEAA@XZ) referenced in function ""public: __cdecl lemon::bits::Lock::~Lock(void)"" (??1Lock@bits@lemon@@QEAA@XZ)
2>main.obj : error LNK2019: unresolved external symbol ""public: void __cdecl lemon::bits::WinLock::lock(void)"" (?lock@WinLock@bits@lemon@@QEAAXXZ) referenced in function ""protected: void __cdecl lemon::AlterationNotifier<class lemon::DigraphExtender<class lemon::ListDigraphBase>,class lemon::ListDigraphBase::Arc>::attach(class lemon::AlterationNotifier<class lemon::DigraphExtender<class lemon::ListDigraphBase>,class lemon::ListDigraphBase::Arc>::ObserverBase &)"" (?attach@?$AlterationNotifier@V?$DigraphExtender@VListDigraphBase@lemon@@@lemon@@VArc@ListDigraphBase@2@@lemon@@IEAAXAEAVObserverBase@12@@Z)
2>main.obj : error LNK2019: unresolved external symbol ""public: void __cdecl lemon::bits::WinLock::unlock(void)"" (?unlock@WinLock@bits@lemon@@QEAAXXZ) referenced in function ""protected: void __cdecl lemon::AlterationNotifier<class lemon::DigraphExtender<class lemon::ListDigraphBase>,class lemon::ListDigraphBase::Arc>::attach(class lemon::AlterationNotifier<class lemon::DigraphExtender<class lemon::ListDigraphBase>,class lemon::ListDigraphBase::Arc>::ObserverBase &)"" (?attach@?$AlterationNotifier@V?$DigraphExtender@VListDigraphBase@lemon@@@lemon@@VArc@ListDigraphBase@2@@lemon@@IEAAXAEAVObserverBase@12@@Z)
2>main.obj : error LNK2001: unresolved external symbol ""struct lemon::Invalid const lemon::INVALID"" (?INVALID@lemon@@3UInvalid@1@B)
2>D:\Git\mbt-repository\build\Debug\mbt-fw-release.exe : fatal error LNK1120: 5 unresolved externals
}}}

It seems there are some linking issues with LEMON however I was unable to fix the problem.

- Clang 9.0.1

{{{
[build] In file included from /home/oll48/Git/mbt-repository/src/main.cpp:3:
[build] In file included from /home/oll48/Git/mbt-repository/util/Controller.h:30:
[build] In file included from /home/oll48/Git/mbt-repository/lib/EFSMTransformer.h:13:
[build] In file included from /home/oll48/Git/mbt-repository/model/FSM.h:20:
[build] In file included from /home/oll48/Git/mbt-repository/dependencies/lemon/euler.h:24:
[build] In file included from /home/oll48/Git/mbt-repository/dependencies/lemon/connectivity.h:22:
[build] In file included from /home/oll48/Git/mbt-repository/dependencies/lemon/dfs.h:31:
[build] /home/oll48/Git/mbt-repository/dependencies/lemon/path.h:231:24: error: no viable conversion from 'typename PredMapPath<FilterArcs<ListDigraph, ArcMap<bool> >, NodeMap<Arc> >::RevArcIt' to 'std::vector<lemon::ListDigraphBase::Arc, std::allocator<lemon::ListDigraphBase::Arc> >::value_type' (aka 'lemon::ListDigraphBase::Arc')
[build]         head.push_back(it);
[build]                        ^~
[build] /home/oll48/Git/mbt-repository/dependencies/lemon/path.h:1017:12: note: in instantiation of function template specialization 'lemon::Path<lemon::FilterArcs<lemon::ListDigraph, lemon::DigraphExtender<lemon::ListDigraphBase>::ArcMap<bool> > >::buildRev<lemon::PredMapPath<lemon::FilterArcs<lemon::ListDigraph, lemon::DigraphExtender<lemon::ListDigraphBase>::ArcMap<bool> >, lemon::SubDigraphBase<lemon::ListDigraph, lemon::ConstMap<lemon::ListDigraphBase::Node, lemon::Const<bool, true> >, lemon::DigraphExtender<lemon::ListDigraphBase>::ArcMap<bool>, false>::NodeMap<lemon::ListDigraphBase::Arc> > >' requested here
[build]         to.buildRev(from);
[build]            ^
[build] /home/oll48/Git/mbt-repository/dependencies/lemon/path.h:1033:45: note: in instantiation of member function 'lemon::_path_bits::PathCopySelectorBackward<lemon::PredMapPath<lemon::FilterArcs<lemon::ListDigraph, lemon::DigraphExtender<lemon::ListDigraphBase>::ArcMap<bool> >, lemon::SubDigraphBase<lemon::ListDigraph, lemon::ConstMap<lemon::ListDigraphBase::Node, lemon::Const<bool, true> >, lemon::DigraphExtender<lemon::ListDigraphBase>::ArcMap<bool>, false>::NodeMap<lemon::ListDigraphBase::Arc> >, lemon::Path<lemon::FilterArcs<lemon::ListDigraph, lemon::DigraphExtender<lemon::ListDigraphBase>::ArcMap<bool> > >, true>::copy' requested here
[build]         PathCopySelectorBackward<From, To>::copy(from, to);
[build]                                             ^
[build] /home/oll48/Git/mbt-repository/dependencies/lemon/path.h:1046:45: note: in instantiation of member function 'lemon::_path_bits::PathCopySelector<lemon::PredMapPath<lemon::FilterArcs<lemon::ListDigraph, lemon::DigraphExtender<lemon::ListDigraphBase>::ArcMap<bool> >, lemon::SubDigraphBase<lemon::ListDigraph, lemon::ConstMap<lemon::ListDigraphBase::Node, lemon::Const<bool, true> >, lemon::DigraphExtender<lemon::ListDigraphBase>::ArcMap<bool>, false>::NodeMap<lemon::ListDigraphBase::Arc> >, lemon::Path<lemon::FilterArcs<lemon::ListDigraph, lemon::DigraphExtender<lemon::ListDigraphBase>::ArcMap<bool> > >, true>::copy' requested here
[build]     _path_bits::PathCopySelector<From, To>::copy(from, to);
[build]                                             ^
[build] /home/oll48/Git/mbt-repository/dependencies/lemon/path.h:79:7: note: in instantiation of function template specialization 'lemon::pathCopy<lemon::PredMapPath<lemon::FilterArcs<lemon::ListDigraph, lemon::DigraphExtender<lemon::ListDigraphBase>::ArcMap<bool> >, lemon::SubDigraphBase<lemon::ListDigraph, lemon::ConstMap<lemon::ListDigraphBase::Node, lemon::Const<bool, true> >, lemon::DigraphExtender<lemon::ListDigraphBase>::ArcMap<bool>, false>::NodeMap<lemon::ListDigraphBase::Arc> >, lemon::Path<lemon::FilterArcs<lemon::ListDigraph, lemon::DigraphExtender<lemon::ListDigraphBase>::ArcMap<bool> > > >' requested here
[build]       pathCopy(cpath, *this);
[build]       ^
[build] /home/oll48/Git/mbt-repository/lib/AllTransitionState.h:585:62: note: in instantiation of function template specialization 'lemon::Path<lemon::FilterArcs<lemon::ListDigraph, lemon::DigraphExtender<lemon::ListDigraphBase>::ArcMap<bool> > >::Path<lemon::PredMapPath<lemon::FilterArcs<lemon::ListDigraph, lemon::DigraphExtender<lemon::ListDigraphBase>::ArcMap<bool> >, lemon::SubDigraphBase<lemon::ListDigraph, lemon::ConstMap<lemon::ListDigraphBase::Node, lemon::Const<bool, true> >, lemon::DigraphExtender<lemon::ListDigraphBase>::ArcMap<bool>, false>::NodeMap<lemon::ListDigraphBase::Arc> > >' requested here
[build]             Path<FilterArcs<ListDigraph, ArcFilter> > path = bfs.path(next_state);
[build]                                                              ^
[build] /home/oll48/Git/mbt-repository/dependencies/lemon/list_graph.h:81:11: note: candidate constructor (the implicit copy constructor) not viable: no known conversion from 'typename PredMapPath<FilterArcs<ListDigraph, ArcMap<bool> >, NodeMap<Arc> >::RevArcIt' to 'const lemon::ListDigraphBase::Arc &' for 1st argument
[build]     class Arc {
[build]           ^
[build] /home/oll48/Git/mbt-repository/dependencies/lemon/list_graph.h:81:11: note: candidate constructor (the implicit move constructor) not viable: no known conversion from 'typename PredMapPath<FilterArcs<ListDigraph, ArcMap<bool> >, NodeMap<Arc> >::RevArcIt' to 'lemon::ListDigraphBase::Arc &&' for 1st argument
[build] /home/oll48/Git/mbt-repository/dependencies/lemon/list_graph.h:91:7: note: candidate constructor not viable: no known conversion from 'typename PredMapPath<FilterArcs<ListDigraph, ArcMap<bool> >, NodeMap<Arc> >::RevArcIt' to 'lemon::Invalid' for 1st argument
[build]       Arc (Invalid) { id = -1; }
[build]       ^
[build] /home/oll48/Git/mbt-repository/dependencies/lemon/bits/path_dump.h:64:7: note: candidate function
[build]       operator const typename Digraph::Arc() const {
[build]       ^
[build] /bin/../lib/gcc/x86_64-linux-gnu/9/../../../../include/c++/9/bits/stl_vector.h:1200:30: note: passing argument to parameter '__x' here
[build]       push_back(value_type&& __x)
[build]                              ^
(...)                          ^
}}}

This is only a small snippet of the errors however they are all the same issue basically, it seems clang has problem with using arc iterators and arcs interchangebly, maybe some kind of cast would fix this?

I would be very thankful for any feedback, these issues prevent us from making our software fully platform independent."	defect	closed	major	LEMON 1.4 release	core	hg main	fixed			
