Protoc Output Directory Issue - No Such File or Directory - c++

I recently finished the basic tutorial for C++ here and wanted to set up a project based on the proto files from here. I followed a similar directory structure as the tutorial and changed up the CMakeLists.txt file to accommodate the new files.
I'm currently trying to just compile the manager.proto file. I was able to compile the file and get my server/client files, however the files are being outputted within cmake/build/minknow_api rather than the expected cmake/build folder. This meant the make command would return the error:
clang: error: no such file or directory: '/Users/name/Documents/grpc/examples/cpp/minknow_api/cmake/build/manager.grpc.pb.cc'
clang: error: no input files
I read that it was because protoc outputs based on the imports of the proto file, i.e the file comes with import minknow_api/device.proto for instance. I copied the files from within the cmake/build/minknow_api into cmake/build/ and reran make and it seemed to work, however, the C++ file imports as expected are searching within a minknow_api directory, meaning I'd have to manually edit these imports to look within the current directory instead of to then compile successfully.
I've tried experimenting with trying to get rid of the minknow_api from the proto imports, however had no luck and only got more import issues during compilation. It seems some files have the same names for messages etc, which means I had to keep the minknow.somename as the package so I can thus distinguish in the files which imported values I wanted to access. I've also tried moving files into their own directories like instance.proto which has package minknow.instance would go inside of instance directory, but still no luck.
I was wondering if anyone could figure out how to get rid of the minknow_api out of my proto imports properly so that I won't get these import and output directory issues down the track?

Related

LNK1181 Error while compiling the core after adding a module

I'm trying to compile my core with some modules but i'm getting the following error when building worldserver:
cannot open input file '..\..\..\modules\RelWithDebInfo\modules.lib' worldserver
This error only happens when compiling with the mod-gain-honor-guard module. I've installed a repack before that came with this module pre-installed, which makes me think that i'm the one missing something.
Any ideas?
Thanks!
I've compiled the core succesfully with only one module, then i've added the one mentioned before and that error came up. CMake didn't show me any error when i regenerated the source for building after adding the module
You always need to regenerate the source in CMake when you add or remove any files to the source.
Did you get the module via git clone? If not, and it's a direct download, you need to remove the -master or any other branch name from the folder name.

Generating working CHM files using Doxygen and GraphViz (Invalid .hhc file?)

I'm in the middle of documenting my C++ GUI library and I just started using Doxygen. I've got two test files that are documented now, but I have problems when trying to generate the CHM help files. Doxygen runs without error, and dot appears to be functioning correctly to generate images.
However, it appears the resulting .hhc, .hhk, and .hhp files are broken in some way. index.hhc and index.hhk are exactly the same and running 'hhc index.hhp' does not work. It returns an error :
HHC6000: Error: An internal file could not be created. Make certain there is enough disk space on the drive where you are compiling your file.
HHC5007: Error: Fatal navigational compilation error. This is likely the result of an invalid contents (.hhc) file.
I have uploaded a zip file of my two test sources, the Doxyfile generated by the Doxy Wizard, and the .hh* files created by doxygen.
http://members.allegro.cc/EdgarReynaldo/temp/test1.zip
Both HTML Help Workshop and GraphViz are on my path.
Do I need to change a setting in the doxyfile? How do I fix this?
Regards, bugsquasher
EDIT
After taking albert 's advice, everything seemed to magically work. Nothing was really different though.

How to generate files outside the current package in Bazel

I am trying to write a bazel extension that reads some files and generates other files. I am using ctx.actions.declare_file and ctx.actions.declare_directory functions to declare files that I would like to generate, and then declare actions that generate these files. So far so good.
When I try to declare files/directories that are outside the current package though, Bazel complaints. For example, say that I have a source file src = <source file foo/bar.proto>, meanwhile the current rule is being executed when called by a rule //baz/proto:some_target. When I try declaring a generated file as follows
generated_src = ctx.actions.declare_file(src.basename, sibling=src)
Bazel complaints saying Output artifact 'foo/bar.proto' not under package directory 'baz/proto' for target '//baz/proto:some_target'. Looking at the documentation for ctx.actions.declare_file, this is expected.
My question is, is there some other way to declare a file that is not in the current package?

