Using a DLL with unmanaged code in Visual Studio 2010?

You cannot use libraries specific to GCC (you can tell because they have a extensions) with Visual Studio. You will have to build the library from source in order to use it with MSVC. Once you have done that it's a simple matter of adding the lib generated from the build process to your project and things should work out of the box.(Note that it's a lib you need whether you're compiling for dynamic linking or not -- doesn't matter in msvc land) EDIT -- after looking at TagLib itself In order to compile TagLib you'll need to get the CMake build system and TagLib itself and have CMake build you a visual studio solution.

Using that solution you'll be able to build the lib s and dll s you need. Note that because TagLib is a KDE library, you'll probably need to also build some QT bits in order for everything work work successfully. However, I don't have specific experience with the library so I'm not going to be all that helpful here.

You cannot use libraries specific to GCC (you can tell because they have . A extensions) with Visual Studio. You will have to build the library from source in order to use it with MSVC.

Once you have done that it's a simple matter of adding the . Lib generated from the build process to your project and things should work out of the box. (Note that it's a .

Lib you need whether you're compiling for dynamic linking or not -- doesn't matter in msvc land) EDIT -- after looking at TagLib itself -- In order to compile TagLib you'll need to get the CMake build system, and TagLib itself, and have CMake build you a visual studio solution. Using that solution you'll be able to build the . Libs and .

Dlls you need. Note that because TagLib is a KDE library, you'll probably need to also build some QT bits in order for everything work work successfully. However, I don't have specific experience with the library so I'm not going to be all that helpful here.

I used CMake to generate a VS solution that contains five projects (ALL_BUILD, INSTALL, tag, tag_c, and ZERO_CHECK). Two of them build successfully, two fail, and one is skipped. Do I only need the tag project to build?

If so, that is one that fails. I know you don't have any experience with this library, but no harm in asking. Also, what do you mean by needing some QT bits in order for everything to work?

– shanet Nov 22 '10 at 17:03 @S201: I'm sorry, but I really don't know. Qt is a library ( qt.nokia. Com/products ) upon which all of the KDE libraries are constructed.

I'm sorry I cannot be of more use :( – Billy ONeal Nov 22 '10 at 18:48 BIlly, thank you for your help. I played around for a few more hours today and I think I got it all sorted. I posted a rough outline to what I did in an answer below.

– shanet Nov 23 '10 at 6:26.

I seem to have gotten it working successfully. Here's a rough outline of what I did: 1. ) I used CMake to generate the Visual Studio solution.2.) I attempted to build the tag project in the VS solution, but it failed.

3. ) I made the corrections to a few source files as outlined here: old.nabble.com/taglib-fails-to-compile-w... 4.) I built the tag project again in release mode. This time it was successful.5.

) I copied the resulting dll, def, and lib files to the same directory as the source files for my project.6.) I copied the header files from the taglib source to a subdirectory in my project (not sure if this entirely good practice) 7. ) In my project settings, I set the subdirectory with the header files as an additional include directory.8. ) I added the dll, exp, and lib files to my project by just going to Add>Existing Item.9.) I added some code from the taglib examples and built it.

Everything worked so I think I got it. One caveat I ran into, since the DLL was built in release mode, my project had to be run in release mode or it would crash. I'm guessing that if I replaced the DLL with one built in debug mode I could run my program in debug mode, but I have not tried this.

1 for an actual solution to the problem :) – Billy ONeal Nov 23 '10 at 16:34.

Yo do not have to recompile the source (to create the . Lib file) if you have the . Dll file.

With dumpbin /exports and lib (both came with Visual Studio) yo can create a lib that you can link with your application. In this link you can see a nice explanation: coderetard.com/2009/01/21/generate-a-lib... But as Billy Said, probably you would need other parts of QT to use this library.

Thanks for the answer Luis. I used the guide you supplied to generate a lib file from the dll I have. My question is now what do I do with it?

I added it to my project VS project. I am supposed to include the header files of the library, correct? Is it as simple as copying the header files into the same directory as my VS project and putting "#include " in my program?

Also, as I asked Billy above, what do you mean by needing other parts of QT to use this library? – shanet Nov 22 '10 at 17:31.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions