I am getting this error in the Omnet++ project, based on the David Eckhoff Veins/Sumo Project.
The error is (maybe) because the version used in that omnet++ is 4.6 and the one I am using is the 5.0. Nevertheless, I have been trying to find a logic solution to it without any success.
make MODE=debug all
src/TutorialAppl.cpp
In file included from src/TutorialAppl.cpp:3:
In file included from src/TutorialAppl.h:12:
In file included from C:/Users/konra/OneDrive/Escritorio/SUMO_VEINS_OMNET/veins-5.0/veins-veins-5.0/src\veins/modules/messages/WaveShortMessage_m.h:33:
C:/Users/konra/OneDrive/Escritorio/SUMO_VEINS_OMNET/veins-5.0/veins-veins-5.0/src\veins/base/utils/Coord.h:329:27: warning: 'veins::Coord::info' redeclared inline; 'dllimport' attribute ignored [-Wignored-attributes]
inline std::string Coord::info() const
^
1 warning generated.
Creating executable: out/clang-debug//VeinsTutorial_dbg.exe
out/clang-debug//src/TutorialAppl.o:(.rdata[_ZTIN5veins9BaseLayerE]+0x10): undefined reference to `typeinfo for veins::BatteryAccess'
out/clang-debug//src/TutorialAppl.o:(.rdata[_ZTIN5veins12BaseMobilityE]+0x10): undefined reference to `typeinfo for veins::BatteryAccess'
clang++.exe: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [Makefile:101: out/clang-debug//VeinsTutorial_dbg.exe] Error 1
"make MODE=debug all" terminated with exit code 2. Build might be incomplete.
Oh, this is a compiler bug (clang).
The clang compiler does NOT mark the typeinfo symbols as exportable on Windows. This usually goes unnoticed unless you are trying to use an abstract class from a base project (veins) in a project that depends on it. Abstract classes are used regularly to define interfaces in Veins, INET and OMNeT++, too.
There is a workaround for this in INET that can be implemented also in your own project (and in veins too), but it is extremely ugly and it requires the re-linking of the library each time so link time increases heavily.
Other more straightforward workarounds:
-Wl,--export-all-symbols
to the linker command line in Veins to force the exporting of ALL symbols. (Veins is small enough not to cause issues with the 65K limit for the number of exported symbols on Windows)