zoukankan      html  css  js  c++  java
  • 定义一个map少了一个typedef后报出来的错误

    看上去一大堆怪怪的东西.....

    (g++)

    typedef TSMapTemp<string, UpdateItemVec>  g_update_item_map;     

    一开始没有 加上typedef就出现这种怪异的错误

    g++ -L"." -L../libylog cfg_helper.o clog.o comm_func.o datapack_handler.o db_helper.o db_mgr.o dcs_helper.o ex_network_mgr.o lock_wrapper.o main.o monitor_mgr.o mon_node.o myapp.o network.o node_store.o qitem.o routine_mgr.o rsr_cleaner.o tcp_socket.o test_helper.o udp_socket.o -ldl -lsybdb -lpthread -lylog -o "../bin/cts"
    main.o: In function `__tcf_9':
    /root/cts/src/code/main.cpp:36: multiple definition of `g_update_item_map'
    datapack_handler.o:/root/cts/src/code/datapack_handler.cpp:34: first defined here
    monitor_mgr.o: In function `CMonitorMgr':
    /root/cts/src/code/monitor_mgr.cpp:33: multiple definition of `g_update_item_map'
    datapack_handler.o:/root/cts/src/code/datapack_handler.cpp:34: first defined here
    mon_node.o: In function `__tcf_4':
    /usr/lib/gcc/i386-redhat-linux/4.1.1/http://www.cnblogs.com/http://www.cnblogs.com/include/c++/4.1.1/iostream:76: multiple definition of `g_update_item_map'
    datapack_handler.o:/root/cts/src/code/datapack_handler.cpp:34: first defined here
    myapp.o: In function `CMyApp':
    /root/cts/src/code/myapp.cpp:93: multiple definition of `g_update_item_map'
    datapack_handler.o:/root/cts/src/code/datapack_handler.cpp:34: first defined here
    node_store.o: In function `__tcf_5':
    /usr/lib/gcc/i386-redhat-linux/4.1.1/http://www.cnblogs.com/http://www.cnblogs.com/include/c++/4.1.1/iostream:76: multiple definition of `g_update_item_map'
    datapack_handler.o:/root/cts/src/code/datapack_handler.cpp:34: first defined here
    routine_mgr.o: In function `__tcf_4':
    /usr/lib/gcc/i386-redhat-linux/4.1.1/http://www.cnblogs.com/http://www.cnblogs.com/include/c++/4.1.1/iostream:76: multiple definition of `g_update_item_map'
    datapack_handler.o:/root/cts/src/code/datapack_handler.cpp:34: first defined here
    rsr_cleaner.o: In function `__tcf_1':
    /usr/lib/gcc/i386-redhat-linux/4.1.1/http://www.cnblogs.com/http://www.cnblogs.com/include/c++/4.1.1/iostream:76: multiple definition of `g_update_item_map'
    datapack_handler.o:/root/cts/src/code/datapack_handler.cpp:34: first defined here
    collect2: ld 返回 1

  • 相关阅读:
    204. Count Primes (Integer)
    203. Remove Linked List Elements (List)
    202. Happy Number (INT)
    201. Bitwise AND of Numbers Range (Bit)
    200. Number of Islands (Graph)
    199. Binary Tree Right Side View (Tree, Stack)
    198. House Robber(Array; DP)
    191. Number of 1 Bits (Int; Bit)
    190. Reverse Bits (Int; Bit)
    189. Rotate Array(Array)
  • 原文地址:https://www.cnblogs.com/vimmer/p/2506470.html
Copyright © 2011-2022 走看看