I'm trying to get some old C(ish) code to compile but it doesn't define ResFileRefNum and I can't seem to find it anywhere in the official header files.
There's a definition in the documentation that degenerates to an int, and I can just drop that in if I have to, but I'd rather do it the right way, i.e. #include a header that defines the type.
Edit: I found the definition in the header Resources.h in the CarbonCore framework, but seem to be unable to #include it in the program.
CarbonCore is a sub-framework within the CoreServices umbrella framework. Just include the main header of that umbrella framework:
#include <CoreServices/CoreServices.h>
Related
The cppreference.com and the cplusplus.com say that it's defined in <utility>. But my IDE sends me to "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\type_traits".
Cant't understand why.
The standard only specifies that #include <utility> gives you access to std::move. It does not require that definition to physically be present in that header file. The standard library is free to be organized internally as implementers see fit. For example, <utility> could consist of only #include <utility_internal> (which then contains the actual library implementation) - nothing in the standard forbids this.
In Microsoft's implementation of the standard library, <utility> has an #include <type_traits>. Thus, if you do #include <utility>, you will get std::move. That's all you should have to care about.
Here is the header search paths:
"$(SRCROOT)/../pjsip/third_party/lib"
/pjsip/third_party/lib
"$(SRCROOT)/../pjsip/pjlib/lib"
"$(SRCROOT)/../pjsip/pjlib-util/lib"
"$(SRCROOT)/../pjsip/pjmedia/lib"
"$(SRCROOT)/../pjsip/pjnath/lib"
"$(SRCROOT)/../pjsip/pjsip/lib"
It can find the header and libs, but this error occurs at #include <pjsip.h>:
Typedef redefinition with different types ('int' vs '__darwin_socklen_t' (aka 'unsigned int'))
First I think this can be identified as a compile error. Duplicate symbol define int and __darwin_socklen_t, surely it's strange.
It's better to create new empty project and add the search path and #include step by step to see which point cause the problem.
If you use objc, try renaming all '.m' files to '.mm'.
Is it possible to, when preprocessing occurs, request gcc (or cpp?) to link header file imports in code to different headers? For example, if I have a large codebase which uses a lot of #import <GL/gl.h>, while on the system I'm compiling on OpenGL headers reside in #import <OpenGL/gl.h>, could I request the preprocessor to link all import requests in GL to OpenGL?
Edit: The point is not to edit the source code. Like if hypothetically the only file you had access to was the Makefile.
Yes you can preprocess include or import names. Technique is called "computed includes" and documented here
#define GL_H "GL/gl.h"
...
#include GL_H
Behavior of #import in such cases must be identical to #include.
I'm trying to use the WinSCard-library to read data from a Myfare Card.
To do so I link against WinSCard.lib and include the header "WinSCard.h".
from my .pro file:
win32: PRE_TARGETDEPS += $$PWD/Lib/WinSCard.lib
win32: LIBS += -L$$PWD/Lib/ -lWinSCard
from my .cpp file:
#include "WinSCard.h"
But now I get dozens of errors (337 to be precise) of undefined symbols like '_in', '_out', '__reserved' and so on.
I use QtCreator/mingw++ as environment. My guess is, that these are typedefs which are library specific or windows specific.
These errors happen by including the header file, I did not use any of the API-functions yet.
Can anybody give me a hint, what I need to include/link to satisfy the compiler?
Thanks
I'm building a project on XCode 3.2.6 gcc 4.2 which uses the boost graph library (1.45). The build results in an annoying warning:
/include/boost/concept/detail/concept_def.hpp:34:1: warning: "BOOST_concept" redefined
concept_def.hpp does not appear to contain any protection to prevent this sort of multiple definition and the boost graph library seems to be constructed so as to ensure it is included multiple times. In my case the include sequences are:
One definition:
/include/boost/concept/detail/concept_def.hpp:34
/include/boost/graph/buffer_concepts.hpp:9,
/include/boost/graph/graph_concepts.hpp:21,
/include/boost/graph/detail/adjacency_list.hpp:31,
Another definition:
/include/boost/concept/detail/concept_def.hpp:34
/include/boost/graph/graph_concepts.hpp:25,
/include/boost/graph/detail/adjacency_list.hpp:31,
While this is only a warning I find it hard to believe this was released with boost and hence expect I am doing something wrong.
Any ideas?
Thanks,
Barrie
Error only seems to happen on XCode, all of our other platforms (linux gcc4, msvc2010) build fine.
Here is our workaround:
boost/concept/detail/concept_def.hpp:12
#ifdef BOOST_concept
# undef BOOST_concept
#endif
PS:
In case you are wondering why we don't put an #ifndef guard around the whole file then know that for some strange reason this does not work!
The issue posted in the page is the same one we encountered. Following is our solution based on the concention
add #include in the end of a hpp file if is included in the beginning of the file.
we added the include concept_undef.hpp in the end of buffer_concepts.hpp accordingly and it does solve the compiling error.