php7.1RC5 enable dmalloc compiling error - dmalloc

I just wanted to build PHP7 with enable-dmalloc
enveronment:
the version of PHP is 7.1.0RC5
debian 8
gcc6.2
dmalloc 5.5.2
used this command:
./configure --prefix=/usr/local/php/70 --with-config-file-path=/usr/local/lib/php/70/etc --enable-fpm --with-fpm-user=www-data --with-fpm-group=www-data --with-apxs2=/usr/local/httpd/2.4/bin/apxs --with-mysqli=/usr/local/mysql/bin/mysql_config --with-pgsql=/usr/local/PostgreSQL/9.5 --with-pdo-mysql=/usr/local/mysql --with-pdo-pgsql=/usr/local/PostgreSQL/ --enable-ftp --enable-zip --with-bz2 --with-iconv-dir --with-freetype-dir --with-jpeg-dir --with-png-dir -with-zlib --enable-bcmath --with-curl --enable-mbregex --enable-mbstring --with-mcrypt --with-gd --with-freetype-dir --enable-gd-native-ttf --with-mhash --enable-pcntl --enable-sockets --with-xmlrpc --enable-exif --enable-debug --enable-phpdbg --enable-phpdbg-webhelper --enable-phpdbg-debug --enable-dtrace --enable-dmalloc --with-openssl --enable-shmop --enable-sysvmsg --enable-sysvsem --enable-sysvshm --with-pear --enable-maintainer-zts
make
but it failed with the the Error Message:
/usr/include/malloc.h:38:35: error: expected declaration specifiers or ‘...’ before string constant extern void *malloc (size_t __size) __THROW __attribute_malloc__ __wur;
/usr/include/malloc.h:38:35: error: expected declaration specifiers or ‘...’ before numeric constant extern void *malloc (size_t __size) __THROW __attribute_malloc__ __wur;
In file included from /usr/local/src/php-7.1.0RC5/main/php.h:26:0,
from /usr/local/src/php-7.1.0RC5/ext/gd/libgd/gdhelpers.h:5,
from /usr/local/src/php-7.1.0RC5/ext/gd/libgd/gdft.c:13:
/usr/include/malloc.h:38:14: error: expected declaration specifiers or ‘...’ before ‘(’ token extern void *malloc (size_t __size) __THROW __attribute_malloc__ __wur;
/usr/include/malloc.h:38:14: error: expected declaration specifiers or ‘...’ before numeric constant extern void *malloc (size_t __size) __THROW __attribute_malloc__ __wur;
/usr/include/malloc.h:38:14: error: expected declaration specifiers or ‘...’ before numeric constant extern void *malloc (size_t __size) __THROW __attribute_malloc__ __wur;
/usr/include/malloc.h:38:14: error: expected declaration specifiers or ‘...’ before numeric constant extern void *malloc (size_t __size) __THROW __attribute_malloc__ __wur;
/usr/include/malloc.h:41:51: error: expected declaration specifiers or ‘...’ before string constant extern void *calloc (size_t __nmemb, size_t __size)
/usr/include/malloc.h:49:49: error: expected declaration specifiers or ‘...’ before string constant extern void *realloc (void *__ptr, size_t __size)
/usr/include/malloc.h:53:30: error: expected declaration specifiers or ‘...’ before string constant extern void free (void *__ptr) __THROW;
/usr/include/malloc.h:59:57: error: expected declaration specifiers or ‘...’ before string constant extern void *memalign (size_t __alignment, size_t __size)
/usr/include/malloc.h:63:35: error: expected declaration specifiers or ‘...’ before string constant extern void *valloc (size_t __size) __THROW __attribute_malloc__ __wur;
Makefile:1028: recipe for target 'ext/gd/libgd/gdft.lo' failed
make: *** [ext/gd/libgd/gdft.lo] Error 1
I see the source code in gdft.c, gdhelper.h and php.h, found this line:
#ifdef HAVE_DMALLOC
#include <dmalloc.h>
#endif
it maybe dmalloc caused this error, but I don't know why the error msg show malloc.h, I checked /usr/include, it has malloc.h and dmalloc.h two files
I install the package libdmalloc and libdmalloc-dev and I try to reinstall dmalloc with sourcecode but it's not helpful
What are the causes of these and how do I deal it ?

Related

QtXml/qdom.h proplems in a qt project

I'm using CGAL , libQGLViewer libraries in a project on QT creator , Fedora 27
but it shows errors on the header file of the libraries
Compile output:
/usr/include/QtXml/qdom.h:99:20: error: variable ‘Q_XML_EXPORT QDomImplementation’ has initializer but incomplete type
class Q_XML_EXPORT QDomImplementation
^~~~~~~~~~~~~~~~~~
/usr/include/QtXml/qdom.h:101:1: error: expected primary-expression before ‘public’
public:
^~~~~~
/usr/include/QtXml/qdom.h:101:1: error: expected ‘}’ before ‘public’
/usr/include/QtXml/qdom.h:101:1: error: expected ‘,’ or ‘;’ before ‘public’
/usr/include/QtXml/qdom.h:103:30: error: ‘QDomImplementation’ does not name a type
QDomImplementation(const QDomImplementation&);
^~~~~~~~~~~~~~~~~~
/usr/include/QtXml/qdom.h:103:50: error: expected constructor, destructor, or type conversion before ‘;’ token
QDomImplementation(const QDomImplementation&);
^
/usr/include/QtXml/qdom.h:104:26: error: expected constructor, destructor, or type conversion before ‘;’ token
~QDomImplementation();
^
/usr/include/QtXml/qdom.h:105:5: error: ‘QDomImplementation’ does not name a type
QDomImplementation& operator= (const QDomImplementation&);
^~~~~~~~~~~~~~~~~~
/usr/include/QtXml/qdom.h:106:28: error: ‘QDomImplementation’ does not name a type
bool operator== (const QDomImplementation&) const;
^~~~~~~~~~~~~~~~~~
/usr/include/QtXml/qdom.h:106:49: error: non-member function ‘bool operator==(const int&)’ cannot have cv-qualifier
bool operator== (const QDomImplementation&) const;
^~~~~
/usr/include/QtXml/qdom.h:106:49: error: ‘bool operator==(const int&)’ must have an argument of class or enumerated type
/usr/include/QtXml/qdom.h:107:28: error: ‘QDomImplementation’ does not name a type
bool operator!= (const QDomImplementation&) const;
^~~~~~~~~~~~~~~~~~
/usr/include/QtXml/qdom.h:107:49: error: non-member function ‘bool operator!=(const int&)’ cannot have cv-qualifier
bool operator!= (const QDomImplementation&) const;
^~~~~
/usr/include/QtXml/qdom.h:107:49: error: ‘bool operator!=(const int&)’ must have an argument of class or enumerated type
/usr/include/QtXml/qdom.h:110:69: error: non-member function ‘bool hasFeature(const QString&, const QString&)’ cannot have cv-qualifier
bool hasFeature(const QString& feature, const QString& version) const;
^~~~~
/usr/include/QtXml/qdom.h:121:1: error: expected unqualified-id before ‘private’
private:
^~~~~~~
/usr/include/QtXml/qdom.h:123:51: error: expected constructor, destructor, or type conversion before ‘;’ token
QDomImplementation(QDomImplementationPrivate*);
^
/usr/include/QtXml/qdom.h:125:5: error: ‘friend’ used outside of class
friend class QDomDocument;
^~~~~~
/usr/include/QtXml/qdom.h:126:1: error: expected declaration before ‘}’ token
};
all errors appear in QtXml/qdom.h file , I have no idea how to solve them
I appreciate any help,
thanks