Dart2JS Pub Build Fails to Traverse Project Folders Correctly

I'm working on a long-term project for some time now. After moving some folders around, correctly refactoring different parts of the code, Webstorm's Dart analyser is showing NO errors, but running either pub serve or pub build fails.
Pub or Dart2JS doesn't seems to be traversing folders correctly.
This is the first error I get:
[Error from Dart2JS on CS_Game_Engine|web/main.dart]:
web/UIElements/NodeSettingsItems/TextVariableEditor.dart:4:1:
Can't read 'file:///Data/ownCloud/cybersecgame/CS%20Game%20Engine/web/UIElements/Data/Variables/Variable.dart' (Could not find asset CS_Game_Engine|web/UIElements/Data/Variables/Variable.dart.).
import '../../Data/Variables/Variable.dart';
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
This is interesting, because the file TextVariableEditor.dart, as you see in the error, is located in the web/UIElements/NodeSettingsItems/ directory.
The file I am trying to access (Variables.dart) is located in web/Data/Variables/Variable.dart.
The import statement moves 2 folders up with the ../../, but Pub or Dart2JS is not going 2 folders up, its only going 1 folder up. See the error again:
Can't read 'file:///Data/ownCloud/cybersecgame/CS%20Game%20Engine/web/UIElements/Data/Variables/Variable.dart'
It's looking for the file in the wrong place. I'm not sure what to do to fix this, and I've looked around and can't really find anything. Again, Webstorm's Dart Analyzer shows no issues, but the pub build or pub serve both fail, unable to find the file.
I've used the ../../ many times before in my code, but this is the first time it is causing issues. There are other errors similar to this, but having the same issue of not reading the ../../ correctly.
Update 1:
I've done more testing, and adding an additional ../ to the path's beginning fixes the error during the pub build. However, now Webstorm and it's Dart Analyzer is showing lots of errors since the path is obviously wrong (1 too many ../). This is a workaround, but not a fix. Does anybody know why pub or the Dart2JS is reading the path incorrectly? Somehow skipping one of the ../?
Code within the web directory should only access files in two places:
Things in the web directory, via relative paths
Things in packages via package: imports
#2 is interesting. This can include files within your own project, you just need to put those files in the lib directory and access them via a package:my_proj URI.
See https://github.com/dart-lang/sample-pop_pop_win/ as an example
See also https://www.dartlang.org/tools/pub/package-layout

Ns3 adding a new module-- gcc not finding included headers

I am trying to add a new custom module to NS3Network Simulator 3 and I am having trouble making the header files of the module visible to the compiler.
Here is what I did:
1.I followed thisguide to add a new noc module using the createModule script.
2.I went on and copied my module files into the new created noc directory and made waf(the build system ns3 uses) aware of my new files through editing the wscript file.
3.It is my understanding that with all this set up(I probably wrong) that with this set up,running the waf commands to rebuild ns3 should rebuild ns3 with my new module.
To build I give the following commands:
./waf clean
./waf configure --enable examples
./waf build
The system goes on and builds ns3 and when it gets to my noc module it throws errors about objects of a Scalar Class not being defined in the scope.This usually means that I haven't included the header files but I have tried to copy them with other module files and included them with statements like #include "nstime.h" .With this the problem persisted. I tried copying the header with the definition of my class in the /usr/include directory and inlcuded it with #include and the problem is still there.
I realize this is a long post ,I am sorry but I would really appreciate it if somebody helped point out what I am missing.Thank you for your time.
You should also make sure in your wscript file that you add the dependencies of your module to other ns-3 modules as explained here.