Giter VIP home page Giter VIP logo

Comments (3)

fuhao3017 avatar fuhao3017 commented on July 21, 2024

CentOS 8.2 gcc -O2 -fPIC -Wall -shared -o protobuf.so -I../.. -I/usr/local/include -L../../build pbc-lua53.c -lpbc /usr/ bin/ld: 找不到 -lpbc collect2: 错误:ld 返回 1 make: *** [Makefile:13:protobuf.so] 错误 1
我也遇到了一样的问题请问有什么解决方法嘛

from pbc.

NextZeus avatar NextZeus commented on July 21, 2024

安装gmp

https://gmplib.org/

╭─xiaodong@bogon ~/Downloads/gmp-6.2.1
╰─$ ./configure
╭─xiaodong@bogon ~/Downloads/gmp-6.2.1
╰─$ make
╭─xiaodong@bogon ~/Downloads/gmp-6.2.1
╰─$ sudo make install

安装pbc (需要先安装gmp)

pbc

╭─xiaodong@laowantong ~/Downloads/pbc-0.5.14
╰─$ ./configure
╭─xiaodong@laowantong ~/Downloads/pbc-0.5.14
╰─$ make
╭─xiaodong@laowantong ~/Downloads/pbc-0.5.14
╰─$ sudo make install

修改 3rd/pbc/binding/lua53/Makefile (直接复制替换即可)

#97


CC = gcc
CFLAGS = -O2 -fPIC -Wall -bundle -undefined dynamic_lookup
LUADIR = /usr/local/include
TARGET = protobuf.so

.PHONY : all clean

all : $(TARGET)

$(TARGET) : pbc-lua53.c
	$(CC) $(CFLAGS) -o $@ -I../.. -I$(LUADIR) $^ -l pbc -l lua

clean :
	rm -f $(TARGET)

make编译 & 拷贝文件


╭─xiaodong@laowantong ~/skynet/3rd/pbc/binding/lua53 ‹master●›
╰─$ make
gcc -O2 -fPIC -Wall -bundle -undefined dynamic_lookup -o protobuf.so -I../.. -I/usr/local/include pbc-lua53.c -l pbc -l lua
╭─xiaodong@laowantong ~/skynet/3rd/pbc/binding/lua53 ‹master●›
╰─$ cp protobuf.so  ../../../../luaclib/
╭─xiaodong@laowantong ~/skynet/3rd/pbc/binding/lua53 ‹master●›
╰─$ cp protobuf.lua ../../../../lualib/

from pbc.

NextZeus avatar NextZeus commented on July 21, 2024

另外我发现,brew install pbc 这种方式安装 pbc, 依然会报:ld: library not found for -lpbc 这个错误。 所以应该是mac brew install 姿势不对 找不到pbc. 只有下载源码编译安装才能找到

from pbc.

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.