0

I have a project that needs the fmod library, and I need to have the compiler search the directory I installed it in for the source code. This is pretty much my first time interacting with the C++ compilation process, so I'm completely lost. What settings do I use to tell it where the library is?'

Edit: to be clear, I'm talking about fmod the 3rd party audio library.

JasonMArcher
  • 14,195
  • 22
  • 56
  • 52
RCIX
  • 38,647
  • 50
  • 150
  • 207

2 Answers2

4

To include extra third-party libraries:

  • right click the project in Solution Explorer and select Properties
  • add the library to the list in Configuration Properties -> Linker -> Input -> Additional Dependencies
  • add the library path to Configuration Properties -> Linker -> General-> Additional Library Directories
Steve Townsend
  • 53,498
  • 9
  • 91
  • 140
  • 2
    @Steve: I think the OP is referring to `fmod` the audio library (fmod.org) :) – icecrime Nov 26 '10 at 22:38
  • No problem, just my narrow world-view getting in the way – Steve Townsend Nov 26 '10 at 22:43
  • Ok, still not working. I have under additional dependenices "fmodex_vc.lib", and under additional library directories "C:\Program Files (x86)\FMOD SoundSystem\". The error i'm getting is "fatal error C1083: Cannot open include file: 'fmod.hpp': No such file or directory" (everywhere the project includes fmod) I did install fomd, i'm sure :) – RCIX Nov 26 '10 at 22:51
  • You need to set up include paths for the header files too: `Configuration Properties -> C/C++ -> General-> Additional Include Directories`, to point to wherever `fmod.hpp` lives on your HDD – Steve Townsend Nov 26 '10 at 22:53
1

The other posts give good guidance on how to link with the visual studios code editor. It might be worth mentioning, however, that other build tools (not the Microsoft code editor) enable you cross-platform building and linking.

In particular, the boost build tool, bjam does this very nicely : http://www.boost.org/doc/tools/build/doc/html/index.html.

This is an excellent build tool for sorting out your linking in simple text files (rather than part of an interface) in a cross platform way. I.e. to switch between microsoft compiler and the gnu compiler requires you to change just one word in one file.

If your new to c++, then the boost libraries are worth pointing out more generally. See http://www.boost.org/.

All the best

Tom

Tom
  • 5,219
  • 2
  • 29
  • 45