The command "make serve" not working - google-nativeclient

I have installed the pNaCl SDK and have run the command "make serve", as instructed to by the website https://developers.google.com/native-client/dev/devguide/tutorial/tutorial-part1 into my console, it does not run any server and produces the error message:
C:\Users\USERNAME\Documents\nacl_sdk\nacl_sdk\pepper_33\getting_started>make serv
e
C:/Users/USERNAME/Documents/nacl_sdk/nacl_sdk/pepper_33/tools/make -C part1 all
process_begin: CreateProcess(NULL, python C:/Users/USERNAME/Documents/nacl_sdk/na
cl_sdk/pepper_33/tools/getos.py, ...) failed.
make[1]: Entering directory 'C:/Users/USERNAME/Documents/nacl_sdk/nacl_sdk/pepper
_33/getting_started/part1'
make[1]: Makefile:27: pipe: No error
C:/Users/USERNAME/Documents/nacl_sdk/nacl_sdk/pepper_33/toolchain/_pnacl/bin/pnac
l-clang++ -o hello_tutorial.bc hello_tutorial.cc -O2 -IC:/Users/USERNAME/Document
s/nacl_sdk/nacl_sdk/pepper_33/include -LC:/Users/USERNAME/Documents/nacl_sdk/nacl
_sdk/pepper_33/lib/pnacl/Release -lppapi_cpp -lppapi
process_begin: CreateProcess(NULL, C:/Users/USERNAME/Documents/nacl_sdk/nacl_sdk/
pepper_33/toolchain/_pnacl/bin/pnacl-clang++ -o hello_tutorial.bc hello_tutorial
.cc -O2 -IC:/Users/USERNAME/Documents/nacl_sdk/nacl_sdk/pepper_33/include -LC:/Us
ers/USERNAME/Documents/nacl_sdk/nacl_sdk/pepper_33/lib/pnacl/Release -lppapi_cpp
-lppapi, ...) failed.
make (e=2): The system cannot find the file specified.
Makefile:50: recipe for target 'hello_tutorial.bc' failed
make[1]: *** [hello_tutorial.bc] Error 2
make[1]: Leaving directory 'C:/Users/USERNAME/Documents/nacl_sdk/nacl_sdk/pepper_
33/getting_started/part1'
Makefile:46: recipe for target 'part1_ALL_TARGET' failed
make: *** [part1_ALL_TARGET] Error 2
My username is inserted in the place of USERNAME.
Any ideas what is going on?

I looks like perhaps python is not present in you PATH? Can you run "python" on the command line? What does "where python" produce?
I'm somewhere surprised since python is required to install the SDK in the first place. I've opened a ticket to handle this failure mode:
https://code.google.com/p/chromium/issues/detail?id=348139

I solved this, had the same issues, what i did was (my setup):
It seems compile script doesn't like paths with spaces, like: "C:\Documents and ...".
Make sure python path is at environment variables. "C:\Python27"
Put nacl_sdk folder in "C:\stationary".
Put custom environment variable NACL_SDK_ROOT to "C:\stationary\nacl_sdk\pepper_34".
There i did immediate variable assignee.
A. "cd C:\stationary\nacl_sdk\pepper_34\getting_started".
B. "set NACL_SDK_ROOT C:\stationary\nacl_sdk\pepper_34". This must point to the pepper version you want to build against,
C. "make serve".
And that's it! Works, compiled!

I have encountered and solved the same issue. using comment on old post. I tried building one of the other examples and they seem to work while the getting started one doesn't.
"You will have a hard time building those ppapi tests. I suggest trying to build one of the examples provided with the SDK. If you really need to build that test (it isn't an example) you will need to use clang (another C/C++ toolchain). However, from a cursory look, those tests aren't actually built in NaCl, nor do they generate a PPAPI plugin. I have never gotten clang working on Windows, but it is apparently possible. See clang.llvm.org/get_started.html for instructions using Visual Studio. I would probably use MinGW instead, but I can't find decent instructions for that. – DRayX Oct 21 '13 at 16:08 "

Related

