首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 操作系统 > UNIXLINUX >

这是出什么东东了

2013-07-09 
这是出什么错误了?g++ -Wall -g -m32 -c main.cppmain.cpp: In function ‘void* ClientOnLine(void*)’:mai

这是出什么错误了?



g++ -Wall -g -m32 -c main.cpp
main.cpp: In function ‘void* ClientOnLine(void*)’:
main.cpp:55: warning: unused variable ‘icomand’
main.cpp: In function ‘void process()’:
main.cpp:132: warning: deprecated conversion from string constant to ‘char*’
main.cpp: In function ‘int main(int, char**)’:
main.cpp:171: warning: deprecated conversion from string constant to ‘char*’
main.cpp:171: warning: unused variable ‘p’
g++    -c -o FileManager.o FileManager.cpp
FileManager.cpp: In member function ‘char* FileInfo::getFileType()’:
FileManager.cpp:233: warning: deprecated conversion from string constant to ‘char*’
FileManager.cpp:237: warning: deprecated conversion from string constant to ‘char*’
FileManager.cpp:241: warning: deprecated conversion from string constant to ‘char*’
FileManager.cpp:245: warning: deprecated conversion from string constant to ‘char*’
FileManager.cpp:249: warning: deprecated conversion from string constant to ‘char*’
FileManager.cpp:265: warning: deprecated conversion from string constant to ‘char*’
FileManager.cpp:270: warning: deprecated conversion from string constant to ‘char*’
FileManager.cpp: In member function ‘int FileInfo::getIntFileType()’:
FileManager.cpp:283: warning: deprecated conversion from string constant to ‘char*’
FileManager.cpp:288: warning: deprecated conversion from string constant to ‘char*’
FileManager.cpp:293: warning: deprecated conversion from string constant to ‘char*’
FileManager.cpp:298: warning: deprecated conversion from string constant to ‘char*’
FileManager.cpp:303: warning: deprecated conversion from string constant to ‘char*’
FileManager.cpp:321: warning: deprecated conversion from string constant to ‘char*’
FileManager.cpp:327: warning: deprecated conversion from string constant to ‘char*’
FileManager.cpp: In member function ‘char* FileInfo::getFilePermissions()’:
FileManager.cpp:350: warning: address of local variable ‘descrip’ returned
FileManager.cpp: In member function ‘void FileInfo::showAllInfo()’:
FileManager.cpp:447: warning: deprecated conversion from string constant to ‘char*’
FileManager.cpp:448: warning: deprecated conversion from string constant to ‘char*’
FileManager.cpp:449: warning: deprecated conversion from string constant to ‘char*’
FileManager.cpp:450: warning: deprecated conversion from string constant to ‘char*’
FileManager.cpp:451: warning: deprecated conversion from string constant to ‘char*’
FileManager.cpp:456: warning: deprecated conversion from string constant to ‘char*’
FileManager.cpp:458: warning: deprecated conversion from string constant to ‘char*’
FileManager.cpp:475: warning: format ‘%ld’ expects type ‘long int’, but argument 2 has type ‘off_t’


FileManager.cpp:477: warning: format ‘%ld’ expects type ‘long int’, but argument 2 has type ‘__darwin_ino64_t’
FileManager.cpp:482: warning: format ‘%ld’ expects type ‘long int’, but argument 2 has type ‘blksize_t’
FileManager.cpp:483: warning: format ‘%ld’ expects type ‘long int’, but argument 2 has type ‘blkcnt_t’
g++ -Wall -g -m32 -c Filesearch.cpp
Filesearch.cpp: In function ‘void Search_File(char*, char*)’:
Filesearch.cpp:37: warning: format not a string literal and no format arguments
Filesearch.cpp:42: warning: suggest parentheses around assignment used as truth value
Filesearch.cpp:60: warning: format not a string literal and no format arguments
g++ -Wall -g -m32 -c SystemInfo.cpp
SystemInfo.cpp: In function ‘void get_ip(SYS_INFO*)’:
SystemInfo.cpp:41: warning: unused variable ‘hname’
SystemInfo.cpp: In function ‘int GetDeviceInfo(SYS_INFO*)’:
SystemInfo.cpp:157: warning: control reaches end of non-void function
g++ -Wall -g -m32 -c Socket.cpp
g++ main.o FileManager.o Filesearch.o SystemInfo.o Socket.o  -m32 -o server
ld: warning: ignoring file FileManager.o, file was built for unsupported file format which is not the architecture being linked (i386)
Undefined symbols for architecture i386:
  "FileInfo::FileInfo()", referenced from:
      _main in main.o
  "FileInfo::initFileInfo(char*)", referenced from:
      _main in main.o
  "FileInfo::initFileStruct()", referenced from:
      _main in main.o
  "FileInfo::showAllInfo()", referenced from:
      _main in main.o
ld: symbol(s) not found for architecture i386
collect2: ld returned 1 exit status
make: *** [server] Error 1



[解决办法]
引用:
Quote: 引用:

敢不敢把 -Wall 先去了..
意思是i386架构里没这些函数吧

为啥我换到-m64就好了?这个也就是一些c++啊。。。怎么回出这样的问题。。

64位的时候库和32位的库不一样,那就说明64的库有这么些函数的
-m64 64位环境
-m32 32位环境
-Wall 允许发出GCC能够提供的所有有用的警告
[解决办法]
亲爱的大大,你编译“g++    -c -o FileManager.o FileManager.cpp”的时候忘记加参数-m32了。这样链接的时候根本就没有链接FileManager.o。

热点排行