Compiling fails, D programming (GDC)

So I have installed gdc trying to do a simple compile at command prompt. Not sure if my imports\includes actually work? What should I do? I am 100% sure the program compiles with Eclipse\dub\dtt\ldc...
*C:\Development\gdc\bin>x86_64-unknown-linux-gnu-gdc C:\Users\plann\Downloads\test\MessageApp\src\app.d --sysroot=C:\Development\gdc\sysroot -B "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\lib"
C:\Users\plann\Downloads\test\MessageApp\src\app.d:13:7: error: undefined identifier 'DWORD'
DWORD bakgrunfar = 0;
^
C:\Users\plann\Downloads\test\MessageApp\src\app.d:14:7: error: undefined identifier 'DWORD'
DWORD textfar = 0;
^
C:\Users\plann\Downloads\test\MessageApp\src\app.d:17:7: error: undefined identifier 'HFONT'
HFONT hFont, hOldFont;
^
C:\Users\plann\Downloads\test\MessageApp\src\app.d:17:14: error: undefined identifier 'HFONT'
HFONT hFont, hOldFont;
^
C:\Users\plann\Downloads\test\MessageApp\src\app.d:20:5: error: undefined identifier 'HWND'
int WindowProcedure (HWND, UINT, WPARAM, LPARAM );
^
C:\Users\plann\Downloads\test\MessageApp\src\app.d:20:5: error: undefined identifier 'UINT'
int WindowProcedure (HWND, UINT, WPARAM, LPARAM );
^
C:\Users\plann\Downloads\test\MessageApp\src\app.d:20:5: error: undefined identifier 'WPARAM'
int WindowProcedure (HWND, UINT, WPARAM, LPARAM );
^
C:\Users\plann\Downloads\test\MessageApp\src\app.d:20:5: error: undefined identifier 'LPARAM'
int WindowProcedure (HWND, UINT, WPARAM, LPARAM );
^
C:\Users\plann\Downloads\test\MessageApp\src\app.d:23:5: error: undefined identifier 'HINSTANCE'
int WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow)
^
C:\Users\plann\Downloads\test\MessageApp\src\app.d:23:5: error: undefined identifier 'HINSTANCE'
int WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow)
^
C:\Users\plann\Downloads\test\MessageApp\src\app.d:23:5: error: undefined identifier 'LPSTR'
int WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow)
^
C:\Users\plann\Downloads\test\MessageApp\src\app.d:44:5: error: undefined identifier 'HINSTANCE'
int myWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow)
^
C:\Users\plann\Downloads\test\MessageApp\src\app.d:44:5: error: undefined identifier 'HINSTANCE'
int myWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow)
^
C:\Users\plann\Downloads\test\MessageApp\src\app.d:44:5: error: undefined identifier 'LPSTR'
int myWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow)
^
C:\Users\plann\Downloads\test\MessageApp\src\app.d:99:5: error: undefined identifier 'HWND'
int WindowProcedure(HWND hwnd, UINT AEX, WPARAM wParam, LPARAM lParam) nothrow
^
C:\Users\plann\Downloads\test\MessageApp\src\app.d:99:5: error: undefined identifier 'UINT'
int WindowProcedure(HWND hwnd, UINT AEX, WPARAM wParam, LPARAM lParam) nothrow
^
C:\Users\plann\Downloads\test\MessageApp\src\app.d:99:5: error: undefined identifier 'WPARAM'
int WindowProcedure(HWND hwnd, UINT AEX, WPARAM wParam, LPARAM lParam) nothrow
^
C:\Users\plann\Downloads\test\MessageApp\src\app.d:99:5: error: undefined identifier 'LPARAM'
int WindowProcedure(HWND hwnd, UINT AEX, WPARAM wParam, LPARAM lParam) nothrow*
We cannot help without taking a look at the app.d. From the errors it seems that you did not import windows module that defines the various Windows-specific types.. Start with the following two typical imports:
import core.runtime;
import core.sys.windows.windows;
I strongly suggest you reading the following guide: https://wiki.dlang.org/D_for_Win32

