Distributions
Ubuntu
Fedora
CentOS
中文资源站
网易开源镜像站
lazyFish147
V2EX  ›  Linux

萌新求助: ubantu 下安装 JSON 库,链接时显示 版本不兼容,大佬看一下怎么破!

  •  
  •   lazyFish147 · Aug 14, 2018 · 3291 views
    This topic created in 2833 days ago, the information mentioned may be changed or developed.
    g++ -o clientMain udp_client.cpp clientMain.cpp ../comm/data.cpp -ljson
    /usr/bin/ld: 当搜索用于 /usr/lib/gcc/x86_64-linux-gnu/5/../../../../lib/libjson.a 时跳过不兼容的 -ljson
    /usr/bin/ld: 当搜索用于 /usr/lib/../lib/libjson.a 时跳过不兼容的 -ljson
    /usr/bin/ld: 当搜索用于 /usr/lib/gcc/x86_64-linux-gnu/5/../../../libjson.a 时跳过不兼容的 -ljson
    /usr/bin/ld: 当搜索用于 //usr/lib/libjson.a 时跳过不兼容的 -ljson
    /usr/bin/ld: 找不到 -ljson
    collect2: error: ld returned 1 exit status
    Makefile:8: recipe for target 'clientMain' failed
    make: *** [clientMain] Error 1
    
    
    

    JSON 在 data.cpp 中调用 引用头文件 <json/json.h>中调用 动态库,静态库都放在了 usr/lib/ usr/local/lib /lib /lib64 下 头文件也在 usr/include/json/ 库的版本为 libjson_linux-gcc-4.4.6_libmt.a libjson_linux-gcc-4.4.6_libmt.so

    度娘上有说是 64 位代码与 32 为库不兼容;请大佬指导!!

    scukmh
        1
    scukmh  
       Aug 14, 2018
    g++ -m32 试试?
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   3006 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 28ms · UTC 12:54 · PVG 20:54 · LAX 05:54 · JFK 08:54
    ♥ Do have faith in what you're doing.