Visual Studio C++ 2010 Help

Jun 5, 2012 at 12:16am
Hi folks
I need some help with VS C++ 2010.
It is something very basic..
I downloaded and compiled the MIDI library from here:
https://github.com/jdkoftinoff/jdksmidi

The library already had a VSC2010 project file ready, which i was able to compile to a LIB. But once i did that, how do i compile the example files that came with the library?
I tried setting up a separate project for one of the examples, but then the example can't see the library header files so it won't compile.
At one point, i setup a project with a dependency on the project library, but i received an error on these lines included in the example:

using namespace jdksmidi;

#include "jdksmidi/world.h"
#include "jdksmidi/track.h"
#include "jdksmidi/multitrack.h"
#include "jdksmidi/filereadmultitrack.h"
#include "jdksmidi/fileread.h"
#include "jdksmidi/fileshow.h"
#include "jdksmidi/filewritemultitrack.h"

How do i create a namespace out of the compiled LIB project and where do i place the example file so it can find the library header files?
I know this is something very simple, but i am new to VS2010 and i have no clue of what i should do.
Thank you
Jun 5, 2012 at 1:34am
Normally, after you compile a library, you link against it using a provided header file and the resulting LIB file. Just make sure you set up Visual Studio properly to look for the header file(s) in the right directory, or you can copy them to a specific folder that you may have previously set up for this effect.

The LIB is added in the linker options, or you can use a #pragma directive in code. The LIB file also needs to be in one of the directories set up in Visual Studio for that effect.
Jun 6, 2012 at 3:36pm
Thank you for your help.
It seems the creator of the library provided a way of linking the library in the code using the namespace statement.

using namespace jdksmidi;

But when i try to compile the file, i get an error about the namespace not being found.

So, what do i need to do, to have the example file see the namespace in VS2010?

I already setup a project file for the library, but how do i make it a namespace that the example files can see?

Thanks
Last edited on Jun 6, 2012 at 5:57pm
Jun 13, 2012 at 2:42am
Help!
Anyone?
Jun 14, 2012 at 5:24am
The namespace has nothing to do with linking, they are basically just to prevent name collisions. Open the project properties page under configuration properties > vc directories set include and lib paths then add libs as additional dependencies in linker>input
Jun 22, 2012 at 9:11am
And if that didn't make any sense then you should look through the site that you got the library from, it will probably have some instructions similar to Naruku9333's but hopefully with pictures of where to click since it can be difficult the first time if you haven't linked before.
Topic archived. No new replies allowed.