libjpeg installation- how to go through the instruction - c++

I have a problem with libjpeg installation.I need it so as to use CImg library and have posibility to save .jpg files.
I have download file from:
http://www.ijg.org/ and go step by step with instruction( I use VS2015).
Unfortunately I cannot go through first point:
Open the command prompt, change to the main directory and execute the command line NMAKE /f makefile.vc setup-v10
I got an error in command prompt: error message
fatal error U1025:file 'makefile.vc' not found
Could you please tell me what's going wrong? Or maybe you know some easiest way to install this library?

The fatal error
fatal error U1025:file 'makefile.vc' not found
is caused by nmake not finding the file makefile.vc in the folder that you executed the command
NMAKE /f makefile.vc setup-v10
Looking at the source zip file it appears the source is located in the jpeg-9b folder.
To solve this problem you need to change directory of your command prompt cmd.exe to the jpeg-9b folder before running the nmake command. To do so use the cd command in your cmd.exe session. The syntax is
cd fullpath
where fullpath is the full path where you have the jpeg-9b folder. If your path includes spaces make sure to quote the path with double quotes.

Related

vcvarsall.bat : Can't find header files when building

I'm doing a build script for my visual studio C++ solution.
i wrote a batch file that places the environment variables before running vcvarsall.bat. i'll paste the script at the end of the post.
But when it runs, It can't build the solution as it can't find the header files.
fatal error : C1083
They are located in the folder Inc. And I just don't know how to specify it...
script :
# echo off
set PROJECT_HOME=%~dp0
set PROJECT_TOOLS=%PROJECT_HOME%\Tools
set QT_HOME=%PROJECT_TOOLS%\Qt\5.12.0\x64\5.12.0\msvc2017_64
set QT_BIN=%QT_HOME%\bin
set QT_LIB=%QT_HOME%\lib
set QT_INC=%QT_HOME%\include
set QT_PLUGIN_PATH=%QT_HOME%\plugins
set QT_PLATFORMS=%QT_HOME%\plugins\platforms
set PARAMS=%QT_HOME%\Params
set QML_IMPORT_PATH=%QT_HOME%\qml;%QML_IMPORT_PATH%;
set PATH=%QT_BIN%;%QT_LIB%;%QT_PLATFORMS%;%PARAMS%;%QML_IMPORT_PATH%;%PATH%
call D:\APP\Microsoft\VisualStudio_Pro\v156\VC\Auxiliary\Build\vcvarsall.bat x64 %*
devenv solution.sln /build
pause

How to install ninja-build for C++

https://github.com/ninja-build/ninja/releases
I have downloaded the ninja-win.zip folder and extracted it. When I open it, there is a single .exe file in the entire folder. When I double click it a cmd window flashes for a split second. I have also tried running it as administrator, but the same thing happens. What I don't understand is, what am I expected to do with this .exe file?
You must open a terminal (cmd.exe on Windows) and type something like ninja -f /path/to/buld/file. You may also wish to modify the PATH environment variable so that Windows knows where to find the Ninja executable, depending on your setup.
You can simple download ninja.exe file from this Link
https://github.com/ninja-build/ninja/releases
After that you just have to add the path to your ninja.exe file to your windows environment variables and then you can use ninja commands from anywhere in windows.
1. Open cmd in your Project Directory
2. There are guides on the internet on where to save the Ninja.exe so that it'll be callable in Cmd without specifying directory. Either follow them or:
i, Specify Directory when Calling Ninja. Putting "ninja" in Cmd actually calls Ninja.exe and is the same as something like "C:\users\user1\downloads\Ninja". or:
ii, Save Ninja.exe in the same directory as Project.
3. proceed with rest of the command.
Therefore the Final Command would be:
"C:\users\user\downloads\Ninja.exe" -f "D:\Projects\Project1"

Inkscape is not recognised as an internal or external command

