libjpeg-turbo does not build with Visual Studio 2010 IDE
SIMD-accelerated libjpeg-compatible JPEG codec library
Brought to you by:
dcommander
Attempting to build libjpeg-turbo with Visual Studio 2010 and CMake 2.8.4 results in the following error:
C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppCommon.targets(151,5): error MSB6001: Invalid command line switch for "cmd.exe". Illegal
characters in path.
when the build attempts to generate the Java or SIMD components. A successful build is possible only if both WITH_JAVA and WITH_SIMD are set to 0.
This seems to be either a Visual Studio bug, or a CMake bug, or both. If anyone has any insight, please add a comment or e-mail me.
http://connect.microsoft.com/VisualStudio/feedback/details/606628/error-msb6001
Look for "Posted by Microsoft on 1/5/2011 at 11:12 AM "
Thanks for tracking this down. This gets around the initial problem, but the build still fails in VS 2010 -- it acts as if the SIMD objects are not being included into the libraries that depend on them. Any insight?
I get the exact same fault as you, with linking errors relating to the jsimd_i386 object.
I can not get the lib to build in the Visual Studio 2010 IDE.
I can however get it to build in the command line with the build recipes in BUILDING.TXT
I am unsure if it is the makefiles, CMake or Visual Studio 2010 that is at fault.
But it could be related to another VS 2010 bug where the project dependencies build in the wrong configuration. MS say they are aware of that and it will be fixed in a later version.
For now you can build via command line.
Right, I know the command line works, but this bug report is specific to the IDE. If you find out anything more, let me know.
View and moderate all "bugs Discussion" comments posted by this user
Mark all as spam, and block user from posting to "Bugs (closed - use GitHub)"
Sorry for reopening an old issue, but is still exists in 1.2.0.
Problem with
"C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppCommon.targets(151,5): error MSB6001: Invalid command line switch for "cmd.exe". Illegal characters in path."
is caused by asterisks in the path. The only asterisk i found is the line that contains ".inc" in simd/CMakeLists.txt. Replacing ".inc" with existing .inc files inside simd dir helped me to be able to succesfully build simd project. :)
But another issue raised, because Visual Studio 10 wasn't able to link simd files and jpeglib projects together. :/ I resolved this by manual change of projects in opened solution. For example, If you look on listed files under the jpeg project, you see bunch of .obj files. The main problem is that they are not set properly (CMake 2.8.7 issue??). Select all .obj files listed, right click and open properties. Then set "Item type" from "Not participate in build" to "Object". Do it for jpeg, jpeg-static, turbojpeg-static projects. And we are done. Not very automated solution though. :/
Thanks for the testing! I will see if I can at least fix the first issue.
The wildcard issue has been fixed by allowing CMake to perform the wildcard expansion prior to compile time. That fix will be in 1.2.1 and subsequent releases.
I can confirm that the second issue still exists. I tried playing around with the source file properties for the SIMD object (such as setting EXTERNAL_OBJECT=1 on the objects themselves or setting OBJECT_DEPENDS on simd/jsimd_[x86_64|i386].c to the assembler-generated objects), but no luck. Seems definitely to be an issue with how CMake is generated the vcxproj files.
I can confirm that manually setting the "Item Type" in the Properties for the objects under the "jpeg", "jpeg-static", and "turbojpeg-static" projects works around the issue and allows the build to complete successfully. Well, almost... Still can't get the Java code to build. That now fails with:
C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppBuild.targets(806,14): error MSB4023: Cannot evaluate the item metadata "%(RootDir)". The item metadata "%(RootDir)" cannot be applied to the path "R:\libjpeg-turbo\win64.vc2010\java\R:\libjpeg-turbo\win64.vc2010\x64\Debug\org\libjpegturbo\turbojpeg\TJ.class". The given path's format is not supported.
To be clear, this all works fine with the Visual Studio 2008 IDE, which is what makes me suspect that CMake is generating some bogus Visual C++ project code. In the Visual C++ 2008 project, the SIMD object files have properties that say "Excluded from build: No" and "Tool: Custom Build Tool". Examining the vcxproj files, in the "broken" VC2010 version generated by CMake, the OBJs are listed like so:
<itemgroup>
<none include="R:/libjpeg-turbo/win64.vc2010/simd/$(Configuration)/jfsseflt-64.obj">
...</none></itemgroup>
In the fixed version (by manually setting the item types to "Object", the entries look like this:
<itemgroup>
<object include="R:/libjpeg-turbo/win64.vc2010/simd/$(Configuration)/jfsseflt-64.obj">
<filetype>Document</filetype>
</object>
...</itemgroup>
View and moderate all "bugs Discussion" comments posted by this user
Mark all as spam, and block user from posting to "Bugs (closed - use GitHub)"
I reported this bug to the CMake devs and they fixed it:
http://www.cmake.org/Bug/view.php?id=13047
It should work in the next release.
Last edit: Anonymous 2013-11-22
Excellent. I'll give it a try whenever the new CMake release comes out.
SIMD build issue confirmed fixed with CMake 2.8.8. Java build issue still exists.
This should now be fully fixed in trunk (1.4 evolving) and branches/1.3.x (upcoming 1.3.1 release.)