Giter VIP home page Giter VIP logo

Comments (10)

jaiminpan avatar jaiminpan commented on August 17, 2024

执行编译器前,请先确保可以执行pg_config 命令

from pg_jieba.

RingWong avatar RingWong commented on August 17, 2024

pg_config 是可以执行的

from pg_jieba.

gzliudan avatar gzliudan commented on August 17, 2024

git clone https://github.com/jaiminpan/pg_jieba
cd pg_jieba
git submodule update --init --recursive
mkdir build
cd build
cmake -DCMAKE_PREFIX_PATH=/usr/pgsql-10 -DCMAKE_CXX_FLAGS="-Wall -std=c++11" ..
make
make install

from pg_jieba.

miaojianxin avatar miaojianxin commented on August 17, 2024

我这样执行的cmake -DCMAKE_PREFIX_PATH=/usr/pgsql-10 -DCMAKE_CXX_FLAGS="-Wall -std=c++11" ..
报这样的错误,怎么弄呢In file included from /opt/pg10/include/postgresql/server/postgres.h:47:0,
from /mjx_pg/pg_jieba/pg_jieba/pg_jieba.cpp:21:
/usr/include/libintl.h:39:14: error: expected unqualified-id before ‘const’
extern char *gettext (const char *__msgid)
^
/usr/include/libintl.h:39:14: error: expected ‘)’ before ‘const’
/usr/include/libintl.h:39:14: error: expected initializer before ‘const’
/usr/include/libintl.h:44:14: error: expected unqualified-id before ‘const’
extern char *dgettext (const char *__domainname, const char *__msgid)

from pg_jieba.

gzliudan avatar gzliudan commented on August 17, 2024

我是在centos 7.x下用yum安装的pg 10,所以 -DCMAKE_PREFIX_PATH=/usr/pgsql-10 ,你的系统、版本、目录不同,要改一下

yum install -y postgresql10 postgresql10-server postgresql10-contrib postgresql10-plpython postgresql10-devel

from pg_jieba.

miaojianxin avatar miaojianxin commented on August 17, 2024

这个我知道,我改了,是我自己的路径,我的pg10是我代码编译安装的(./configure,make,make install), 我感觉这个错误,是c++11新特性跟以前方式编译的pg是不是不兼容, 我应该再怎么改呢,谢谢啦,网上也搜不到,还是只能用yum那么装?

from pg_jieba.

miaojianxin avatar miaojianxin commented on August 17, 2024

我gcc 版本是4.8.5 ,我加了支持c++11的选项,编译pg_jieba时候, 这样的话,导致pg依赖的底层那种纯c的东西可能跟 这个c++11不兼容, 该怎么改,感觉还得加些选项, 我c++11一次使用

from pg_jieba.

gzliudan avatar gzliudan commented on August 17, 2024

centos 7.x带的gcc就是4.8.5,我用 -DCMAKE_CXX_FLAGS="-Wall -std=c++11" 的选项编译10.1没问题

from pg_jieba.

miaojianxin avatar miaojianxin commented on August 17, 2024

好了,好了, 我调整了jieba.hpp头文件的位置,就好了
#include "cppjieba/Jieba.hpp"
放在 extern c之前,就好了,别人都没碰到这个问题,不知道是不是环境问题,我也是gcc4.8.5,centos7

from pg_jieba.

 avatar commented on August 17, 2024

我也遇到此问题了,调整jieba.hpp位置就好了,thanks。

from pg_jieba.

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.