Compiling from the latest git source code on a Debian GNU/Linux box dies with an error in the linker:
$ make
Linking virtualt
/bin/ld: obj/linker.o:(.bss+0x0): multiple definition of `path'; obj/m100emu.o:(.bss+0x240): first defined here
collect2: error: ld returned 1 exit status
make: *** [GNUmakefile:124: virtualt] Error 1
This is easily fixed by simply renaming the variable path
in linker.cpp and making it static.
diff --git a/src/linker.cpp b/src/linker.cpp
index 8cb047d..e4eb1d9 100644
--- a/src/linker.cpp
+++ b/src/linker.cpp
@@ -24,7 +24,7 @@ Written: 11/13/09 Kenneth D. Pettit
extern "C"
{
#include "intelhex.h"
-char path[512];
+static char linkpath[512];
}
static const char *gLoaderCode[] = {
@@ -383,7 +383,7 @@ MString VTLinker::PreprocessDirectory(const char *pDir)
if (strncmp(pDir, "{$VT_ROOT}", 10) == 0)
{
// Substitute the VirtualT path
- temp = path;
+ temp = linkpath;
temp += pDir[10];
}
else if (strncmp(pDir, "{$VT_PROJ}", 10) == 0)
It appears the intent was to use the same path variable. I've fixed this in current git. Please let me know if it works so I can close this.