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.
Related
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.
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
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 "
I'm using the tar command in UNIX to perform backups of particular directories. However, some directories contain files/sub-directories which the current user doesn't have any read permissions on. As a result the tar command is returning a non 0 exit code.
I came across the following modifier in the man pages '--ignore-failed-read', which suppresses the non 0 exit code when encountering files it cannot read. However, whenever I try using it I get the error 'unknown function modifier'.
Could anyone help me out here?
my tar command looks something like this:
tar --create --ignore-failed-read --file=test.tar my_dir
Your command seems to be perfectly valid and I don't see any typos/mistakes.
To be absolutely sure, I just tried it on my VM running under 32 bit Debian 7.1 (wheezy) with stock kernel 3.2.0.4. As I suspected, archive has been created successfuly (the only change was, of course, the name of the source directory). I also checked version of my tar with
tar --version
which gave me following output:
tar (GNU tar) 1.26
First of all, you should check this info. If you get the same (with possible difference in version number) output, that's fine. If not (or version that seems much older), it's possible, that you are using tar, which simply doesn't support this feature.
Also, you can check, if your tar really DOES support mentioned flag. To do this, type into console:
tar --help | grep ignore-failed-read
You should see something like this:
--ignore-failed-read do not exit with nonzero on unreadable files
If output stays empty, that means this version of tar does not know this flag at all.
See if any of the above helps.
Another option that might work better in this case is --warning=no-file-changed.
tar --warning=no-file-changed -czf backup.tgz dir1 dir2
--warning controls the display of warning messages. You can add no- to the message keyword to suppress it. So in this case no-file-changed suppresses the file-changed warning.
c.f. https://www.gnu.org/software/tar/manual/html_section/tar_27.html
I usually work on visual c++ 2010 for creating console applications as programming problems. There is this submission which requires me to give the source for the file "Makefile" by some command in unix environment
all:
g++ program.cc -o program
since i don't use unix and have never created a "makefile". I don't know how to make this submission. I have read about a makefile which is supposed to give the directions dependencies etc for compiling the program. I am using the header files iostream string and iterator in the program. i have tried the "all:" command . The bash returns command not found.
Can someone help me with this submission? The code is ready but the only thing stopping for submitting is this "makefile". please include the shell commands as well.
You're missing newline and two tabs (yes, you read right, not spaces) after the all: line, something like this:
all:
g++ helloworld.cc -o helloworld
To invoke make, type make in the directory with the Makefile. Dependencies on system headers are usually not considered, if your code has just one file, you can safely ignore that.