Navigation

    全志在线开发者论坛

    • Register
    • Login
    • Search
    • Categories
    • Tags
    • 在线文档
    • 社区主页

    请问Ubuntu18.04,32bit 的 .so文件 是复制到 /usr/lib32,64bit的so文件是复制到 /usr/lib/ 目录吗?

    Linux
    2
    3
    2086
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • U
      ubuntu LV 7 last edited by

      请问Ubuntu18.04,32bit 的 .so文件 是复制到 /usr/lib32,64bit的so文件是复制到 /usr/lib/ 目录吗?

      WhycanService 1 Reply Last reply Reply Quote Share 0
      • WhycanService
        WhycanService LV 8 @ubuntu last edited by

        @ubuntu

        是的,gcc -m32 命令会自动去找 /lib32,/usr/lib32 目录下面的so文件。

        1 Reply Last reply Reply Quote Share 0
        • WhycanService
          WhycanService LV 8 last edited by whycan

          安装相关软件包:

          sudo dpkg --add-architecture i386
          sudo apt-get update
          sudo apt-get install gcc-multilib libc6:i386 libncurses5:i386 libstdc++6:i386 libasound2*:i386
          

          编译x64版本可执行程序:

          gcc -o test test.c
          

          编译i386版本可执行程序:

          gcc -o test -m32 test.c
          
          1 Reply Last reply Reply Quote Share 0
          • 1 / 1
          • First post
            Last post

          Copyright © 2024 深圳全志在线有限公司 粤ICP备2021084185号 粤公网安备44030502007680号

          行为准则 | 用户协议 | 隐私权政策