"nasm" is not recognized as an internal or external command - c++

I am trying to compile libjpeg-turbo library using windows cmake. I am trying to follow the instrcutions found in that lib in order to compile the lib. I am operning a Visual studio terminal and I give in the first step the path of the library. My commands are the following:
cd ..path
cmake -G "NMake Makefiles" -DCMAKE_BUILD_TYPE=Debug
nmake
The first command worked fine I am getting the message build files have been writer to path. However when I am trying to run nmake command I am getting errors:
"nasm" is not recognized as an internal or external command.
Any idea about what is nasm and how can I import it to my path.

From the problem you reported, it looks to me that the issue could be because of the PATH variable or configuration settings. The problem you reported have similar posts please refer to following links:
http://sourceforge.net/p/libjpeg-turbo/bugs/24/
https://github.com/Zeex/sampgdk/issues/42
Also it would be great if you could post the crash log or build process output from the console to further investigate the exact problem.

Related

`Could not find feature system-zlib` during building QT source code

I'm trying to build QT from source code in Windows.
I installed QT binary (5.12.8) to get qmake, the bin path is added to system environment.
I downloaded QT source code (qtbase only) tag v5.12.8 and unzip to d:\github\qtbase
I opened the vs native x64 cmd shell and run: qmake qtbase.pro
The output is like:
Support enabled for:
Using pkg-config ....................... no
udev ................................... no
Using system zlib ...................... no
.
.
.
Qt is now configured for building. Just run 'nmake'.
Once everything is built, you must run 'nmake install'.
Qt will be installed into 'C:\Qt\Qt5.12.8\5.12.8\msvc2017_64'.
then I run nmake but I had this error:
Project ERROR: Could not find feature system-zlib.
NMAKE : fatal error U1077: 'cd' : return code '0x3'
Stop.
From the config log above, system zlib is not used, I assume QT's internal zlib will be used.
I have checked my folder, \src\3rdparty\zlib\src is existed and zlib.h is there.
I'd like to know how to fix this error or disable zlib.
#AlanBirtles Thanks for the hint, I followed the official instructions and compiled again, it works.
In the official instruction, configure.bat is used instead of my direct use of qmake.
There is one more difference in my second try: I use the src code in C:\Qt\Qt5.12.8\5.12.8\Src, not the code from github in d:\github\qtbase.
The code in C:\Qt is downloaded during my installation of binary QT, because I checked the source code item in the installation.

Building .SLN files on Windows without Visual Studio?

I have recently been trying to set up my CMake environment and some 'hello world' code in C++. I added a CMakeLists.txt and added my configurations, but when I ran cmake . in the command line, something was different from all of the tutorials.
The people on the tutorials were using a Unix based system, so the command cmake . was producing a 'makefile'. They then built the makefile using the command make.
Since I'm on windows, it generated a msvc .sln file instead of a makefile. My question is - how can I build the .sln file, similar to how they did it on Linux? I want to do it without Visual Studio 2019 and preferably in the command prompt.
I have tried searching for this question, but haven't found what I'm looking for. Thank you in advance.
First of all, you should never do an in-tree build with cmake .. It invites problems in the form of name clashes and makes it nearly impossible to get a clean rebuild.
If you're using a recent version of CMake (which you should be), the standard way to build a project varies on whether the backend generator is single-config or multi-config.
If it's single-config (like Make or Ninja), then the commands are:
$ cmake -G Ninja -DCMAKE_BUILD_TYPE=Release -S /path/to/sources -B /path/to/build
$ cmake --build /path/to/build
The directory /path/to/build doesn't need to exist when you invoke CMake. If you wanted a Debug build, rather than Release, you would just replace that in the first line. You should never run a single-config generator without setting CMAKE_BUILD_TYPE.
If it's multi-config, like Visual Studio, then the commands are:
$ cmake -G "Visual Studio 16 2019" -A x64 -Thost=x64 -S /path/to/sources -B /path/to/build
$ cmake --build /path/to/build --config Release
The major difference here is that the config is specified in the second (build) command, rather than the first (configure).

CMake File API "no reply dir found"

I have trouble using toolchains in Docker from CLION. My Docker container is based on ubuntu 18.04 and CMake 3.17 is installed. The image definition is based on this reference implementation.
When I reload the CMake project with CLion, the following error is shown.
-- Build files have been written to: /tmp/tmp.vmmD6opEtD/cmake-build-debug-local-docker
CMake File API: /path/to/glow/cmake-build-debug-local-docker: no reply dir found
When I configure the CMake project in the Docker container directly, it succeeded. I believe there is nothing wrong with the CMake project itself.
What does "no reply dir found" mean? There is no clue for this error message even with googling.
I have this error sometimes when CLion is using rsync to sync files. Disabling rsync gets rid of this error:
The problem is that the file sync is slower, but slow is better than non-functional :)
I had the exact same error, in my case setting up SSH to avoid asking for passphrase, that is on a terminal run ssh-add then try to reload the CMake project
Just had the same problem.
Your build dir in clion cmake project settings is other than the one appear in the cmake options specified there.

CodeLite - build settings malfunction

from unknown reason I can't compile a single file/project in C++ in my CodeLite environment.
I'm using latest version of CodeLite, i.e.: 7.0 with pre-installed MinGW libraries. OS/ Windows 7.
Strangely after reinstallation, time and again I get the following error while trying to build/compile C++ project:
C:\Windows\system32\cmd.exe /C " -j 2 -e -f Makefile"
Name'-j' is not recognized as an internal or external command operable program or batch file
When I try to run the program (I was used to click run and get immediate results since it was compiling and running the code at one time) I get absolutely nothing.
Any idea how can I fix this strange issue ? Reinstalling IDE doesn't really help :(
C:\Windows\system32\cmd.exe /C " -j 2 -e -f Makefile".
Do you have MinGW installed? CodeLite 7.0 does not come with MinGW
To fix your problem:
Install MinGW, I recommend using TDM-GCC (make sure you accept the default options by TDM-GCC installer, especially, the install location path)
After the installation is completed, let CodeLite detect your compiler: Settings->Build Settings->Compilers->Add Compiles->Add an existing compiler and point CodeLite to the folder where you installed MinGW
You should now have this compiler configured in CodeLite. right Click on your project and open the settings dialog (keyboard shortcut Alt-F7) : Project settings->Common Settings->General->Compiler and select your compiler from the list
Build your project again, this time it should work properly.
Also, I recommend you to use the latest weekly build (it contains a new "setup wizard" that includes installing a compiler), you can get it from codelite's downloads page
Eran

using CMake to build Google Test

I am trying to use CMake to build Google Test.
As mentioned in the README of Google Test,
I have issued following commands:
mkdir mybuild # Create a directory to hold the build output.
cd mybuild
cmake D:\gtest-1.6.0 # (in the README this was set as:cmake ${GTEST_DIR}, but since on my machine D:\gtest-1.6.0 is where I have downloaded gtest, I have used that in command prompt.
And here is the error I get:
Any help? any help would be greatly appreciated as I am stuck with it and can't move forward...... Thanks.
ps. I have Visual Studio 10 installed on my machine.
If you use Visual c++ compiler with cmake you must launch it from the Visual c++ command prompt. Otherwise cmake will not found your compiler.