I'm trying to test the live555 libraries (live555.com) on Windows. Here are the instructions: http://www.live555.com/liveMedia/#config-windows
I managed to generate the .mak files, but now I do not know how to use them in Visual Studio 2010 to start any of the applications (as openRTSP or playSIP).
How I can use or open .mak files in Visual Studio 2010?
Thanks for the help.
Greetings!
In trying to compile live555 with Visual Studio 2012 I had similar issues. Here's some stuff I needed to do to make it build. Items 3+ are based on these instructions for compiling live555 with vs2008
1) I had to copy nmake.exe into the VC\bin directory from another location (it was somewhere else). See social MSDN page for more info.
2) In addition I also had to remove question marks from the .mak files ("prefix? =...", for example) for conditional assignment or it wouldn't build (the error was "too many names to the left of =").
3) Open the ‘win32config’ file and change the TOOLS32=... variable to
your VS2008 install directory. For me, it’s TOOLS32=C:\Program Files
(x86)\Microsoft Visual Studio 11.0\VC
4) In ‘win32config’, modify the
LINK_OPTS_0=... line from msvcirt.lib to msvcrt.lib. This fixes the
link error: LINK : fatal error LNK1181: cannot open input file
'msvcirt.lib'
5) Open the Visual Studio command prompt.
From the ‘live’ source directory, run genWindowsMakefiles
6) Now you’re ready to build. Simply run the following commands:
cd liveMedia
nmake /B -f liveMedia.mak
cd ..\groupsock
nmake /B -f groupsock.mak
cd ..\UsageEnvironment
nmake /B -f UsageEnvironment.mak
cd ..\BasicUsageEnvironment
nmake /B -f BasicUsageEnvironment.mak
cd ..\testProgs
nmake /B -f testProgs.mak
cd ..\mediaServer
nmake /B -f mediaServer.mak
As far as I know you can't open .maks in recent visual studios - you have to compile them from the command-line instead.
Open a Visual Studio command prompt (or run vsvars32.bat from the VS Common\Tools directory in a regular command prompt) then try
nmake /f abc.mak
I've a feeling you could open makefiles them way back in VS6 but can't remember - it might have been generate them instead.
Download and build script for "Visual Studio 2017 Community", C++ Features required (Setup Dialog of Visual Studio) 7Zip is also required.
install-live555.cmd
PowerShell (New-Object System.Net.WebClient).DownloadFile('http://www.live555.com/liveMedia/public/live555-latest.tar.gz','live555-latest.tar.gz');
"%PROGRAMFILES%\7-Zip\7z.exe" x -aoa live555-latest.tar.gz
"%PROGRAMFILES%\7-Zip\7z.exe" x -aoa live555-latest.tar
powershell -Command "(gc live\win32config) -replace '!include <ntwin32.mak>', '#!include <ntwin32.mak>' | Out-File live\win32config"
powershell -Command "(gc live\win32config) -replace 'c:\\Program Files\\DevStudio\\Vc', 'C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.11.25503' | Out-File live\win32config"
powershell -Command "(gc live\win32config) -replace '\(TOOLS32\)\\bin\\cl', '(TOOLS32)\bin\HostX86\x64\cl' | Out-File live\win32config"
powershell -Command "(gc live\win32config) -replace 'LINK = \$\(link\) -out:', 'LINK = link ws2_32.lib /out:' | Out-File live\win32config"
powershell -Command "(gc live\win32config) -replace 'LIBRARY_LINK = lib -out:', 'LIBRARY_LINK = lib /out:' | Out-File live\win32config"
powershell -Command "(gc live\win32config) -replace 'msvcirt.lib', 'msvcrt.lib' | Out-File live\win32config"
call "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\Tools\vsdevcmd" -arch=x64
cd live
call genWindowsMakefiles
cd liveMedia
del *.obj *.lib
nmake /B -f liveMedia.mak
cd ..\groupsock
del *.obj *.lib
nmake /B -f groupsock.mak
cd ..\UsageEnvironment
del *.obj *.lib
nmake /B -f UsageEnvironment.mak
cd ..\BasicUsageEnvironment
del *.obj *.lib
nmake /B -f BasicUsageEnvironment.mak
cd ..\testProgs
del *.obj *.lib
nmake /B -f testProgs.mak
cd ..\mediaServer
del *.obj *.lib
nmake /B -f mediaServer.mak
cd ..
pause
Related
VisualStudio has vcvars64.bat that loads all necessary environment variables to compile visual studio projects from the command line.
In VisualStudio 2017 community edition, this file for example resides in
C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvars64.bat
How can I construct the path to this file in a batch script, only using system set environment variables, independently of which visual studio version is installed?
You can use vswhere to detect the install location of Visual Studio related files. This snippet from the wiki comes pretty close to what you need:
for /f "usebackq delims=" %%i in (`vswhere.exe -prerelease -latest -property installationPath`) do (
if exist "%%i\Common7\Tools\vsdevcmd.bat" (
%comspec% /k "%%i\Common7\Tools\vsdevcmd.bat" %*
exit /b
)
)
rem Instance or command prompt not found
exit /b 2
Changing that snippet to call vcvars should be easy.
If you have multiple Visual Studio installations that may not have the C++ workload installed, you can search for an instance with a specific workload or component, like this one looking for Team Explorer to be part of the installation:
vswhere -latest -products * -requires Microsoft.VisualStudio.TeamExplorer -property installationPath
The Microsoft C++ team wrote a blog about vswhere and alternative options. They also list all of the relevant workload and component identifiers.
The idea is that you ship vswhere.exe with your scripts or executable. Or downlead it on demand. I use this powershell snippet in a few places to grab vswhere when I need it:
$vswhereLatest = "https://github.com/Microsoft/vswhere/releases/latest/download/vswhere.exe"
$vswherePath = ".\vswhere.exe"
remove-item $vswherePath
invoke-webrequest $vswhereLatest -OutFile $vswherePath
The reason behind this, is that you can now install multiple instances of the same Visual Studio Version. Each stores its settings in a private registry file. There is no easy way to get to the InstallPath registry key that used to exist. More background can be found here. Complete with a few reg.exe commands to load the private registry hyves and query them. It you really can't package or fetch vswhere on demand, this may be your only option (add 16.*to include 2019)
for /d %%f in (%LOCALAPPDATA%\Microsoft\VisualStudio\15.0_*) do reg load HKLM\_TMPVS_%%~nxf "%%f\privateregistry.bin"
REM Use `reg query` to grab the InstallPath from the instance
for /d %%f in (%LOCALAPPDATA%\Microsoft\VisualStudio\15.0_*) do reg unload HKLM\_TMPVS_%%~nxf
Note: Looks like this may need to be updated to search for 15.*_* and 16.*_* to detect point releases as well as Visual Studio 2019.
Now I am currently in C:\WINDOWS\system32>
I need to mention it in the cmd file
How can I navigate to a specific path in cmd file.
Please provide the lines.
#echo off
setlocal
call "C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin\vcvars32.bat"
cd "C:\hadoop-2.6.0-src"
mvn package -Pdist,native-win,docs -DskipTests -Dtar
pause
popd
This is my cmd file.The mvn command is not getting executed in the specified path. two separate command prompts is getting opened but it is not running and get closed immediately
Thanks in advance.
PUSHD Change the current directory/folder and store the previous folder/path for use by the POPD command
#echo off
setlocal
pushd "C:\hadoop-2.6.0-src"
cd
pause
call "C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin\vcvars32.bat"
cd
pause
popd
Additional cd commands (without parameters) should display the current drive and directory.
Read more
I am using Windows 7 and I want to set up an environment variable and use it in the same command.
Specifically, I want to execute the following 2 commands simultaneously as a single command-:
set MYPATH="C:\Program Files (x86)\Microsoft Visual Studio 11.0"
%MYPATH%\VC\vcvarsall.bat
In other words, I want the Windows version of this.
This is what I've tried so far -:
set MYPATH="C:\Program Files (x86)\Microsoft Visual Studio 11.0" && cmd.exe /C "%MYPATH%\VC\vcvarsall.bat"
But it isn't working.
So, Is there any way of doing this in Windows ?
This can be done by writing -:
cmd.exe /X /V:ON /C "set MYPATH="C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\varsall.bat" && !MYPATH!"
Source
I have next pre build event:
cmd /C mklink /D /J "$(ProjectDir)SomeDir" "$(ProjectDir)"
This is expanded in(copied from MSBuild output):
cmd /C mklink /D /J "C:\Dir-1\Dir-2\other-dirs-here\SomeDir" "C:\Dir-1\Dir-2\other-dirs-here\"
When running the build with this build event the symbolic link is not created, but when I copy exactly the expanded output of Visual Studio in command line the link is created.
Do you know why?
EDIT: I have administrator rights on the computer. Both Visual Studio and Command Prompt have "Administrator" on top
Found the problem - the previous command in the build event was:
$(ANDROID_HOME)/tools/android.bat update project my-project-settings
and for some weird reasons prevented all commands after it to run...
I've converted an old Visual C++ 6.0 project to a new Visual C++ 2010 one. It functions but I have a problem with the post build event which I took from the old project. It registered the target file (an .ocx) on the computer:
copy $(ProjDir)\PDFXChange\dll.Debug\*.* $(TargetDir)
regsvr32 /s /c "$(TargetPath)"
echo regsvr32 exec. time > "$(OutDir)\regsvr32.trg"
In my new solution it doesn't work. I've also tested it in single commands: of the three commands (copy, regsvr32 and echo) only the last one could be executed. What could be my error.
Error:
error MSB3073: The command "copy \PDFXChange\dll.Debug\*.* C:\_tests_\ocx2010\Debug\
regsvr32 /s /c "C:\_tests_\ocx2010\.\Debug\LayoutBox.dll"
echo regsvr32 exec. time > ".\Debug\\regsvr32.trg"
:VCEnd" exited with code 3. C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppCommon.targets
COPY and REGSVR32 seem not to work.
The problem was in the name of the macro $(ProjDir). In Visual C++ 2010 it's $(ProjectDir)
$(ProjDir) -> $(Proj ect Dir)
Some macros altered their names (after so many years)!
The command copy \PDFXChange\dll.Debug*.* C:tests\ocx2010\Debug should copy some DLLs into the folder where the next command regsvr32 /s /c "C:tests\ocx2010.\Debug\LayoutBox.dll tried to register the target file. It couldn't find any DLLs there, so it quit with the error message.
Mismatch between
Project->Properties->Configuration Properties->General->Output Directory
and
Project->Properties->Configuration->Linker->Output File
I made the former like so...
$(SolutionDir)$(PlatformTarget)$(Configuration)\
and in the linker like so..
$(SolutionDir)$(PlatformTarget)$(Configuration)$(ProjectName).dll
and it solved the problem