Codelite 17.0.0 occurs "process_begin: CreateProcess(NULL, makedir Debug, ...) failed."

I am just learning C++ via Codelite, which was updated on 01/11. After updating to the latest version, 17.0.0, I get the error
process_begin: CreateProcess(NULL, makedir Debug, ...) failed.
mingw32-make[1]: *** [AssignmentOperator.mk:90: Debug/.d] Error 2,
mingw32-make: *** [Makefile:5: All] Error 2
when I run a simple code.
#include <iostream>
int main(){
std::cout<<"Hello"<<std::endl;
return 0;
}
and get nothing in the terminal window.
How can I fix this problem? Thanks a lot.
I guess the probrem occured since the updating of Codelite, but I have no idea how to fix it.
Looks like a an old relic that was not handled properly during upgrade.
This can be fixed in 2 ways:
Update the mkdir command as defined by your compiler setup:
Go to Settings -> build settings and select your compiler from the list
Select the Tools tab
Select the last entry at the bottom mkdir
Replace the content with the mkdir that comes with CodeLite, for example, if you have installed CodeLite under C:\Program Files\CodeLite (the default path), set it to
"C:/Program Files/CodeLite/mkdir.exe" -p
Notice the double quotes around the command itself
Change the makefile generator used
Right click on your project and open the project settings
In the General tab, under the Makefile Generator change the selection from Default -> CodeLite Makefile Generator
I'm using Mac OS 13.1, and codelite 17.0.0, and when I 'clean', build completed successfully. But when I run its show 'make: ***[All] Error 2.
What happened? just new to learn C++
I had the same problem with Codelite 17 in windows.
Solution:
In Settings - Build - Tools under Makedir select the Path of mkdir.exe within in the Codelite folder (surrounded by " -quotes).
Although context help says to leave it empty in order to use the OS' own mkdir, Windows' mkdir is quite different to the mkdir of other *ix-like OS.
Furthermore for me it was necessary to explicitly add -p
There is a hint in Codelite's change dokumentation in the recent monthly build 17.1 that it solves this problem as a bugfix.

How can I build FreeBSD from source correctly?

I am trying to build FreeBSD from source to see how it works. I googled how to do it, and most of the websites explaining how to build the world tell me to run this command inside the directory of the source code:
sudo make -j1 buildworld KERNCONF=MODEDKERNEL -DNO_CLEAN
For some reason, I keep getting this error...
make: invalid option -- 'D'
make: invalid option -- 'N'
Anyone know how to fix this? The Makefile can be found here
We don't need to see the makefile, because this error is being printed by make due to an invalid command line argument which means it's never even opening the makefile before it fails.
The reason is that -D, etc. are not valid command line options to GNU make. If you run man make (or look online for the GNU make manual) you'll see that -D is not listed as a valid option.
My suspicion is that when the websites you are reading are suggesting that you run make, they mean you should run FreeBSD make, which does support a -D option: https://www.freebsd.org/cgi/man.cgi?make(1)
You are trying to run this using GNU make, which does not have that option.

Build a QT program from command line

I know this question has already been asked, but I encounter an issue that I haven't seen elsewhere.
I am trying to build automatically a QT program on Jenkins through a JenkinsFile.
So I want to build this program in command line.
On Qt Creator, everything works fine, my makefile is generated and the program compiles.
But when I manually type the exact commands that are executed in Qt on a terminal (cmd and cygwin), the compilation fails.
The errors are usually ld: cannot find -lXXXXXX
My guess is that it is an environment problem so I tried to add some lib paths in the $PATH, $LIBRARY_PATH, and $LD_LIBRARY_PATH variables but it doesn't resolve the problem. The error just becomes Undefined reference to ___XXXXXX
I would appreciate some help on this issue !
Thanks.
EDIT
The building (slave) machine is a windows 7. Here is a screenshot of the compilation stage in Qt (which works fine). The commands I try to type in a terminal are exactly the same as the blue lines on the screenshot. (sorry some lines are written in French)
From the error message ld: cannot find -lXXXXXX and the environment variables, I would suppose that you are compiling in Linux/Unix. Now, if you are compiling with g++, the environment variables $PATH, $LIBRARY_PATH, and $LD_LIBRARY_PATH won't have any effect on finding libraries. What you may try is an -L argument to the compiler telling it where the library is located, I mean:
g++ -L /path/to/libXXXXX.so -l XXXXX -o result source.cpp

Missing Separator Error in Makefile

I am working on Qt 4.7.2 on Windows. I have generated Makefile, Makefile.Debug and Makefile.Release. However, when I try to use mingw32-make to build an executable, I get the following error:
mingw32-make -f Makefile.Debug all
mingw32-make[1]: Entering directory `C:/Qt/4.7.2/src/plugins/sqldrivers/mysql'
Makefile.Debug:61: *** missing separator. Stop.
mingw32-make[1]: Leaving directory `C:/Qt/4.7.2/src/plugins/sqldrivers/mysql'
mingw32-make: *** [debug-all] Error 2
Obviously this answer is late, but I'm answering it for posterity... this hit me today.
Frank Osterfeld almost certainly had it right. Not sure how you generated the makefiles, but they're probably nmake makefiles, not mingw makefiles. You can tell by looking at the top of Makefile.Debug. If you see "CXX = cl", not "CXX = g++", then that's your problem.
In my case, I hit this error when trying to compile the Qt SDK itself. Long story short: I needed to specify "-platform win32-g++" on the configure command line (it defaulted to win32-msvc).
"Missing separator" almost always means you have a line that should begin with a tab that instead begins with a space.
If you'd actually shown us what was at line 61 of the Makefile.debug file, we could give you a better answer. "Missing separator" is make's version of "syntax error". It basically means make saw a line in the makefile that it couldn't figure out.
One reason could be, as William Pursell mentions, that you have spaces introducing your recipe lines but there are plenty of other reasons. Maybe you forgot the ":" between the target and prerequisite, or the "=" in a variable assignment. There are other possibilities.

compiling qt 4.7.3 on mingw32 with gcc 4.6.0

I am trying to compile Qt 4.7.3 on mignw32 using gcc 4.6.0.
I get the following error when running ./configure:
In file included from C:/work/qt-gcc-4.6.0/include/QtCore/private/qcore_unix_p.h:1:0,
from C:/work/qt-gcc-4.6.0/src/corelib/io/qfsfileengine_unix.cpp:45:
C:/work/qt-gcc-4.6.0/include/QtCore/private/../../../src/corelib/kernel/qcore_unix_p.h:59:3: error: #error "qcore_unix_p.h included on a non-Unix system"
The weird thing is that I am running Windows 7, and it is trying to include that.
Also in the Makefile it is using qfsfileengine_unix and qfsfileengine_iterator_unix instead of qfsfileengine_win and qfsfileengine_iterator_win.
If I change the Makefile to use the Windows' ones, I get the following error (the file does not exist):
In file included from C:/work/qt-gcc-4.6.0/include/QtCore/../../src/corelib/global/qglobal.h:62:0,
from C:/work/qt-gcc-4.6.0/include/QtCore/qglobal.h:1,
from C:/work/qt-gcc-4.6.0/mkspecs/win32-g++/qplatformdefs.h:53,
from C:/work/qt-gcc-4.6.0/src/corelib/io/qfsfileengine_win.cpp:43:
C:/work/qt-gcc-4.6.0/include/QtCore/qconfig.h:1:46: fatal error: ../../src/corelib/global/qconfig.h: No such file or directory
compilation terminated.
When compiling /qt/src/corelib/io/qfsfileengine_win.cpp
Suggestions?
Try ./configure --help
There is probably a flag for a ms-windows, x86 compilation.
It might be something like:
./configure --target-os=mingw32
Keep in mind -- the os parameter name might be different, and the selectable target values *might be different* -- with scripts from different authors -- some values you might encounter might be 'win32', 'win32-386', 'x86-windows32', etc.
See if
./configure --help
Won't give you a list...
You can also redirect its output to a file for easy reading in your favorite editor,
./configure --help > myconfighelp.txt
Good luck!

Resources