I am trying to run Inkscape from command prompt however the error occurs. I have added c:/Program Files/ Inkscape/inkscape.com in the PATH but this not working.
Inkscape is not recognised as an internal or external command
I just had this same issue. However my problem was that I didn't add inkscape to the path. Try leaving the inkscape.com off your path and just have it as
C:\Program Files\Inkscape
This worked for me.
I know it is a bit old question but I faced the similar issue so I would like to share how I approach the issue because using Inkscape's command line might be quite useful for various reasons.
Option 1: You might either change the current directory as
cd C:\Program Files\Inkscape\
inkscape
Example scenario can be converting the .svg file to the .pdf which is useful for LaTeX import. To use it for exporting to PDF through Inkscape's command line (assuming that your file is already located in C:\temp\):
inkscape -D -z --file=C:\temp\logo.svg --export-pdf=C:\temp\logo.pdf --export-latex
Option 2 (Cleaner solution): Or you might add
C:\Program Files\Inkscape\
to the PATH environment variable. In Windows see this link. Then you can run inkscape without changing the current directory.
cd C:\temp
inkscape -D -z --file=logo.svg --export-pdf=logo.pdf --export-latex

MSBuild - Cannot open include file (despite listed in the INCLUDE list )

I am probably missing something obvious - but I have been stuck for a while on this issue. I am compiling a Visual Studio project on the command line using MSBuild. Basically like this:
CALL vcvars32.bat
MSBuild myproject.sln /m /t:rebuild /p:Configuration=Release /verbosity:m
But this gives me an error: fatal error C1083: Cannot open include file 'winsock.h': No such file or directory
But if I check the environment variable INCLUDEafter the vcvars32.bat call the directory containing 'winsock.h' is in the list - so I definitely have this file in the SDK.
In addition if I change verbosity of MSBuild to detailed I can see the full compile command used. If I copy that and run it in the console the same cpp file compiles without any problem.
Any idea whats different inside the MSBuild context ?
Solved it, adding /p:useenv=true make MSBuild use the INCLUDE environment variable.
( Still a bit unsure why that had to be done though, since I can't recall having needed that earlier for command line builds. )

MingGW C++ compiler does not work

I am trying to install C and C++ compiler on Windows 8.
I have already installed MinGW, downloaded and installed mingw32-base and mingw32-gcc-g++ packages and the other required packages, added to the user environmet Path the string "C:\MinGW\bin", and I also tried following this guide
http://www.mingw.org/wiki/Getting_Started
so after installation I created a new file named "fstab" containing "C:\MinGW /mingw" in C:\MinGW\msys\1.0\etc because it was only present the file named "fstab.sample".
After all this I typed on cmd : gcc sample.cpp -o sample.exe
and it doesn't work at all returning me an error:
gcc: fatal error: no input files
compilation terminated
But if I typed gcc --version it gives me gcc 4.9.3 etc...
so the packages are installed but I can't compile any of my programs
Are you in the correct directory in cmd when compiling?
You can navigate to the correct one with cd and check if your .cpp is there with ls
possibly some problem with folders. probably you are not compiling from source directory.
Check out this mingw distro by STL. It contains a few .bat files that open a cmd prompt with compiler in PATH. I use these for all my mingw installations. BAT files are to be placed in mingw folder:
mingwvars.bat
#echo.
#echo Setting up environment for using MinGW with GCC from %~dp0.
#set PATH=%~dp0bin;%PATH%
set_distro_paths.bat
#echo off
if not exist "%~dp0bin\gcc.exe" goto epicfail
if "%X_DISTRO%" == "nuwen" goto :eof
set X_DISTRO=nuwen
if exist "%~dp0git\cmd\git.exe" set PATH=%~dp0git\cmd;%PATH%
set PATH=%~dp0bin;%PATH%
goto :eof
:epicfail
color 4f
echo ERROR: You must run %~nx0 from the root of the distro.
echo Don't copy or move this batch file.
title ERROR
goto :eof
open_distro_window.bat
#echo off
if not exist "%~dp0bin\gcc.exe" goto epicfail
if "%X_DISTRO%" == "nuwen" goto :eof
set X_DISTRO=nuwen
if exist "%~dp0git\cmd\git.exe" set PATH=%~dp0git\cmd;%PATH%
set PATH=%~dp0bin;%PATH%
goto :eof
:epicfail
color 4f
echo ERROR: You must run %~nx0 from the root of the distro.
echo Don't copy or move this batch file.
title ERROR
goto :eof
It's a very common error when you are not in the current directory where your source files are residing.
So just navigate to the current directory and run the command it will compile the source code.