I would like to know what #include <tr1/memory> do? - ios7

I have this library vesSharedPtr.h which includes the following code:
#ifndef VESSHAREDPTR_H
#define VESSHAREDPTR_H
// C/C++ includes
#include < tr1/memory >
#define vesSharedPtr std::tr1::shared_ptr
#define vesWeakPtr std::tr1::weak_ptr
#endif // VESSHAREDPTR_H
Because when I'm trying to run my project, always appear this error:
#include < tr1/memory > file not found

I encountered this problem when compiling for iOS 7. It works on iOS 6, because the vtk.framework was compiled for iOS 6.

Related

typedef an sc_fixed but got template error

Trying to define a simple sc_fixed type in Visual Studio 2017:
#include <systemc.h>
#include <sysc/datatypes/fx/sc_fixed.h> # just in case
....
typedef sc_fixed<16, 4> fixed_type;
....
This typedef line resulted an error:
E0864: sc_fixed is not a template
Had no idea why this error popped, even included sysc/datatypes/fx/sc_fixed.h. Why does it say "not a template"?
From INSTALL file shipped with SystemC
SystemC 2.3 includes a fixed-point package that is always built.
When compiling your applications with fixed-point types, you still have
to use compiler flag -DSC_INCLUDE_FX. Note that compile times increase
significantly when using this compiler flag.
Using your code as an example
#include <systemc.h>
#include <sysc/datatypes/fx/sc_fixed.h>
#include <iostream>
typedef sc_dt::sc_fixed<16, 4> fixed_type;
int sc_main(int, char**){
fixed_type ft(1.25);
std::cout << "ft = " << ft << '\n';
return 0;
}
Gives me the output
ft = 1.25
As a caveat it is best to check the docs for your particular version of SystemC as I believe this #define may have been removed in 2.3.3 (I am using 2.3.2) I am not certain.
I got the same type of error message in one of my C++ programs - E0864 - unique_ptr is not a template
I managed to get rid of this error in my program by adding this to my header file.
#include <memory>
My program managed to compile okay using this. I am using Visual Studio 2019 if that helps.

PostgreSQL C functions not resolved by Eclipse CPP

I am trying to write a C function to be executed within PostgreSQL, something that will be declared like
CREATE OR REPLACE FUNCTION ...
RETURNS ... AS 'my_c_function' LANGUAGE C;
I followed the documentation and wrote a code containing stuff like PGFUNCTION_INFO_V1(func); or PG_GETARG_VARCHAR(0);. The problem is Eclipse keeps telling me these cannot be resolved. Here are the libraries I included:
#include <libpq-fe.h>
#include <postgres.h>
#include <fmgr.h>
#include <funcapi.h>
#include <executor/executor.h>
#include <string.h>
Should I include something else ? What am I missing ?
Your index may be out of date. Try rebuilding your index from the project menu.
Project > C/C++ Index > Rebuild
Additionally, make sure your included path is specified in your project settings if there is an issue including <postgres.h>.

Use of undeclared identifier 'GL_BGRA_EXT' error in iOS 8(Xcode 6)?

I am using Unity 4.3.4f1. and untill right now when i was making Builds for iOS they were working fine.
I just upgraded my Xcode from v5.1 to v6. now the same code is giving me error like the following
/.Project DIR/Classes/Unity/CMVideoSampling.mm:51:122: Use of undeclared identifier 'GL_BGRA_EXT'
can somebody please help me?
thanks
You should try replacing gl.h with glext.h in include statements of the file which contains this error.
Replace the following:-
#include <OpenGLES/ES2/gl.h>
with this :-
#include <OpenGLES/ES2/glext.h>
your include statements should look like this:-
Previously:-
#include "CMVideoSampling.h"
#include "CVTextureCache.h"
#include "GLESHelper.h"
#include <OpenGLES/ES2/gl.h>
#include <AVFoundation/AVFoundation.h>
After replacing:-
#include "CMVideoSampling.h"
#include "CVTextureCache.h"
#include "GLESHelper.h"
#include <OpenGLES/ES2/glext.h>//replace glext.h here
#include <AVFoundation/AVFoundation.h>

Build Fail: winsock2.h file not found

Added #define _WINSOCKAPI_ but still the build is failing.
/*
* $PostgreSQL: pgsql/src/include/port/win32/sys/socket.h,v 1.7 2006/10/04 00:30:10 momjian Exp $
*/
#ifndef WIN32_SYS_SOCKET_H
#define WIN32_SYS_SOCKET_H
/*
* Unfortunately, <wingdi.h> of VC++ also defines ERROR.
* To avoid the conflict, we include <windows.h> here and undefine ERROR
* immediately.
*
* Note: Don't include <wingdi.h> directly. It causes compile errors.
*/
#define _WINSOCKAPI_ //added this line but no help
#include <winsock2.h>
#include <ws2tcpip.h>
#include <windows.h>
#undef ERROR
#undef small
/* Restore old ERROR value */
#ifdef PGERROR
#define ERROR PGERROR
#endif
/*
* we can't use the windows gai_strerror{AW} functions because
* they are defined inline in the MS header files. So we'll use our
* own
*/
#undef gai_strerror
#endif /* WIN32_SYS_SOCKET_H */
You are trying to compile a Windows-specific header file on a platform that is decidedly not Windows. I can't imagine what you expect this to do; whatever it is, though, it doesn't.
Try using
#ifndef __APPLE__ ... #endif
Then, check out the other compile errors and include apple specific socket files, that also work under BSD socket.

Problem wit MDAC when trying to compile in VS2008 using x64 bit target platform

I am trying to compile an 32 bit application. I am aware of problems with it but that is why its being compiled on 64 bit version.
I am hanging at this problem.
Application uses lots of sql stuff.
In sqltypes.h file: (provided by MDAC)
#ifdef _WIN64
typedef INT64 SQLLEN;
typedef UINT64 SQLULEN;
typedef UINT64 SQLSETPOSIROW;
#else
#define SQLLEN SQLINTEGER
#define SQLULEN SQLUINTEGER
#define SQLSETPOSIROW SQLUSMALLINT
#endif
//For Backward compatibility
#ifdef WIN32
typedef SQLULEN SQLROWCOUNT;
typedef SQLULEN SQLROWSETSIZE;
typedef SQLULEN SQLTRANSID;
typedef SQLLEN SQLROWOFFSET;
#endif
For some reason when its compiled on 32 bit platform it works great
But when I try building it on 64 it goes berserk.
Error 61 error C2146: syntax error : missing ';' before identifier 'SQLLEN' ..\external\microsoft sdk\include\sqltypes.h 50
It does not recognize INT64, UINT64.
Is there something I need to enable so it will work under 64 build process?
Missing some #include or #define?
Any help would be great
Thanks
It turned out the problem was that somehow BaseTsd.h was not included (can't believe this is possible)
but as short fix I just included BaseTsd.h manually... i will comment on this answer if i find better solution
Use
#include <windows.h>
It contains BaseTsd.h and other relevant Windows-specific definitions.