GCC抛出:未定义的引用`_getcwd”

问题描述:

我试图编译这个SourceForge的项目在Ubuntu 11.10 64:http://vmb.sourceforge.net/GCC抛出:未定义的引用`_getcwd”

Linux users have to compile the devices from sources. 
Either obtained from cvs (see: http://sourceforge.net/projects/vmb/) or as a tgz file. 
The sources come with Makefiles. If you have make and gcc, just execute make in the top source directory. 

所以我下载了名为.tar.gz,untared它,并运行“使“从/ src目录。
但产量说:

/vmb/src/opt/option.c:528: undefined reference to `_getcwd' 

我想这是一个错误或丢失库。原来的项目似乎来自Visual Studio。
我该如何解决这个问题?

看看到源代码在http://vmb.cvs.sourceforge.net/viewvc/vmb/vmb/src/opt/option.c?revision=1.21&view=markup

526 void vmb_get_cwd(void) 
527 { if (vmb_cwd!=NULL) return; 
528 #ifdef WIN32 
529 vmb_cwd = _getcwd(NULL,0); 
530 #else 
531 vmb_cwd = getcwd(NULL,0); 
532 #endif 

检查您的配置定义WIN32。这不应该为Linux启用/定义。