---
title: "导出protobuf生成的c++结构"
author: "johnsmith9th"
date: "2024-12-09T10:01:54Z"
tags: []
categories: ["编程语言"]
slug: "protobuf-c"
draft: false
lastmod: "2024-12-23T15:16:55Z"
id: 2540215
url: "https://johnsmith9th.iteye.com/blog/2540215"
---

protoc -I . --cpp\_out=dllexport\_decl=XXXXX\_DLL\_API:. --csharp\_out=. xxxxxx.proto

 

补充：

工程配置中的预定义宏需要加上XXXXX\_DLL\_API=\_\_declspec(dllexport); 这样的话产生的头文件对于本工程来说就是在导出，对于引用工程来说就是导入了