0

I am new to c++ and visual studio and am struggling with getting an include statement to work. I want to test out poco for online applications with c++ and found a basic example online that used

#include <Poco/String.h>

However, my Win32 project in visual studio throws an error stating "could not open include file". I added the path to project properties < VC++ Directories < Include Directories. I also added the path to linker < input < additional dependencies. I can't seem to get rid of that red underline and error though. When I am typing my include statement a list pops up but the directory listed is the "...Windows Kits\8.1\um\". Could anybody lend me a hand? I really appreciate any help. Thank you. Let me know if I can provide more info.

amartin7211
  • 469
  • 1
  • 5
  • 18
  • Possible duplicate of [How to add Poco library in Visual Studio 2010?](http://stackoverflow.com/questions/14269755/how-to-add-poco-library-in-visual-studio-2010) – Ken Y-N Mar 17 '16 at 00:41
  • I am having issues with step 4 in the link you provided which is not addressed in the thread, unfortunately. – amartin7211 Mar 17 '16 at 02:50

2 Answers2

0

It should be added to 'C/C++ > Additional Include directories' and it should be added as:

c:/some_folders_down

not

c:/some_folders_down/Poco

You say, 'Adding the directory'. You don't want to add the Poco folder to your path because when you #include <Poco/String.h> you are adding that part of the path there. Try:

#include <String.h>, if that works, fix your additional include path. Would you paste that path?

lakeweb
  • 1,859
  • 2
  • 16
  • 21
  • For some reason the only thing I can get to work is coping and pasting the Poco folder into "...Windows Kits\8.1\um\". Adding the directory to Additional Include directories is not working – amartin7211 Mar 17 '16 at 01:19
  • Yes, adding c:/some_folders_down/Poco and then using String.h works. However, the header files in the Poco folder all use the Poco/String.h format. I could alter every header file but it would be easier if there was some way to get it working with Poco/String.h. Thanks again lakeweb for helping me sort this out – amartin7211 Mar 17 '16 at 02:46
  • The reason for is that it does not get overridden by a string.h in a previously included folder. There is a string.h in the Microsoft includes and you can't get to your Poco string.h without that qualifier. – lakeweb Mar 17 '16 at 02:57
0

So apparently the default for visual studio is to add the the "additional directories" paths to Debug x64 since I am on a 64 bit OS. However, I forgot to switch to x64 in the solution platform drop down at the top of the VS window. If you right click on the .vcxproj and search for "AdditionalIncludeDirectories" you can view this directly. I feel like a facepalm is in order haha. Thanks so much to everyone who viewed my question.

amartin7211
  • 469
  • 1
  • 5
  • 18