Giter Club home page Giter Club logo

Comments (7)

lynncui00 avatar lynncui00 commented on May 16, 2024

请问g++是4.8及以上版本么吗?

from phxpaxos.

liaobinxu avatar liaobinxu commented on May 16, 2024

远远超过4.8了, 用的ubuntu 16.04编译的(gcc (Ubuntu 5.4.0-6ubuntu1~16.04.2) 5.4.0 20160609)
phxpaxos 除sample外其他都已经编译成功了
lib
├── extlib
│   ├── libphxkv_client.a
│   ├── libphxpaxos.a
│   └── libphxpaxos_plugin.a
├── libalgorithm.a
├── libcheckpoint.a
├── libcomm.a
├── libcommunicate.a
├── libcommunicate_tcp.a
├── libconfig.a
├── libinclude.a
├── liblogger_google.a
├── liblogstorage.a
├── libmaster.a
├── libmonitor.a
├── libnode.a
├── libphxkv_client.a
├── libphxpaxos.a
├── libphxpaxos_plugin.a
├── libsmbase.a
└── libutils.a

from phxpaxos.

lynncui00 avatar lynncui00 commented on May 16, 2024

g++ echo_sm.o echo_server.o main.o -o phxecho -L/data/tmp/phxpaxos/.lib -L/data/tmp/phxpaxos/third_party/protobuf/lib -L/data/tmp/phxpaxos/third_party/leveldb/lib/ -L/data/tmp/phxpaxos/third_party/glog/lib -L/data/tmp/phxpaxos/third_party/grpc/lib -L/data/tmp/phxpaxos/third_party/openssl/lib -g /data/tmp/phxpaxos/lib/libphxpaxos_plugin.a /data/tmp/phxpaxos/lib/libphxpaxos.a /data/tmp/phxpaxos/third_party/leveldb/lib//libleveldb.a /data/tmp/phxpaxos/third_party/protobuf/lib/libprotobuf.a /data/tmp/phxpaxos/third_party/glog/lib/libglog.a /data/tmp/phxpaxos/third_party/glog/lib/libglog.a -lpthread

我拷贝你的命令替换路径后,在ubuntu的gcc (Ubuntu 5.2.1-22ubuntu2)上可以编译通过。目前看你的错误都是在链接静态库的时候找不到定义,具体原因还暂时未明。

from phxpaxos.

lynncui00 avatar lynncui00 commented on May 16, 2024

@liaobinxu 试试在这个命令加入-Wl,--no-as-needed参数看能否编译成功。

from phxpaxos.

liaobinxu avatar liaobinxu commented on May 16, 2024

对所有 .a文件检查 no-as-needed , 只提示没有main函数, 没有的错误
g++ -Wl,--no-as-needed /data/tmp/phxpaxos/lib/libphxpaxos_plugin.a /data/tmp/phxpaxos/lib/libphxpaxos.a /data/tmp/phxpaxos/third_party/leveldb/lib//libleveldb.a /data/tmp/phxpaxos/third_party/protobuf/lib/libprotobuf.a /data/tmp/phxpaxos/third_party/glog/lib/libglog.a /data/tmp/phxpaxos/third_party/glog/lib/libglog.a
/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/crt1.o:在函数‘_start’中:
(.text+0x20):对‘main’未定义的引用
collect2: error: ld returned 1 exit status

from phxpaxos.

lynncui00 avatar lynncui00 commented on May 16, 2024

您好,我们编写了详细的编译手册在wiki里面,看看对你有无什么帮助,或者重新clone源码进行尝试?

from phxpaxos.

liaobinxu avatar liaobinxu commented on May 16, 2024

我在centos7上面编译成功了, 谢谢

from phxpaxos.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.