Adding existing file in VS project

i’m porting my little program (build in osx) from Xcode to Visual studio 2005, all seems to be ok… but: IT DOES NOT COMPILE.
The problem is that everything i add, does not seems to be recognized from the compiler, for example: i use the tcp connection, so i added the addons for networks… but it does not link, i’ve added the face detector but it compile ONLY if i put that in the same directory, even if i’ve specified the file in the project using “add existing element”.

(the code run perfectly in osx…)

The example work all… but i cannot get the project to compile if i add any other file/lib.

Can some one help this? :frowning:

Tnx Andrea.

In the default FAT install of Of, the networking plug in is included for you, and all you need to do is #define OF_ADDON_USING_OFXNETWORK before including ofAddons.

if you are actually trying to include it yourself, remember to set the include directory for the addon, not just including the .h file in the project. You can do this by right clicking on the project, and going to properties > C++, and there is a field in there. Ditto for libraries, remember to add the library directory under Properties > Linker, not just tell it to link against a particular library file.

If you’ve done both of these things, and it still doesn’t work, perhaps telling us the exact error might get this solved sooner.

one trick is to duplicate the “allAddons” example in apps/addonsExamples that contains all the proper linking and includes for the addons. Then, just replace the src and data directory and you should be able to compile. If you know that your app only uses xml, for example, then just duplicate that example and rename it…

I hope that helps –

take care,

it was just the directory missing in config… :slight_smile:


Okay, sorry for stupid question:

If you need to specify include directories in your IDE, then why add the files into the Solution Explorer?

It also drives me nuts that I can’t drag/drop folders into it and have it maintain the folder structure. Maybe there is a reason for this, or a workaround?


Moving to PC, and feeling like a newbie

*Visual C++ 2008 Express Edition*

Thanks for advice