everettwilson21 / protobuf-netbeans-plugin

Automatically exported from code.google.com/p/protobuf-netbeans-plugin
0 stars 0 forks source link

It is possible to compile .proto files for C++ within a C++ project? #9

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
If add a .proto file to my C++ project, and select "Regenerate files from
this definition", it generates null/protobuf-java/myfile.java but not C++
files.

The output:

running: /usr/bin/protoc --proto_path="/myprojectpath" --java_out
"/myprojectpath/null/protobuf-java" "/myprojectpath/templates/myfile.proto"
Exit: 0

Within a Java project, I can see the option to generate C++ code as per
your screenshot
http://protobuf-netbeans-plugin.googlecode.com/svn/site/img/buildIntegration.jpe
g

However I don't actually get any C++ files generated - it creates a
./build/generated-sources/protobuf-cpp directory, but no files within that.

In any case, what I want is to enabling this within a C++ project.  Is this
supported?  If not, do you plan to support this?

I'm using Netbeans 6.7 on Ubuntu 9, with version 2.0 of the plugin.

Original issue reported on code.google.com by therefro...@gmail.com on 8 Sep 2009 at 11:16

GoogleCodeExporter commented 8 years ago
Is it a java project or C++ project ?

The checkboxes on the screen are connected to protobuf regeneration during the
project build (not during the "Regenerate..."). I know - it is not clear. 

C++ generation during "Project clean and rebuild" should work for "Java 
project". 

Original comment by piotr.tabor on 8 Sep 2009 at 11:22

GoogleCodeExporter commented 8 years ago
It's a C++ project.

But protoc only generates Java, not C++.

Original comment by therefro...@gmail.com on 8 Sep 2009 at 11:25

GoogleCodeExporter commented 8 years ago
I fixed that in the current version (2.0.1, but PrototbufGenerator is 2.0.3). 
By aware that protoc generates *.cc files, but Netbeans on the 'Projects' tab 
shows 
only *.cpp files by default. Reconfigure that or look at the 'Files' tab. 

Original comment by piotr.tabor on 10 Oct 2009 at 5:54

GoogleCodeExporter commented 8 years ago
Confirm that it works for you, please. 

Original comment by piotr.tabor on 10 Oct 2009 at 5:55

GoogleCodeExporter commented 8 years ago
Thanks, I can confirm that the updated version generates C++ files.

Note that it generates them in the project root directory, whereas by symmetry 
with
the Java version I'd expect them to be in 
./build/generated-sources/protobuf-cpp/

Original comment by therefro...@gmail.com on 12 Oct 2009 at 11:21

GoogleCodeExporter commented 8 years ago
I'm afraid there is no 'generic' generated-sources support for other projects 
then
Java in netbeans (6.7.1) now. So for C++ the file is generated in the same 
directory
as source *.proto file. For most C++ projects I've worked with it was 
convenient. 

If you still argue for the behavior - please open a new ticket. 

Original comment by piotr.tabor on 18 Oct 2009 at 10:49