invalid types 'uint8_t {aka unsigned char}[int]' for array subscript

I copied a script from a YouTube video because there was no download link to the script, but now i'm always getting the same error message and I don't know what to do. Could you help me?
This is my code:
#include <VirtualWire.h>
int ledPassive = 5;
int ledActive = 7;
int motor = 8;
void setup() {
// put your setup code here, to run once:
pinMode(ledPassive,OUTPUT);
pinMode(ledActive,OUTPUT);
pinMode(motor,OUTPUT);
vw_set_ptt_inverted(true);
vw_set_rx_pin(12);
vw_setup(4000);
vw_rx_start();
}
void loop()
{
digitalWrite(ledPassive,HIGH);
digitalWrite(motor,LOW);
digitalWrite(ledActive,LOW);
uint8_t buf(VW_MAX_MESSAGE_LEN);
uint8_t buflen = VW_MAX_MESSAGE_LEN;
if (vw_get_message(buf, &buflen)) {
if (buf[0]=='X'){
digitalWrite(ledPassive,LOW);
for (int i=0;i<10;i++){
digitalWrite(motor,LOW);
digitalWrite(ledActive,HIGH);
delay(200);
digitalWrite(motor,HIGH);
digitalWrite(ledActive,LOW);
delay(200);
}
}
else if (buf[0]!='x'){
digitalWrite(ledPassive,HIGH);
}
}
}
And this is the error message:
Arduino: 1.6.10 (Windows 10), Board:"Arduino Nano, ATmega328"
In function 'void loop()':
sketch_aug18e_self_made:29: error: invalid types 'uint8_t {aka unsigned char}[int]' for array subscript
if (buf[0]=='X'){
^
sketch_aug18e_self_made:40: error: invalid types 'uint8_t {aka unsigned char}[int]' for array subscript
else if (buf[0]!='x'){
^
exit status 1
invalid types 'uint8_t {aka unsigned char}[int]' for array subscript
This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.
Sorry for the bad language i'm dutch and not so very good at English
Try replacing
uint8_t buf(VW_MAX_MESSAGE_LEN);
with
uint8_t buf[VW_MAX_MESSAGE_LEN];
You're using improper syntax for declaring an array.

Syntax error: missing ';' before '*' when creating a pointer object of a user defined abstract class

I am trying to create pointer objects for my defined class 'FeralScene'
But i keep getting this error "Syntax error: missing ';' before '*'"
i dont know wats wrong with my code... could smone pls help me out?
/***********************************************************************
2D Engine Header File
File Name: FeralFramework
File Desc: Header to the Main Framework file
************************************************************************/
#ifndef FERALFRAMEWORK_H
#define FERALFRAMEWORK_H
#pragma once
#include<Windows.h>
#include<d3d9.h>
#include<d3dx9.h>
#include<string>
#include <dinput.h>
#include"FeralScene.h"
#include"GraphicDevice.h"
#include "Stdinc.h"
LRESULT CALLBACK WndProc(HWND,UINT,WPARAM,LPARAM);
class FeralFramework
{
public:
LPDIRECTINPUT8 inputDevice;
LPDIRECT3DDEVICE9 Device;
HWND WindowHandler;
HINSTANCE Instance;
FeralScene *CurrentScene,*PrevScene; // error occurs here
GraphicDevice graphicDevice;
static HWND StaticWindowHandle;
static IDirect3DDevice9 *GraphDevice;
int ScreenHeight;
int ScreenWidth;
bool IsFullScreen;
bool WindowCreation();
bool InitDirectx();
void MessageLoop();
void SetLighting();
void UpdateDrawLoopCallFunction();
void InitFrameWork();
void Render();
void initializeDirectInput();
//void Camera(int mx, int my);
void SceneSwitcher(FeralScene *SCENETOSWITCHTO);
// the FeralScene identifier error occurs here
FeralFramework();
FeralFramework(HINSTANCE Instance,int ScreenHeight,int ScreenWidth ,bool IsFullScreen,FeralScene *SentSceneObject );
// the FeralScene identifier error occurs here
FeralFramework(HINSTANCE Instance,FeralScene *SentSceneObject);
// the FeralScene identifier error occurs here
};
inline LRESULT CALLBACK WndProc(HWND WindowHandler,UINT Msg,WPARAM wparam,LPARAM lparam)
{
switch(Msg)
{
case WM_DESTROY:
PostQuitMessage(0);
return true;
default:
return DefWindowProc(WindowHandler,Msg,wparam,lparam);
}
}
#endif
And here is a list of the errors that pop up when i try to compile it
1>c:\users\sys\documents\visual studio 2010\projects\feralengine\feralengine\feralframework.h(33): error C2143: syntax error : missing ';' before '*'
1>c:\users\sys\documents\visual studio 2010\projects\feralengine\feralengine\feralframework.h(33): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\users\sys\documents\visual studio 2010\projects\feralengine\feralengine\feralframework.h(33): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\users\sys\documents\visual studio 2010\projects\feralengine\feralengine\feralframework.h(33): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\users\sys\documents\visual studio 2010\projects\feralengine\feralengine\feralframework.h(55): error C2061: syntax error : identifier 'FeralScene'
1>c:\users\sys\documents\visual studio 2010\projects\feralengine\feralengine\feralframework.h(58): error C2061: syntax error : identifier 'FeralScene'
1>c:\users\sys\documents\visual studio 2010\projects\feralengine\feralengine\feralframework.h(59): error C2061: syntax error : identifier 'FeralScene'
What am i missing ? Any help will be appreciated :(
And here is the code for FeralScene
/***********************************************************************
2D Engine Header File
File Name: FeralScene
File Desc: Header to the FeralScene file
************************************************************************/
#pragma once
#include<d3dx9.h>
#pragma once
#include<Windows.h>
#include<d3d9.h>
#include<d3dx9.h>
#include"GraphicDevice.h"
#include "FeralFramework.h"
//#include "Vector.h"
class FeralScene
{
public:
HWND WindowHandler;
IDirect3DDevice9 *Device;
int BackBufferHeight;
int BackBufferWidth;
bool IsFullScreen,HasLoadedResources,HasUnloadedResources;
virtual void Initialize(FeralScene *SentSceneObject) =0;
virtual void Load(GraphicDevice graphicDevice) =0;
virtual void Update(GraphicDevice graphicDevice) =0;
virtual void Draw(GraphicDevice graphicDevice) =0;
virtual void Unload() =0;
virtual void Lighting()=0;
virtual void LoadAnim()=0;
virtual void UnloadAnim()=0;
};
You are including FeralFrameWork.h in feralscene.h. Which doesnt know of FeralScene.h yet. You can crete a forward decleration in FeralFramework.h. Also I suggest using proper macros in FeralScene.h also to avoid multiple decelerations.
Since you are using pointer types in header forward decleration will resolve the issue.
// this should be before the class FeralFramework
class FeralScene;

Qt not recognising declared class

I use Qt 4.6.3 to write application for FriendlyARM. I am trying to pass 2 pointers (pointing to classes axesParam1 and mainWin) to current class localTime but get these errors :
localtime.h:17: error: 'axesParam1' has not been declared
localtime.h:18: error: 'mainWin' has not been declared
localtime.h:26: error: ISO C++ forbids declaration of 'axesParam1' with no type
localtime.h:26: error: expected ';' before '*' token
localtime.h:27: error: ISO C++ forbids declaration of 'mainWin' with no type
localtime.h:27: error: expected ';' before '*' token
In file included from trackinputstatus.h:5,
from trackinput.h:5,
from mainwin.h:8,
from geoparam.h:5,
from axesparam3.h:5,
from axesparam2.h:5,
from axesparam1.h:5,
from main.cpp:14:
trackparamstatus.h:16: error: 'mainWin' has not been declared
trackparamstatus.h:24: error: ISO C++ forbids declaration of 'mainWin' with no type
trackparamstatus.h:24: error: expected ';' before '*' token
main.cpp: In function 'int main(int, char**)':
main.cpp:52: error: no matching function for call to 'localTime::setChildren(axesParam1*)'
localtime.h:17: note: candidates are: void localTime::setChildren(int*)
main.cpp:61: error: no matching function for call to 'localTime::setHome(mainWin*)'
localtime.h:18: note: candidates are: void localTime::setHome(int*)
main.cpp:62: error: no matching function for call to 'trackParamStatus::setHome(mainWin*)'
trackparamstatus.h:16: note: candidates are: void trackParamStatus::setHome(int*)
I did not declared setChildern to accept int* as an argument so why is it insisting on int*?
I have included the header file localtime.h
#ifndef LOCALTIME_H
#define LOCALTIME_H
#include &ltQWidget>
#include "axesparam1.h"
#include "mainwin.h"
namespace Ui {
class localTime;
}
class localTime : public QWidget {
Q_OBJECT
public:
localTime(QWidget *parent = 0);
~localTime();
void setChildren(axesParam1 *);
void setHome(mainWin *);
protected:
void changeEvent(QEvent *e);
private:
Ui::localTime *ui;
axesParam1 *P1;
mainWin *w;
};
#endif // LOCALTIME_H
You look too far down. Before you look at setChildern you should look into axesparam1 and/or mainwin.
localtime.h:17: error: 'axesParam1' has not been declared
localtime.h:18: error: 'mainWin' has not been declared
You have some syntex error earlier. setChildern is only some follow-up error.

Resources