environment:

ubuntu 16.04

netbeans 8.2

ygopro Fluorohydride with Irrlicht Game Engine

问题1: google protobuf 提示 string ambiguous, string 类型和 Irrlicht 引擎冲突。

尝试的方法:

1、修改protobuf源码 string -> ::std::string。(冲突项太多,放弃这个方法。)

2、调整编译顺序,将pb.h放到include顶部,优先编译。

问题2: google protobuf 提示 不允许-fno-rtti

解决方法: CFLAGS 移除 -fno-rtti

问题3: netbeans IDE 导入 ygopro cpp 项目 from makefile,编译单个文件 通过,编译项目 通过,链接protobuf失败,提示 “undefined reference to `tutorial::Person_PhoneNumber::Person_PhoneNumber()'”。

尝试的方法:

`pkg-config --cflags --libs protobuf`

CFLAGS/CXXFLAGS/CXXFLAGS/LIBS += -D_GLIBCXX_USE_CXX11_ABI=0 -lprotobuf

LDDEPS += /usr/local/lib/libprotobuf.a /usr/local/lib/libprotobuf.so

@echo $(LINKCMD) 查看g++链接命令

添加生成obj: addressbook.pb.o

# GNU Make project makefile autogenerated by Premake
ifndef config
config=debug
endif ifndef verbose
SILENT = @
endif ifndef CC
CC = gcc
endif ifndef CXX
CXX = g++
endif ifndef AR
AR = ar
endif ifeq ($(config),debug)
OBJDIR = ../obj/Debug/ygopro
TARGETDIR = ../bin/debug
TARGET = $(TARGETDIR)/ygopro
DEFINES += -DLUA_USE_LINUX -D_DEBUG
INCLUDES += -I../ocgcore -I/usr/include/lua -I/usr/include/lua5. -I/usr/include/lua/5.2 -I/usr/include/irrlicht -I/usr/include/freetype2
CPPFLAGS += -MMD -MP $(DEFINES) $(INCLUDES)
CFLAGS += $(CPPFLAGS) $(ARCH) -g -fno-strict-aliasing -Wno-multichar -std=gnu++0x
CXXFLAGS += $(CFLAGS)
LDFLAGS += -L../bin/debug
LIBS += -locgcore -lclzma -lIrrlicht -lfreetype -lsqlite3 -llua -levent -levent_pthreads -lGL -ldl -lpthread
RESFLAGS += $(DEFINES) $(INCLUDES)
LDDEPS += ../bin/debug/libocgcore.a ../bin/debug/libclzma.a
LINKCMD = $(CXX) -o $(TARGET) $(OBJECTS) $(LDFLAGS) $(RESOURCES) $(ARCH) $(LIBS) /usr/local/lib/libprotobuf.a /usr/local/lib/libprotobuf.so
define PREBUILDCMDS
endef
define PRELINKCMDS
endef
define POSTBUILDCMDS
endef
endif ifeq ($(config),release)
OBJDIR = ../obj/Release/ygopro
TARGETDIR = ../bin/release
TARGET = $(TARGETDIR)/ygopro
DEFINES += -DLUA_USE_LINUX -DNDEBUG
INCLUDES += -I../ocgcore -I/usr/include/lua -I/usr/include/lua5. -I/usr/include/lua/5.2 -I/usr/include/irrlicht -I/usr/include/freetype2
CPPFLAGS += -MMD -MP $(DEFINES) $(INCLUDES)
CFLAGS += $(CPPFLAGS) $(ARCH) -g -O3 -fno-strict-aliasing -Wno-multichar -march=native -std=gnu++0x -fno-rtti
CXXFLAGS += $(CFLAGS)
LDFLAGS += -L../bin/release
LIBS += -locgcore -lclzma -lIrrlicht -lfreetype -lsqlite3 -llua -levent -levent_pthreads -lGL -ldl -lpthread -lprotobuf
RESFLAGS += $(DEFINES) $(INCLUDES)
LDDEPS += ../bin/release/libocgcore.a ../bin/release/libclzma.a
LINKCMD = $(CXX) -o $(TARGET) $(OBJECTS) $(LDFLAGS) $(RESOURCES) $(ARCH) $(LIBS)
define PREBUILDCMDS
endef
define PRELINKCMDS
endef
define POSTBUILDCMDS
endef
endif OBJECTS := \
$(OBJDIR)/duelclient.o \
$(OBJDIR)/deck_con.o \
$(OBJDIR)/client_field.o \
$(OBJDIR)/single_duel.o \
$(OBJDIR)/materials.o \
$(OBJDIR)/netserver.o \
$(OBJDIR)/replay_mode.o \
$(OBJDIR)/CGUITTFont.o \
$(OBJDIR)/single_mode.o \
$(OBJDIR)/menu_handler.o \
$(OBJDIR)/event_handler.o \
$(OBJDIR)/gframe.o \
$(OBJDIR)/data_manager.o \
$(OBJDIR)/image_manager.o \
$(OBJDIR)/deck_manager.o \
$(OBJDIR)/replay.o \
$(OBJDIR)/client_card.o \
$(OBJDIR)/drawing.o \
$(OBJDIR)/tag_duel.o \
$(OBJDIR)/game.o \
$(OBJDIR)/CGUIImageButton.o \
$(OBJDIR)/addressbook.pb.o \ RESOURCES := \ SHELLTYPE := msdos
ifeq (,$(ComSpec)$(COMSPEC))
SHELLTYPE := posix
endif
ifeq (/bin,$(findstring /bin,$(SHELL)))
SHELLTYPE := posix
endif .PHONY: clean prebuild prelink all: $(TARGETDIR) $(OBJDIR) prebuild prelink $(TARGET)
@: $(TARGET): $(GCH) $(OBJECTS) $(LDDEPS) $(RESOURCES)
@echo Linking ygopro
@echo $(LINKCMD)
$(SILENT) $(LINKCMD)
$(POSTBUILDCMDS) $(TARGETDIR):
@echo Creating $(TARGETDIR)
ifeq (posix,$(SHELLTYPE))
$(SILENT) mkdir -p $(TARGETDIR)
else
$(SILENT) mkdir $(subst /,\\,$(TARGETDIR))
endif $(OBJDIR):
@echo Creating $(OBJDIR)
ifeq (posix,$(SHELLTYPE))
$(SILENT) mkdir -p $(OBJDIR)
else
$(SILENT) mkdir $(subst /,\\,$(OBJDIR))
endif clean:
@echo Cleaning ygopro
ifeq (posix,$(SHELLTYPE))
$(SILENT) rm -f $(TARGET)
$(SILENT) rm -rf $(OBJDIR)
else
$(SILENT) if exist $(subst /,\\,$(TARGET)) del $(subst /,\\,$(TARGET))
$(SILENT) if exist $(subst /,\\,$(OBJDIR)) rmdir /s /q $(subst /,\\,$(OBJDIR))
endif prebuild:
$(PREBUILDCMDS) prelink:
$(PRELINKCMDS) ifneq (,$(PCH))
$(GCH): $(PCH)
@echo $(notdir $<)
-$(SILENT) cp $< $(OBJDIR)
$(SILENT) $(CXX) $(CXXFLAGS) -o "$@" -c "$<"
endif $(OBJDIR)/duelclient.o: ../gframe/duelclient.cpp
@echo $(notdir $<)
$(SILENT) $(CXX) $(CXXFLAGS) -o "$@" -c "$<"
$(OBJDIR)/deck_con.o: ../gframe/deck_con.cpp
@echo $(notdir $<)
$(SILENT) $(CXX) $(CXXFLAGS) -o "$@" -c "$<"
$(OBJDIR)/client_field.o: ../gframe/client_field.cpp
@echo $(notdir $<)
$(SILENT) $(CXX) $(CXXFLAGS) -o "$@" -c "$<"
$(OBJDIR)/single_duel.o: ../gframe/single_duel.cpp
@echo $(notdir $<)
$(SILENT) $(CXX) $(CXXFLAGS) -o "$@" -c "$<"
$(OBJDIR)/materials.o: ../gframe/materials.cpp
@echo $(notdir $<)
$(SILENT) $(CXX) $(CXXFLAGS) -o "$@" -c "$<"
$(OBJDIR)/netserver.o: ../gframe/netserver.cpp
@echo $(notdir $<)
$(SILENT) $(CXX) $(CXXFLAGS) -o "$@" -c "$<"
$(OBJDIR)/replay_mode.o: ../gframe/replay_mode.cpp
@echo $(notdir $<)
$(SILENT) $(CXX) $(CXXFLAGS) -o "$@" -c "$<"
$(OBJDIR)/CGUITTFont.o: ../gframe/CGUITTFont.cpp
@echo $(notdir $<)
$(SILENT) $(CXX) $(CXXFLAGS) -o "$@" -c "$<"
$(OBJDIR)/single_mode.o: ../gframe/single_mode.cpp
@echo $(notdir $<)
$(SILENT) $(CXX) $(CXXFLAGS) -o "$@" -c "$<"
$(OBJDIR)/menu_handler.o: ../gframe/menu_handler.cpp
@echo $(notdir $<)
$(SILENT) $(CXX) $(CXXFLAGS) -o "$@" -c "$<"
$(OBJDIR)/event_handler.o: ../gframe/event_handler.cpp
@echo $(notdir $<)
$(SILENT) $(CXX) $(CXXFLAGS) -o "$@" -c "$<"
$(OBJDIR)/gframe.o: ../gframe/gframe.cpp
@echo $(notdir $<)
$(SILENT) $(CXX) $(CXXFLAGS) -o "$@" -c "$<"
$(OBJDIR)/data_manager.o: ../gframe/data_manager.cpp
@echo $(notdir $<)
$(SILENT) $(CXX) $(CXXFLAGS) -o "$@" -c "$<"
$(OBJDIR)/image_manager.o: ../gframe/image_manager.cpp
@echo $(notdir $<)
$(SILENT) $(CXX) $(CXXFLAGS) -o "$@" -c "$<"
$(OBJDIR)/deck_manager.o: ../gframe/deck_manager.cpp
@echo $(notdir $<)
$(SILENT) $(CXX) $(CXXFLAGS) -o "$@" -c "$<"
$(OBJDIR)/replay.o: ../gframe/replay.cpp
@echo $(notdir $<)
$(SILENT) $(CXX) $(CXXFLAGS) -o "$@" -c "$<"
$(OBJDIR)/client_card.o: ../gframe/client_card.cpp
@echo $(notdir $<)
$(SILENT) $(CXX) $(CXXFLAGS) -o "$@" -c "$<"
$(OBJDIR)/drawing.o: ../gframe/drawing.cpp
@echo $(notdir $<)
$(SILENT) $(CXX) $(CXXFLAGS) -o "$@" -c "$<"
$(OBJDIR)/tag_duel.o: ../gframe/tag_duel.cpp
@echo $(notdir $<)
$(SILENT) $(CXX) $(CXXFLAGS) -o "$@" -c "$<"
$(OBJDIR)/game.o: ../gframe/game.cpp
@echo $(notdir $<)
$(SILENT) $(CXX) $(CXXFLAGS) -o "$@" -c "$<"
$(OBJDIR)/CGUIImageButton.o: ../gframe/CGUIImageButton.cpp
@echo $(notdir $<)
$(SILENT) $(CXX) $(CXXFLAGS) -o "$@" -c "$<"
$(OBJDIR)/addressbook.pb.o: ../gframe/addressbook.pb.cc
@echo $(notdir $<)
$(SILENT) $(CXX) $(CXXFLAGS) -o "$@" -c "$<" -include $(OBJECTS:%.o=%.d)

ubuntu netbeans compile ygopro client with google protobuf lib的更多相关文章

  1. google protobuf使用

    下载的是github上的:https://github.com/google/protobuf If you get the source from github, you need to gener ...

  2. Netty学习——Google Protobuf使用方式分析和环境搭建

    Google Protobuf使用方式分析 在RPC框架中,Google Protobuf是很常用的一个库,和Apache Thrift 是同款的用于进行序列化的第三方库.原理都是大同小异,无非就是使 ...

  3. google protobuf初体验

    最近在读别人代码的时候发现一个的东西,名字叫protobuf, 感觉挺好用的,写在这里,留个记录.那么什么是protobuf 呢?假如您在网上搜索,应该会得到类似这样的文字介绍: Google Pro ...

  4. Google protobuf

    个人理解: 定义.proto文件就是指明消息里包含的成员和类型,protoc会compile成相应的java文件包含interface和implementation class,然后在构建messag ...

  5. 使用CSharp编写Google Protobuf插件

    什么是 Google Protocol Buffer? Google Protocol Buffer( 简称 Protobuf) 是 Google 公司内部的混合语言数据标准,目前已经正在使用的有超过 ...

  6. (中级篇 NettyNIO编解码开发)第八章-Google Protobuf 编解码-2

    8.1.2    Protobuf编解码开发 Protobuf的类库使用比较简单,下面我们就通过对SubscrjbeReqProto进行编解码来介绍Protobuf的使用. 8-1    Protob ...

  7. VS下使用Google Protobuf完成SOCKET通信

    如何在Windows环境下的VS中安装使用Google Protobuf完成SOCKET通信 出处:如何在Windows环境下的VS中安装使用Google Protobuf完成SOCKET通信 最近一 ...

  8. netty 的 Google protobuf 开发

    根据上一篇博文 Google Protobuf 使用 Java 版 netty 集成 protobuf 的方法非常简单.代码如下: server package protobuf.server.imp ...

  9. Google Protobuf 使用 Java 版

    一 . Protobuf 的入门 Protobuf 是一个灵活,高效,结构化的数据序列化框架, 相比于 XML 等传统的序列化工具,它更小,更快,更灵活,更简单. Protobuf 支持数据结构化一次 ...

随机推荐

  1. c#文件转化byte数组

    public static byte[] ReadFile(string fileName) { if (!File.Exists(fileName)) { throw new Exception(& ...

  2. 大家AK杯 灰天飞雁NOIP模拟赛题解/数据/标程

    数据 http://files.cnblogs.com/htfy/data.zip 简要题解 桌球碰撞 纯模拟,注意一开始就在袋口和v=0的情况.v和坐标可以是小数.为保险起见最好用extended/ ...

  3. Only one database connection at a time is supported

      Only one database connection at a time is supported 在网上找到了2个方法: 1. VSS在使用过程中,尤其是数据迁移的过程中,可能会出现上述情况 ...

  4. hdoj 2955 Robberies

    Robberies Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total S ...

  5. Ubuntu16.04编译安装php

    #Ubuntu16.04编译安装php Ubuntu16.04上面搭建基于Nginx的php服务.Nginx使用apt直接安装的. sudo apt install nginx php的安装部署步骤主 ...

  6. BZOJ 3280: 小R的烦恼 & BZOJ 1221: [HNOI2001] 软件开发

    3280: 小R的烦恼 Time Limit: 10 Sec  Memory Limit: 512 MBSubmit: 399  Solved: 200[Submit][Status][Discuss ...

  7. 库不存在的排查方法:ImportError: No module named selenium2Library

    解决办法: 把selenium2Library改成Selenium2Library   安装下面四个: python-2.7.13.amd64.msi robotframework-ride-1.5. ...

  8. Android ArrayAdpater 填充集合

    在这里我们新创建一个任务来演示 然后再布局文件中定义一个ListView 来当作显示数据的容器,布局文件代码如下: <LinearLayout xmlns:android="http: ...

  9. 用来理解 Java 编程语言的 8 个图表

    原文地址: http://www.oschina.net/news/44438/top-8-diagrams-for-understanding-java 很多时候,一张图比你说 1000 个字能更有 ...

  10. [AngularJS] angular-formly: expressionProperties

    angular-formly provides a very simple API to dynamically change properties of your field (like disab ...