So I have a structure like below. (Similar to bigger project I'm really working on)
tryWithNewLib\testProject\testProject\testProject.vcxprog
tryWithNewLib\testProject\testProject.sln
I have this open source library I want to use.
tryWithNewLib\XERCESCPKG-31-VC100\include\xercesc\util
Additional Include Directories:
D:\tryWithNewLib\XERCESCPKG-31-VC100\include;%(AdditionalIncludeDirectories)
I am expecting this to work:
#include <xercesc/util/PlatformUtils.hpp>
Any ideas on what I am doing wrong?
I believe the issue may have been that I was updating Additional include Directories for the wrong configuration. (I've changed a million things so I'm not sure this is really the fix).
Related
I'm using QtCreator to develop a "plain" C++ based software (in particular, this one). By "plain" I mean my software is not using Qt libraries or any other Qt stuff appart from the IDE.
QtCreator version is 4.14.1.
Everything goes fine (building, running application, debugging, etc.) but the editor is reporting problems finding header files (i.e. .h files) belonging to my project, as shown in the screenshoot below:
Interesting to note that system headers (e.g. stdio.h) are correctly found.
So maybe I'm missing some piece of configuration in my project. First thing I thougth was the .includes added by QtCreator at project creation time (fiware-orion.includes in my case), which is like that:
src/lib/cache
src/lib/mongoBackend
src/lib/parseArgs
...
which are the places in which the header files are (e.g. src/lib/mongoBackend/MongoGlobal.h) so everything seems fine in that file...
Any idea or suggestion is really welcomed :)
I think I found the answer myself just after publishing the question (use to happen :)
Adding to the .includes file this line:
src/lib
solved the problem.
It makes sense... as my header names are like mongoBackend/MongoGlobal.h then
src/lib + mongoBackend/MongoGlobal.h = src/lib/mongoBackend/MongoGlobal.h
I was wondering about the BII_IMPLICIT_RULES_ENABLED flag which I had switched off in one of my CMakeLists.txt files, in order to get an OpenGL related block to compile on a Mac, following a suggestion from biicode. This setting is still there and everything works perfectly, but I would like to find out more about it. Could someone explain what it does exactly?
Thanks!
BII_IMPLICIT_RULES_ENABLED activates the addition of system libs to the target that has included certain headers. For example, if your code contains an:
#include "math.h"
And you are in *nix systems, then the library "m" (libm) will be added to your target via TARGET_LINK_LIBRARIES.
You can see the headers that are processed in your cmake/biicode.cmake file, in the HANDLE_SYSTEM_DEPS
My recommendation: Put it to False whenever possible, and handle the required system libs yourself, exactly what you have done. It is something that will be deprecated soon, or at least set to False by default to new projects. This option sometimes causes troubles, if something fails or there is a bug in biicode.cmake, e.g. in the past it tried to add libm to targets also in windows. It will be gradually deprecated and probably substituted by some CMake macros hosted (as in http://www.biicode.com/biicode/cmake) that could be used by users if they decide to, but not automatically as it is done now.
I am trying to set up sonar-runner on a legacy code base. It seems to be working. However, I get several warnings like this:
WARN #include the file filename1.h could not be found at file:filename2.h. Please check your additional library configuration.
I found a property I can possibly set in the sonar-project.properties file to point to all the library directories:
sonar.c.library.directories=/path/to/library/
My problem is, there are seriously about 50 directories I will need to include to capture them all, and as far as I can tell, I need to type them all on a single line, comma-separated.
So, my question is,
is it worth it?
Does sonar-runner need to find these dependencies to do an appropriate analysis? Would I gain anything at all, or should I just let it be?
A project I'm building is attempting to include a library, but for the life of me I can't find out the call to include it is coming from. It's trying to include atlthunk.lib, which is supposed to be included through a #pragma comment in atlbase.h, but there's no such comment in my atlbase.h.
I read about someone else who had this problem, but circumvented it by "excluding the lib forcefully". I realise this isn't a stable solution, but could someone tell me how one goes about forcefully excluding a library?
It's a project setting under
Linker/Input - Ignore Specific Default Libraries
Put the library to ignore there.
Here is a screenshot to help you along:
I know there are other questions regarding that, and I also know that I can right click on the files that I want excluded, and select Exclude from Project. However. I'm wondering if there are any easy ways of achieving the same purpose programmatically. For example, in a VS project, to link with an external library, I can either add the library name in the project's settings under Linker options, or use "pragma comment(lib, library name in char*)". I'm wondering if this can be achieved similar to how I have described my example.
#if 0
#endif
Seriously, though... no there's no pragma for that. Even Microsoft isn't quite that silly :P
You can #include a .cpp file to include it without it specifically being part of the project, but your only option to exclude a file is the way you described.