Getting Unknown flag: -v when i run protoc -version in my ubuntu - protocol-buffers

I'm getting the following message when i run protoc -version in my ubuntu terminal.
Unknown flag: -v
Earlier to this, I had got the following error when I ran protoc -version. I found a solution through google and ran "sudo ldconfig /usr/local/lib". After running that, I'm getting the Unknown flag message as mentioned above. Can anyone help me to resolve this? Thanks in advance.
protoc: error while loading shared libraries: libprotoc.so.9: cannot open shared object file: No such file or directory

Long flags require two dashes. Try:
protoc --version
(Common Unix convention says that if you write -abc (with one dash), it means the same thing as -a -b -c, which is why you get the error saying that there is no flag -v. Admittedly, there are a lot of Unix programs that don't follow this rule, but protoc does follow it.)

Related

fatal error: 'libavcodec/avcodec.h' file not found caused by zergon321/reisen

When running Go code on Mac M2 (important, because installation of related libs work differently on Linux) that imports "github.com/zergon321/reisen" I got this:
# github.com/zergon321/reisen
/Users/ido/go/pkg/mod/github.com/zergon321/reisen#v0.1.4/audio.go:4:11: fatal error: 'libavcodec/avcodec.h' file not found
#include <libavcodec/avcodec.h>
^~~~~~~~~~~~~~~~~~~~~~
1 error generated.
I have ffmpeg (includes the libavcodec/avcodec.h header) installed using brew
brew install ffmpeg
but it doesn't get picked up by itself.
This worked to fix it:
If you indeed installed ffmpeg with brew, the header file should be there -> /opt/homebrew/Cellar/ffmpeg/5.1.2/include/libavcodec/avcodec.h (lib version could be different).
If it is not there for some reason, you can try to locate the header file using find / -name "avcodec.h"
Once you have established avcodec.h's location, note the full path to the /include directory and run your go code passing the following flag:
CGO_CPPFLAGS="-I<path/to/include/directory>" go run <your file name or a period>
The full command for me looked like this:
CGO_CPPFLAGS="-I/opt/homebrew/Cellar/ffmpeg/5.1.2/include" go run .

Errors in running from Ubuntu terminal

I am using OMNet++ 6 pre11 with INET 4.3.2 and it is working fine in IDE environment.
But, when I am trying to run INET showcase examples ( wireless/sensornetwork/omnetpp.ini) from the ubuntu terminal, I am getting the following error:
Command
opp_run -m -u Cmdenv -n ../../../src:../..:../../../tutorials:../../../showcases -l ../../../src/INET omnetpp.ini -c BMac
Error
<!> Error: More than one package.ned file for package 'inet.showcases': '/home/fa/Downloads/inet-4.3.2-src/inet4.3/showcases/package.ned' and '/home/fa/Downloads/inet-4.3.2-src/inet4.3/showcases/package.ned'
Would anyone please suggest the solution? Thank you.
This is a known issue in 6.0 preview 11 and 12, caused by the fact that the same directory is added multiple times in the NED path. My guess is that ../.. and ../../../showcases is the same directory. I'm not sure where that ../.. is coming from, but try to get rid of it.
As a side note, this issue was fixed in 6.0pre13 version.

Error message:protoc-gen-go: Plugin failed with status code 1

This is not a duplicate question
First, I made sure I have the following configuration:
1 export GOPATH=/Users/chezixin/go
2 export GOBIN=/Users/chezixin/go/bin
3
4 export GO111MODULE=on
5 # 123
6 export GOPROXY=https://goproxy.cn
7
8
9 export PATH="$PATH:/Applications/Postgres.app/Contents/Versions/12/bin:/Users/chezixin/flutterSDK/flutter/bin:/usr/local/go/bin:$GOPATH:$GOBIN"
10
czxmac:~ chezixin$ echo $PATH
/usr/local/bin:/usr/bin:/bin:/usr/sbin:
/sbin:/Applications/VMwareFusion.app/Contents/Public:
/Applications/Postgres.app/Contents/Versions/latest/bin:
/Applications/Postgres.app/Contents/Versions/12/bin:
/Users/chezixin/flutterSDK/flutter/bin:/usr/local/go/bin:
/Users/chezixin/go:/Users/chezixin/go/bin':
/Users/chezixin/Go/bin:/Applications/Postgres.app/Contents/Versions/12/bin:
/Users/chezixin/flutterSDK/flutter/bin:
/usr/local/go/bin:/Users/chezixin/go:
/Users/chezixin/go/bin:/Users/chezixin/Go/bin
Already installed:
go get -u google.golang.org/grpc
look protoc:
czxmac:~ chezixin$ protoc --version
libprotoc 3.11.1
Protoc-gen-go is installed and exists in $ GOPATH/bin
go get -u github.com/golang/protobuf/protoc-gen-go
problem:
When I execute the following command
$ protoc --go_out=plugins=grpc:. *.proto
An error occurred:
protoc-gen-go: program not found or is not executable
Please specify a program using absolute path or make sure the program is available in your PATH system variable
--go_out: protoc-gen-go: Plugin failed with status code 1.
Where is the problem, please master guidance.
This issue is related with your PATH variable, please set it again.
I can see a typo of an extra trailing apostrophe(') in this line of PATH variable. /Users/chezixin/go:/Users/chezixin/go/bin':
Try updating it to
/Users/chezixin/go:/Users/chezixin/go/bin:
For anyone facing a similar issue, but it was not the case of an invalid PATH variable, I very much sympathize with you.
I realized that I had to install the compiler (again?) before it started working. I hadn't installed it before, but it appeared to already be downloaded. I guess I had to install it again or update it.
I personally was using betterproto, and I followed the instructions here to install it with the protoc plugin and try out their example.

Unable to change GO version in PhotonOS

I have deployed PhotonOS using directions from photon and VIC configuration, while running command docker run -v $(pwd):/go/src/github.com/vmware/vic \-w /go/src/github.com/vmware/vic golang:1.6 make all
an Error appears:
Please install go1.7 (found: go version go1.6.3 linux/amd64)
Makefile:152: recipe for target 'goversion' failed
make: *** [goversion] Error 1
`
to solve it I have tried to update
go1.6.3 to go1.7 using solution - changeing go version manually
after steps go version is showing go1.4.2, but the previous error still complains on go version 1.6.3.
Also, I have tried to install "gvm" using bash < <(curl -s -S -L https://raw.github.com/moovweb/gvm/master/binscripts/gvm-installer) , whenever I try to call gvm install go1.7 it brings
-bash: gvm: command not found
whenever I retry running gvm-installer it says
ERROR: Already installed!
Any help is highly appreciated!!
use :
docker run -v $(pwd):/go/src/github.com/vmware/vic \-w /go/src/github.com/vmware/vic golang:1.7 make all
command instead, that will work on PhotonOS

phpDocumentor crashing when using graphviz

I just managed to get "dot" installed correctly, per a warning in phpDocumentor. Now when I try to build my docs, however, I am getting the exception:
[phpDocumentor\GraphViz\Exception]
An error occurred while creating the graph; GraphViz returned: Format: "svg" not recognized. Use one of:
Does anyone know how to get past this? The command I am running is:
php phpdoc.php -c mypath/phpdoc.dist.xml -p
I had this same issue, running sudo dot -c fixed it for me.

Resources