亚洲av成人无遮挡网站在线观看,少妇性bbb搡bbb爽爽爽,亚洲av日韩精品久久久久久,兔费看少妇性l交大片免费,无码少妇一区二区三区

  免費注冊 查看新帖 |

Chinaunix

  平臺 論壇 博客 文庫
最近訪問板塊 發(fā)新帖
查看: 1466 | 回復(fù): 1
打印 上一主題 下一主題

[Linux] arm-linux-gcc 4.4.3 hashtable問題(內(nèi)附3.4.1) [復(fù)制鏈接]

論壇徽章:
0
跳轉(zhuǎn)到指定樓層
1 [收藏(0)] [報告]
發(fā)表于 2012-12-28 12:56 |只看該作者 |倒序瀏覽
各位大俠:
    最近在做嵌入式開發(fā)。
    原來的交叉編譯環(huán)境是arm-linux-gcc 3.4.1,源碼如下:
Test.h
  1. #ifndef _TEST_
  2. #define _TEST_

  3. #include <hashtable.h>

  4. class Test{
  5. public:
  6.         Test();
  7.         ~Test();

  8. private:
  9.         typedef struct {
  10.                 int nKey;
  11.         }KeyNode;
  12.        
  13.         typedef int (* HASHER)(int);
  14.         typedef int (* EXTRACTOR)(KeyNode);
  15.         typedef bool (* EQUALFUNC)(int, int);

  16.         typedef hashtable<KeyNode, int, HASHER, EXTRACTOR, EQUALFUNC> _CONN_HASH;

  17.         static int hasher(int key) { return key; }
  18.         static int extractor(KeyNode val) { return val.nKey; }
  19.         static bool equalkey(int key1, int key2) { return key1 == key2; }

  20.         _CONN_HASH* m_pConnHash;
  21. };

  22. #endif

復(fù)制代碼
Test.cpp
  1. #include "Test.h"

  2. Test::Test()
  3. {
  4. }

  5. Test::~Test()
  6. {
  7. }
復(fù)制代碼
在3.4.1編譯正常。
但移到4.4.3后提示錯誤信息如下:
arm-linux-g++ -g -Wall  -DDEBUG  -D_REENTRANT -shared -lpthread -L./lib -I./inc -o./lib/Test.so ./src/Test.cpp
In file included from ./src/Test.cpp:1:
./inc/Test.h:22: error: ISO C++ forbids declaration of 'hashtable' with no type
./inc/Test.h:22: error: expected ';' before '<' token
./inc/Test.h:28: error: ISO C++ forbids declaration of '_CONN_HASH' with no type
./inc/Test.h:28: error: expected ';' before '*' token
make: *** [../lib/Test.so] 錯誤 1

查了下,貌似說4.0版本后的hashtable操作已經(jīng)過時,可也沒找到個例子,哪位仁兄能幫忙解釋下,或者給個demo。不勝感激

論壇徽章:
0
2 [報告]
發(fā)表于 2012-12-29 21:10 |只看該作者
1. If missing         <hashtable.h> Then include this header <tr1/unordered_map> or <tr1/unordered_set>
>http://gcc.gnu.org/gcc-4.3/porting_to.html

2. C++11
>http://gcc.gnu.org/wiki/cxx-conversion #Convert hash tables
重寫了hashtable , -std=c++11
換這個頭文件試試 #include<unordered_map>
曾經(jīng)看到過,說是重寫了,但應(yīng)該不是這個呀2012年8月的版本?c++11 好新的標(biāo)準(zhǔn).貌似哪里看到過就是重寫了,原來的頭文件還在,但是名字沖突的,即換用了 這個名字 無序映射
您需要登錄后才可以回帖 登錄 | 注冊

本版積分規(guī)則 發(fā)表回復(fù)

  

北京盛拓優(yōu)訊信息技術(shù)有限公司. 版權(quán)所有 京ICP備16024965號-6 北京市公安局海淀分局網(wǎng)監(jiān)中心備案編號:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年舉報專區(qū)
中國互聯(lián)網(wǎng)協(xié)會會員  聯(lián)系我們:huangweiwei@itpub.net
感謝所有關(guān)心和支持過ChinaUnix的朋友們 轉(zhuǎn)載本站內(nèi)容請注明原作者名及出處

清除 Cookies - ChinaUnix - Archiver - WAP - TOP