locked
Experimenting with ogg/vorbis but cannot find 'libmtd.lib' in 2013 (worked in 2012)

    Question

  • Hey guys. Here's the situtation. I am experimenting with ogg/vorbis for audio decoding in my windows 8 app (built using 'visual studio 2012 for windows 8'). This required me to build three ogg / vorbis libs using 'visual studio 2012 for Windows 8' and link them into my test app. After a bit of work I got the app to load a file containing ogg audio data, decode it to raw pcm data and then play it using direct audio. All worked a treat.

    But then I updated my operating system to Windows 8.1. In debug mode (still using 'visual studio 2012 for windows 8') my app started hemorrhaging extremely odd exceptions from within source code for which I could only see the assembler for (release builds seemed to ignore these exceptions and worked fine but I need to be able to use debug mode obviously for development). So I decided to get 'Visual studio 2013 for Windows' and see if that worked. I converted the 2012 project to a 'visual studio 2013 for Windows' project but the app will no longer build because of the following error:

    Error	28	error LNK1104: cannot open file 'libcmtd.lib'	C:\Users\Aaron\Documents\Test Projects\Windows 8.1 Test (01-Nov-2013)\LINK	Test


    I thought maybe I needed to rebuild the three ogg / vorbis libs using 'visual studio 2013 for Windows' so I did this, but alas I still receive the same error (unable to open 'libcmtd.lib').

    It is worth noting that the compiler only generates this error about the inability to open 'libcmtd.lib' when I use functions from within only one of the three ogg / vorbis libs.

    It is also perhaps worth noting that I was using a profesional copy of 'visual studio 2012 for windows 8', but am now using an express copy of 'visual studio 2013 for windows'.

    So does anyone have any idea why I am getting the error about the 'libcmtd.lib' file or what I can do to resolve it?


    Kind regards, Aaron.
    • Edited by aaron.wi Saturday, November 02, 2013 9:14 PM
    Saturday, November 02, 2013 8:44 PM

Answers

All replies

  • libcmtd.lib is the Multithreaded, static link (debug) library. Static linking of the CRT is not supported for Windows Store apps. You should make sure your projects are all set to /MD or /MDd, and not /MT or /MTd.

    (I suspect they removed the static linking CRT libraries from VS 2013 Express for Windows since you should never use them for Windows Store app development)

    You also need to build all your code with VS 2013 to support Windows Store for Windows 8.1.


    Saturday, November 02, 2013 11:59 PM
  • Hi and thanks for your reply, I appreciate it.

    The libs I built for use with my Windows store app project have all been built using 'Visual Studio 2013 for Windows' using the /MD and /MDd flags, and I've done a file contents search for all references to libcmt in the folders containing these projects with no results. So how could this static dependency exist when it is not defined by any of the projects? These libs clearly don't have a dependency on this libcmt.lib file as they build fine using 'visual studio 2013 for windows' using the correct multi threaded flags (/MD and /MDd). So how can using them in another windows store project suddenly gain a dependency on this library?! Am I going crazy or does this just make no sense?

    On a more positive note I managed to temporarily solve the issue of the missing libs (libcmt.lib and libcmtd.lib) by adding a project library directory for the folder containing the them (found in the Microsoft Visual Studio 12.0 folder). But would the app run into issues if it were released into the wild in this state? (possibly via the app store, if they'd even accept it)?

    Kind regards, Aaron.




    • Edited by aaron.wi Sunday, November 03, 2013 5:51 PM
    Sunday, November 03, 2013 4:26 PM
  • You can add "Ignore Specific Libraries" settings to your project for libcmbt.lib;libcmtd.lib for to get it to build without the invalid CRT libs.

    There's something in your solution that is built with static libraries...

    Sunday, November 03, 2013 8:10 PM
  • Awesome. That worked a treat thank you so very much Chuck Walbourn. 

    To summarise. To remove the dependency on libcmt.lib and libcmtd.lib I opened the project properties, went to 'Linker>Input' and then added the following to the "Ignore Specific Default Libraries" setting...

    libcmt
    libcmtd

    This stopped 'Visual Studio 2013 for Windows' from trying to use these libraries which are not available for windows 8.1 apps (even though they used to be available for windows 8 apps).

    Great success!

    Monday, November 04, 2013 10:39 PM
  • Correct.

    BTW, if you remove the Ignore Specific Default Libraries setting and try linking with /VERBOSE set for the link, that should let you figure out which library was built with 'static CRT' in the first place...

    http://msdn.microsoft.com/en-us/library/vstudio/wdsk6as6.aspx

    Tuesday, November 05, 2013 6:37 AM