急!linux和windows编译环境问题

moxm1026 2012-02-26 02:48:00
我在windows下编译的好好的,换到linux下面报错:
[image@szmlserver94_204 des]$ make clean;make
rm -f *~ *.o libtestxx.so
/usr/bin/g++ -I. -g -fPIC -I./ -I./include -I/modules/java/include -I/modules/java/include/linux -c -o Des.o Des.cpp
Des.cpp:403:2: warning: no newline at end of file
/usr/bin/g++ -I. -g -fPIC -I./ -I./include -I/modules/java/include -I/modules/java/include/linux -c -o DESAgent.o DESAgent.cpp
DESAgent.cpp: In function ‘void init()’:
DESAgent.cpp:86: error: ‘_tcstoul’ was not declared in this scope
DESAgent.cpp: In function ‘void loadClass(jvmtiEnv*, JNIEnv*, _jclass*, _jobject*, const char*, _jobject*, jint, const unsigned char*, jint*, unsigned char**)’:
DESAgent.cpp:164: error: ‘_tcstol’ was not declared in this scope
make: *** [DESAgent.o] Error 1

错误主要是:
‘_tcstoul’ was not declared in this scope

这个是一个把十六进制字符串转换成十进制数字的函数,_tcstoul在linux下用什么换掉啊?
...全文
108 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
面包大师 2012-02-26
  • 打赏
  • 举报
回复
	char a[] = "0xA1C925B";
long b;
sscanf("A1C925B", "%x", &b);//类似的这种就行
moxm1026 2012-02-26
  • 打赏
  • 举报
回复
long password1 = _tcstoul("0xA1C925B", NULL, 16); // 十六进制字符串转换为数字;
long password2 = _tcstoul("0xED601093", NULL, 16);
long password3 = _tcstoul("0xF4BA908B", NULL, 16);
long password4 = _tcstoul("0x83C82BFC", NULL, 16);

上面是转换的代码,兄弟们,帮帮忙哈......
Lactoferrin 2012-02-26
  • 打赏
  • 举报
回复
strtoul
teleinfor 2012-02-26
  • 打赏
  • 举报
回复
也没见到你的代码,你的这个需求满足的函数多了去了。方法多样。你把代码贴出来大家给你看看啊。
面包大师 2012-02-26
  • 打赏
  • 举报
回复
用sscanf啊什么的都行啊,你把代码发下,用到tcstoul的地方

64,654

社区成员

发帖
与我相关
我的任务
社区描述
C++ 语言相关问题讨论,技术干货分享,前沿动态等
c++ 技术论坛(原bbs)
社区管理员
  • C++ 语言社区
  • encoderlee
  • paschen
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
  1. 请不要发布与C++技术无关的贴子
  2. 请不要发布与技术无关的招聘、广告的帖子
  3. 请尽可能的描述清楚你的问题,如果涉及到代码请尽可能的格式化一下

试试用AI创作助手写篇文章吧