undefined reference to `__kmpc_begin'
编译有问题:
代码如下:
int main(int argc, char** argv)
{
if (argc != 2)
{
printf("Usage: %s JobId\n", argv[0]);
exit(-1);
}
int info; // 存储调用函数的返回值,判断成功与否?
char* strJobId; // Store the current JobId
char strXmlPath[MAXLEN];// Store the directory where DataSplit.xml is.
char command[MAXLEN];// 存储可执行程序名
memset(command,0,sizeof(command));
strcpy(command,"DATASPLIT"); ////////从命令行获取参数,可执行程序名
strJobId=argv[1]; ////////从命令行获取参数,作业号
#ifdef DEBUG
printf("strJobId=%s in main of DataSplit!\n", strJobId);
#endif
// 根据作业号形成当前作业号的绝对路径
info=JobId2XmlPath(strJobId,strXmlPath,command);
if(info!=SUCCESS)
{
printf("Fail to call JobId2XmlPath in main\n");
return FAIL;
}
#ifdef DEBUG
printf("strXmlPath: %s in main\n", strXmlPath);
#endif
// 根据已有的xml文件,进行DataSplit的相关操作
info=Process(strXmlPath,"DATASPLIT",strJobId);
if(info!=SUCCESS)
{
#ifdef DEBUG
printf("Fail to call Process in the main DATASPLIT\n");
#endif
ErrorLog("DATASPLIT",strJobId,"10201");
return FAIL;
}
return SUCCESS;
}
编译问题如下:
icpc -O3 -DDEBUG -D_FILE_OFFSET_BITS=64 -g -Ddmc_linux -D_LINUX_ -Wno-deprecated -DMPICH_IGNORE_CXX_SEEK -openmp -c DataSplit.cpp -I/home/ghips//ghips_main/src/RDMPS_HPGFS/DATASPLIT/include/DMC4 -I/home/ghips//ghips_main/src/RDMPS_HPGFS/DATASPLIT/include/COMM -I /home/ghips//ghips_main/include/log -I/home/ghips//ghips_main/src/RDMPS_HPGFS/PUB/include -I /home/ghips//ghips_main/lib/occi/oracle/product/10.2.0/db_1/rdbms/public/ -I /home/ghips//ghips_main/lib/occi/oracle/product/10.2.0/db_1/plsql/public/ -I /home/ghips//ghips_main/include/cfs/xml -I /home/ghips//ghips_main/include/cfs/odl
icpc DataSplit.o AbstractDataSplit.o DataSplitPub.o -o DATASPLIT -L/home/ghips//ghips_main/src/RDMPS_HPGFS/DATASPLIT/lib -ldmc4 -L/home/ghips//ghips_main/lib/cfs/xml -lxmlconf -L/home/ghips//ghips_main/lib/cfs/xml -lxerces-c -lpthread -L/home/ghips//ghips_main/lib/sup/ -ljpeg -L/home/ghips//ghips_main/lib/cfs/odl -lodl -L/home/ghips//ghips_main/src/RDMPS_HPGFS/PUB/lib -lpub /home/ghips//ghips_main/lib/log/liblog.so /home/ghips//ghips_main/lib/log/liblog4cxx.so
/opt/intel/Compiler/11.1/072/lib/intel64/libimf.so: warning: warning: feupdateenv is not implemented and will always fail
ld: warning: i386 architecture of input file `/home/ghips//ghips_main/src/RDMPS_HPGFS/DATASPLIT/lib/libdmc4.a(idctmmx.o)' is incompatible with i386:x86-64 output
DataSplit.o: In function `main':
/home/ghips/ghips_main/src/RDMPS_HPGFS/DATASPLIT/src/COMM/DataSplit.cpp:15: undefined reference to `__kmpc_begin'
/home/ghips/ghips_main/src/RDMPS_HPGFS/DATASPLIT/src/COMM/DataSplit.cpp:58: undefined reference to `__kmpc_end'
/home/ghips/ghips_main/src/RDMPS_HPGFS/DATASPLIT/src/COMM/DataSplit.cpp:41: undefined reference to `__kmpc_end'
/home/ghips/ghips_main/src/RDMPS_HPGFS/DATASPLIT/src/COMM/DataSplit.cpp:56: undefined reference to `__kmpc_end'
make: *** [DATASPLIT] 错误 1
请大家帮忙解决,谢谢!非常着急!