Reprinted! Please indicate the source when reprint: http://write.blog.csdn.net/postedit/8195159
I have been entangled in this problem for a day or two. I checked various materials. According to the online materials, the problem of path ing is the same as my current conclusion ..
I recently studied Google protocol buffer and needed to compile a. proto extension helloworld. proto file with cygwin.
Helloworld. proto Directory: C: \ Users \ Potter \ Documents \ work \ protocol buffer \ protobuf-2.4.1 \ SRC (under my directory)
We open cygwin directly, and then I use the following command to compile it. As follows:
The path I drew with the red line is indeed correct, and CD can also be used directly. Why is the prompt no such file or directory?
If you read it carefully, you will find a potter @ Potter-PC ~ Yes, that's the problem. cygwin needs to input the relative path...
If the completion path is like this:/home/Potter/cygdrive/C/users/Potter/documents/work/protocol \ buffer/protobuf-2.4.1/src/That's it
In fact, the above/home/Potter is the root directory of Linux simulated by cygwin...
After talking about this for a long time, how can we use it directly?
Solution 1:
CD to the root directory of helloworld. proto and then run:
No prompt. Basically, the compilation is successful...
I am not mistaken. What should I do if my files are not in this directory?
Solution 2:
You can always store the files in the same disk as the files to be compiled ~ If it is on a different disk, I do not know how cygwin is written for reference. If you know it, please tell me, thank you ~
The input method is as follows:
OK generation successful ~ In fact, method 2 and method 1 are the same, but I want to explain that, first CD to the root directory of the same drive letter, such as the C drive here... then, you can easily compile it ~
Q: How does cygwin reference different disks? Tell me if you know it ~ Thanks
Okay. I will go hiking tomorrow morning ~ I have to raise my spirits. I am asleep ~ Haha ~
Thank you for reading my blog and hope you can see your footprints!
If something is wrong or incorrect,I also hope you can point it out!