MinGW with codeblocks and windows headers - codeblocks

I'm using codeblocks with Mingw as my compiler. I'm working on a win32 project (winapi)..
the problem it seems codeblocks does not have access to some windows headers...
in my particular case the header missing is commdlg.h and using a variable in that header the compiler gives me error : the variable was not declared in this scope...
so how do I make codeblocks have all the necessary windows headers using Mingw?
the code is
bool Gui::_browseForFile(HWND owner, LPWSTR initialDir, LPWSTR fileBuffer)
{
OPENFILENAMEW ofn;
Mem::_zero(&ofn, sizeof(OPENFILENAMEW));
ofn.lStructSize = sizeof(OPENFILENAMEW);
ofn.hwndOwner = owner;
ofn.lpstrFile = fileBuffer;
ofn.nMaxFile = MAX_PATH;
ofn.lpstrInitialDir = initialDir;
ofn.Flags = OFN_DONTADDTORECENT | OFN_ENABLESIZING | OFN_FILEMUSTEXIST | OFN_PATHMUSTEXIST | OFN_HIDEREADONLY | OFN_PATHMUSTEXIST;
return CWA(comdlg32, GetOpenFileNameW)(&ofn) ? true : false;
}
now the build log is
-------------- Build: Debug in NewZe (compiler: GNU GCC Compiler)---------------
mingw32-g++.exe -Wall -std=c++11 -g -masm=intel -g -masm=intel -std=c++11 -g -c C:\Users\mike\Desktop\workspace\NewZe\gui.cpp -o obj\Debug\gui.o
C:\Users\mike\Desktop\workspace\NewZe\gui.cpp: In function 'HWND__* Gui::_windowFromPoint(POINT, DWORD, DWORD*)':
C:\Users\mike\Desktop\workspace\NewZe\gui.cpp:56:20: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
else if(result == HTTRANSPARENT)
^
C:\Users\mike\Desktop\workspace\NewZe\gui.cpp: In function 'bool Gui::_browseForFile(HWND, LPWSTR, LPWSTR)':
C:\Users\mike\Desktop\workspace\NewZe\gui.cpp:146:25: error: 'OFN_DONTADDTORECENT' was not declared in this scope
ofn.Flags = OFN_DONTADDTORECENT | OFN_ENABLESIZING | OFN_FILEMUSTEXIST | OFN_PATHMUSTEXIST | OFN_HIDEREADONLY | OFN_PATHMUSTEXIST;
^
C:\Users\mike\Desktop\workspace\NewZe\gui.cpp: In function 'bool Gui::_browseForSaveFile(HWND, LPWSTR, LPWSTR, LPWSTR, LPWSTR, DWORD)':
C:\Users\mike\Desktop\workspace\NewZe\gui.cpp:163:25: error: 'OFN_DONTADDTORECENT' was not declared in this scope
ofn.Flags = OFN_DONTADDTORECENT | OFN_ENABLESIZING | OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT;
^
C:\Users\mike\Desktop\workspace\NewZe\gui.cpp: In function 'bool Gui::_loadCommonControl(DWORD)':
C:\Users\mike\Desktop\workspace\NewZe\gui.cpp:182:3: error: 'INITCOMMONCONTROLSEX' was not declared in this scope
INITCOMMONCONTROLSEX cc;
^
C:\Users\mike\Desktop\workspace\NewZe\gui.cpp:184:3: error: 'cc' was not declared in this scope
cc.dwSize = sizeof(INITCOMMONCONTROLSEX);
^
In file included from C:\Users\mike\Desktop\workspace\NewZe\gui.cpp:8:0:
C:\Users\mike\Desktop\workspace\NewZe\defines.h:3:39: error: '::InitCommonControlsEx' has not been declared
#define CWA(dll, api) ::api
^
C:\Users\mike\Desktop\workspace\NewZe\gui.cpp:187:11: note: in expansion of macro 'CWA'
return (CWA(Comctl32, InitCommonControlsEx)(&cc) == TRUE);
^
C:\Users\mike\Desktop\workspace\NewZe\gui.cpp:188:1: warning: control reaches end of non-void function [-Wreturn-type]
}
^

Related

linux-xlnx kernel updating from 3.17.0 to 5.15.0, get_fs(), set_fs() macros

I am new to kernel driver development and I am trying update kernel version of a legacy project.
Example code is below
#include <linux/uaccess.h>
struct file *file_open(const char *path, int flags, int rights)
{
struct file *filptr = NULL;
int err = 0;
oldfs = get_fs();
set_fs(get_ds());
filptr = filp_open(path, flags, rights);
if (IS_ERR(filptr)) {
err = PTR_ERR(filptr);
return NULL;
}
return filptr;
}
void file_close(struct file *file)
{
int retval = filp_close(file, NULL);
printk("file_close retval: %d\n",retval);
set_fs(oldfs);
}
I am having below implicit declaration of get_fs() and set_fs() macros.
/driver.c: In function 'file_open':
/driver.c:593:27: error: implicit declaration of function 'get_fs'; did you mean 'get_bh'? [-Werror=implicit-function-declaration]
593 | oldfs = (mm_segment_t)get_fs();
| ^~~~~~
| get_bh
/driver.c:593:5: error: conversion to non-scalar type requested
593 | oldfs = (mm_segment_t)get_fs();
| ^~~~~
/driver.c:594:5: error: implicit declaration of function 'set_fs'; did you mean 'sget_fc'? [-Werror=implicit-function-declaration]
594 | set_fs(get_ds());
| ^~~~~~
| sget_fc
/driver.c:594:12: error: implicit declaration of function 'get_ds'; did you mean 'get_bh'? [-Werror=implicit-function-declaration]
594 | set_fs(get_ds());
| ^~~~~~
get_fs() and set_fs() macros have been removed from arm architecture <asm/uaccess.h> user access header file. But they are still defined in <asm-generic/uaccess.h> header. I couldn't find if it is proper to use generic user access apis in <asm-generic/uaccess.h> header file. If include both headers, I get redefinition warnings and errors.
./include/asm-generic/uaccess.h:129: warning: "access_ok" redefined
129 | #define access_ok(addr, size) __access_ok((unsigned long)(addr),(size))
|
In file included from ./include/linux/uaccess.h:11,
from ./include/linux/sched/task.h:11,
from ./include/linux/sched/signal.h:9,
from ./include/linux/rcuwait.h:6,
from ./include/linux/percpu-rwsem.h:7,
from ./include/linux/fs.h:33,
from ./include/linux/highmem.h:5,
from ./include/linux/bvec.h:10,
from ./include/linux/blk_types.h:10,
from ./include/linux/genhd.h:19,
from ./include/linux/blkdev.h:8,
from driver.c:6:
./arch/arm/include/asm/uaccess.h:251: note: this is the location of the previous definition
251 | #define access_ok(addr, size) (__range_ok(addr, size) == 0)
|
./include/asm-generic/uaccess.h:148: warning: "__put_user" redefined
148 | #define __put_user(x, ptr) \
|
./arch/arm/include/asm/uaccess.h:378: note: this is the location of the previous definition
378 | #define __put_user(x, ptr) put_user(x, ptr)
|
./include/asm-generic/uaccess.h:168: warning: "put_user" redefined
168 | #define put_user(x, ptr) \
|
./arch/arm/include/asm/uaccess.h:366: note: this is the location of the previous definition
366 | #define put_user(x, ptr) \
|
./include/asm-generic/uaccess.h:190: warning: "__get_user" redefined
190 | #define __get_user(x, ptr) \
|
./arch/arm/include/asm/uaccess.h:260: note: this is the location of the previous definition
260 | #define __get_user(x, ptr) get_user(x, ptr)
|
./include/asm-generic/uaccess.h:230: warning: "get_user" redefined
230 | #define get_user(x, ptr) \
|
./arch/arm/include/asm/uaccess.h:213: note: this is the location of the previous definition
213 | #define get_user(x, p) \
|
./include/asm-generic/uaccess.h:256:1: error: redefinition of '__clear_user'
256 | __clear_user(void __user *to, unsigned long n)
| ^~~~~~~~~~~~
./arch/arm/include/asm/uaccess.h:562:1: note: previous definition of '__clear_user' with type 'long unsigned int(void *, long unsigned int)'
562 | __clear_user(void __user *addr, unsigned long n)
| ^~~~~~~~~~~~
./include/asm-generic/uaccess.h:264:1: error: redefinition of 'clear_user'
264 | clear_user(void __user *to, unsigned long n)
| ^~~~~~~~~~
./arch/arm/include/asm/uaccess.h:588:42: note: previous definition of 'clear_user' with type 'long unsigned int(void *, long unsigned int)'
588 | static inline unsigned long __must_check clear_user(void __user *to, unsigned long n)
| ^~~~~~~~~~
So as I understood, for arm architecture only one header must be included. After kernel version 4.11 recommended way to include architecture specific headers is with <linux/uaccess.h> header. And this header includes <asm/uaccess.h>. So I infer <asm-generic/uaccess.h> should not included directly.
But other architectures still have get_fs() and set_fs() macros available in their headers.
As I understand these macros are setter/getter for thread address space defined in thread_info structure. But arm architecture's struct thread_info definition does not define this field.
I would like to ask if these macros usage is deprecated for arm arch. Is there any way to access thread adress space for arm architecture. Where should I look, any hint is appreciated.

Why does this template work in a single file but not across files?

Consider array.sats:
#include "share/atspre_staload.hats"
fun {a:t#ype} make: (int, a) -> void
array.dats:
#include "share/atspre_staload.hats"
staload "./array.sats"
implement {a} make(n: int, x: a) = ()
and example.dats:
staload Array = "./array.sats"
implement main0() = () where {
val arr = $Array.make<int>(10, 42)
}
These fail to compile with a bunch of template errors:
$ make clean all
rm -fv *_[sd]ats.[co] example
removed 'array_dats.c'
removed 'array_dats.o'
removed 'array_sats.c'
removed 'array_sats.o'
removed 'example_dats.c'
patscc -DATS_MEMALLOC_GCBDW -c array.sats
clang: warning: argument unused during compilation: '-L/usr/local/lib/ats2-postiats-0.3.9/ccomp/atslib/lib' [-Wunused-command-line-argument]
clang: warning: argument unused during compilation: '-L/usr/local/lib/ats2-postiats-0.3.9/ccomp/atslib/lib64' [-Wunused-command-line-argument]
patscc -DATS_MEMALLOC_GCBDW -c array.dats
clang: warning: argument unused during compilation: '-L/usr/local/lib/ats2-postiats-0.3.9/ccomp/atslib/lib' [-Wunused-command-line-argument]
clang: warning: argument unused during compilation: '-L/usr/local/lib/ats2-postiats-0.3.9/ccomp/atslib/lib64' [-Wunused-command-line-argument]
patscc -DATS_MEMALLOC_GCBDW -o example example.dats -lgc
example_dats.c:169:23: error: use of undeclared identifier 'PMVtmpltcstmat'
ATSINSmove_void(tmp1, PMVtmpltcstmat[0](make<S2Eapp(S2Ecst(g0int_t0ype); S2Eextkind(atstype_int))>)(ATSPMVi0nt(10), ATSPMVi0nt(42))) ;
^
example_dats.c:169:46: warning: implicit declaration of function 'S2Eapp' is invalid in C99 [-Wimplicit-function-declaration]
ATSINSmove_void(tmp1, PMVtmpltcstmat[0](make<S2Eapp(S2Ecst(g0int_t0ype); S2Eextkind(atstype_int))>)(ATSPMVi0nt(10), ATSPMVi0nt(42))) ;
^
example_dats.c:169:53: warning: implicit declaration of function 'S2Ecst' is invalid in C99 [-Wimplicit-function-declaration]
ATSINSmove_void(tmp1, PMVtmpltcstmat[0](make<S2Eapp(S2Ecst(g0int_t0ype); S2Eextkind(atstype_int))>)(ATSPMVi0nt(10), ATSPMVi0nt(42))) ;
^
example_dats.c:169:60: error: use of undeclared identifier 'g0int_t0ype'
ATSINSmove_void(tmp1, PMVtmpltcstmat[0](make<S2Eapp(S2Ecst(g0int_t0ype); S2Eextkind(atstype_int))>)(ATSPMVi0nt(10), ATSPMVi0nt(42))) ;
^
example_dats.c:169:41: error: use of undeclared identifier 'make'
ATSINSmove_void(tmp1, PMVtmpltcstmat[0](make<S2Eapp(S2Ecst(g0int_t0ype); S2Eextkind(atstype_int))>)(ATSPMVi0nt(10), ATSPMVi0nt(42))) ;
^
example_dats.c:169:99: error: expected expression
ATSINSmove_void(tmp1, PMVtmpltcstmat[0](make<S2Eapp(S2Ecst(g0int_t0ype); S2Eextkind(atstype_int))>)(ATSPMVi0nt(10), ATSPMVi0nt(42))) ;
^
2 warnings and 4 errors generated.
make: *** [example] Error 1
Meanwhile the same content in a single file compiles and runs without error:
#include "share/atspre_staload.hats"
extern fun {a:t#ype} make: (int, a) -> void
#include "share/atspre_staload.hats"
implement {a} make(n: int, x: a) = ()
implement main0() = () where {
val arr = make<int>(10, 42)
}
What's wrong with the separated code? Very similar code in the $UNSAFE files seems to work fine with templates and with a namespace.
You also need to staload array.dats:
staload Array = "./array.sats"
staload _(*Array*) = "./array.dats"
implement main0() = () where {
val arr = $Array.make<int>(10, 42)
}

Issues with Inheritance and OpenCL

I am trying to port some code to linux from Windows. I have gotten pretty far, but now I am stuck on an error with inheritance. But I can't figure out what's not working. It appears that It's not importing the header, but I can't figure out why because it seems to me that is should be working.
here is the error output:
/usr/bin/c++ -DHAVE_CLOGS -DQT_CORE_LIB -DQT_GUI_LIB -DQT_NO_DEBUG -DQT_WIDGETS_LIB -std=c++11 -I/code/cuda/JF-Cut/src/build -I/code/cuda/JF-Cut/src/QVisualizer -I/code/cuda/clogs-install/include -I/usr/local/cuda-7.5/targets/x86_64-linux/include -isystem /opt/Qt/5.5/gcc_64/include -isystem /opt/Qt/5.5/gcc_64/include/QtWidgets -isystem /opt/Qt/5.5/gcc_64/include/QtGui -isystem /opt/Qt/5.5/gcc_64/include/QtCore -isystem /opt/Qt/5.5/gcc_64/./mkspecs/linux-g++ -fPIC -o CMakeFiles/QGCWidget.dir/Graph_Cut/QGCWidget.cpp.o -c /code/cuda/JF-Cut/src/QVisualizer/Graph_Cut/QGCWidget.cpp
In file included from /code/cuda/JF-Cut/src/QVisualizer/Graph_Cut/QGCWidget.cpp:44:0:
/code/cuda/JF-Cut/src/QVisualizer/Graph_Cut/../infrastructures/QError.h:45:11: error: ‘cl::Error’ has not been declared
using cl::Error;
^
/code/cuda/JF-Cut/src/QVisualizer/Graph_Cut/../infrastructures/QError.h:48:1: error: expected class-name before ‘{’ token
{
^
/code/cuda/JF-Cut/src/QVisualizer/Graph_Cut/../infrastructures/QError.h: In member function ‘void QError::serialize(std::ostringstream&, cl_int)’:
/home/sansomk/code/cuda/JF-Cut/src/QVisualizer/Graph_Cut/../infrastructures/QError.h:68:13: error: ‘cl::Error’ has not been declared
cl::Error::serialize(s, code);
Here is the Code for QError.h
#ifndef QERROR_H
#define QERROR_H
#ifndef __CL_ENABLE_EXCEPTIONS
#define __CL_ENABLE_EXCEPTIONS
#endif
// removed #include "../3rdParty/cl/cl_stacktrace.hpp"
#if defined(__APPLE__) || defined(__MACOSX)
#include <OpenCL/cl.hpp>
#else
#include <CL/cl.hpp>
#endif
#define Q_LOGIC_ERROR -100
#define Q_INVALID_ARGUMENT -101
#define Q_LENGTH_ERROR -102
#define Q_OUT_OF_RANGE -103
#define Q_FUTURE_ERROR -104
#define Q_RUNTIME_ERROR -110
#define Q_RANGE_ERROR -111
#define Q_OVERFLOW_ERROR -112
#define Q_UNDERFLOW_ERROR -113
#define Q_SYSTEM_ERROR -114
using cl::Error;
class QError : public cl::Error
{
protected:
cl_int level_;
void serialize(std::ostringstream& s, cl_int code)
{
std::string error;
switch (code)
{
case Q_LOGIC_ERROR: error = "Q_LOGIC_ERROR"; break;
case Q_INVALID_ARGUMENT: error = "Q_INVALID_ARGUMENT"; break;
case Q_LENGTH_ERROR: error = "Q_LENGTH_ERROR"; break;
case Q_OUT_OF_RANGE: error = "Q_OUT_OF_RANGE"; break;
case Q_FUTURE_ERROR: error = "Q_FUTURE_ERROR"; break;
case Q_RUNTIME_ERROR: error = "Q_RUNTIME_ERROR"; break;
case Q_RANGE_ERROR: error = "Q_RANGE_ERROR"; break;
case Q_OVERFLOW_ERROR: error = "Q_OVERFLOW_ERROR"; break;
case Q_UNDERFLOW_ERROR: error = "Q_UNDERFLOW_ERROR"; break;
case Q_SYSTEM_ERROR: error = "Q_SYSTEM_ERROR"; break;
}
if (!error.empty()) s << " > " << error << ", ";
cl::Error::serialize(s, code);
}
public:
QError(cl_int level, cl_int err, const char * errStr = NULL) : level_(level), cl::Error(err, errStr) {}
~QError() throw() {}
cl_int level(void) const { return level_; }
virtual const char * what() throw ()
{
std::ostringstream s;
serialize(s, err_);
errStr_ = s.str();
return errStr_.c_str();
}
};
#endif // QERROR_H
In order to use cl::Error you need to define __CL_ENABLE_EXCEPTIONS.
I can see you have it there, but that file is a header file. If you include OpenCL headers somewhere else earlier in the compilation unit (.cpp) without defining __CL_ENABLE_EXCEPTIONS. Then the later includes will simply skip (due to ifdefs in the header file to avoid multiple instances of the same .h file).
What you should do for these types of global compilation defines, is declare them in the command line.
g++ ... -D__CL_ENABLE_EXCEPTIONS
That way you ensure the defines are enabled at the very beginning of the compilation.

go runtime fails to compile

I am just wondering why would go runtime fail to build. How do we pass flags (-fpermissive in this case) to the c compiler which golang compiler is using to build the runtime. I am using gcc-4.6.2 on ubuntu 12.04
../../../thirdparty/go1.4.2/x86_64-unknown-linux-gnu/x86_64-unknown-linux-gnu/src/runtime/cgo/gcc_linux_amd64.c: In function ‘void _cgo_sys_thread_start(ThreadStart*)’:
../../../thirdparty/go1.4.2/x86_64-unknown-linux-gnu/x86_64-unknown-linux-gnu/src/runtime/cgo/gcc_linux_amd64.c:45:41: error: invalid conversion from ‘void*’ to ‘__sigset_t*’ [-fpermissive]
A sample program written also fails to compile, it seems the nil defined in the go code is the problem, i wonder how others are working, when does the golang compiler compiles this runtime code ?
gcc t.c -lpthread -o t
t.c: In function ‘void* hello_world(void*)’:
t.c:12:41: error: invalid conversion from ‘void*’ to ‘__sigset_t*’ [-fpermissive]
/usr/include/x86_64-linux-gnu/bits/sigthread.h:31:12: error: initializing argument 3 of ‘int pthread_sigmask(int, const __sigset_t*, __sigset_t*)’ [-fpermissive]
rk#rk-VirtualBox:~$ gcc -fpermissive t.c -lpthread -o t
t.c: In function ‘void* hello_world(void*)’:
t.c:12:41: warning: invalid conversion from ‘void*’ to ‘__sigset_t*’ [-fpermissive]
rk#rk-VirtualBox:~$ cat t.c
#include<pthread.h>
#include<stdio.h>
#include<signal.h>
#define nil ((void*)0)
static void*
hello_world(void *vptr)
{
sigset_t set;
sigemptyset(&set);
pthread_sigmask(SIG_BLOCK, &set, nil);
printf("hello world");
return NULL;
}
int main(int ac, char **av)
{
pthread_t t;
pthread_create(&t, NULL, hello_world, NULL);
pthread_join(t, NULL);
return 0;
}
/usr/include/x86_64-linux-gnu/bits/sigthread.h:31:12: error: initializing argument 3 of ‘int pthread_sigmask(int, const __sigset_t*, __sigset_t*)’ [-fpermissive]
make: *** [rulemanager] Error 2

Switching the default Xcode compiler to "apple-gcc42"? (especially for perl Javascript::V8)

Starting points:
using Macports for all packages on OS x but perl (e.g. have installed the v8 Macports package)
for perl - using perlbrew
Javascript::V8 has a known bug - it didn't compiles with the newest Xcode compiler
the bugreport mentioning about the working apple-gcc42
i have installed from the Macports the "apple-gcc42" package
The question is: what i need to do, for using the compiler contained in "apple-gcc42" Macports package for manually compiling the "Javascript::V8" perl Module?
Now perl Makefile.PL, make using the default g++ what is in /usr/bin - the standard Xcode compiler - so, probably need:
somehow switch the compiler to "apple-gcc42" (probably need setup some symlinks, but don't know how/where/what)
and/or - change somehow the Makefile.PL
will need recompile everything (the perl itself and all other perl modules) with the "apple-gcc42"?
and/or
based on #amon's comment - how to switch the OS X to using the "apple-gcc42" as a default compiler for all things, e.g. for the Macport's itself (because the v8 is from the Macports) and for the perlbrew too.
Any idea how to get an working Javascript::V8 perl module on OS X Mavericks and perlbrew?
EDIT
For #Oleg-G - Adding the error output
~/Downloads/javascript-v8-master$ perl Makefile.PL
Generating a GNU-style Makefile
Writing Makefile for JavaScript::V8
Writing MYMETA.yml and MYMETA.json
~/Downloads/javascript-v8-master$ make
cp lib/JavaScript/V8/Context.pm blib/lib/JavaScript/V8/Context.pm
cp lib/JavaScript/V8.pm blib/lib/JavaScript/V8.pm
g++ -c -I. -fno-common -DPERL_DARWIN -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -I/opt/local/include -O3 -DVERSION=\"0.07\" -DXS_VERSION=\"0.07\" "-I/Users/jm/perl5/perlbrew/perls/perl-5.16.3/lib/5.16.3/darwin-2level/CORE" V8Context.cpp
V8Context.cpp:132:61: warning: inequality comparison result unused [-Wunused-comparison]
for (sv_map::const_iterator it = objects.find(hash); it != objects.end(), it->first == hash; it++)
~~~^~~~~~~~~~~~~~~~
V8Context.cpp:132:61: note: use '|=' to turn this inequality comparison into an or-assignment
for (sv_map::const_iterator it = objects.find(hash); it != objects.end(), it->first == hash; it++)
^~
|=
V8Context.cpp:141:34: error: 'New' is a private member of 'v8::PersistentBase<v8::Object>'
, object(Persistent<Object>::New(object_))
^
/opt/local/include/v8.h:595:23: note: declared private here
V8_INLINE static T* New(Isolate* isolate, T* that);
^
V8Context.cpp:141:45: error: too few arguments to function call, expected 2, have 1
, object(Persistent<Object>::New(object_))
~~~~~~~~~~~~~~~~~~~~~~~ ^
/opt/local/include/v8.h:595:3: note: 'New' declared here
V8_INLINE static T* New(Isolate* isolate, T* that);
^
/opt/local/include/v8config.h:305:20: note: expanded from macro 'V8_INLINE'
# define V8_INLINE inline __attribute__((always_inline))
^
V8Context.cpp:167:12: error: no matching member function for call to 'MakeWeak'
object.MakeWeak(this, PerlObjectData::destroy);
~~~~~~~^~~~~~~~
/opt/local/include/v8.h:733:22: note: candidate function [with P = PerlObjectData] not viable: no known conversion from
'void (Persistent<v8::Value>, void *)' to 'typename WeakReferenceCallbacks<Object, PerlObjectData>::Revivable' (aka 'void
(*)(v8::Isolate *, Persistent<v8::Object, v8::NonCopyablePersistentTraits<v8::Object> > *, PerlObjectData *)') for 2nd
argument
V8_INLINE void MakeWeak(
^
/opt/local/include/v8config.h:336:45: note: expanded from macro 'V8_DEPRECATED'
# define V8_DEPRECATED(message, declarator) declarator
^
/opt/local/include/v8.h:726:22: note: candidate template ignored: couldn't infer template argument 'S'
V8_INLINE void MakeWeak(
^
/opt/local/include/v8config.h:336:45: note: expanded from macro 'V8_DEPRECATED'
# define V8_DEPRECATED(message, declarator) declarator
^
V8Context.cpp:229:40: error: unknown type name 'Arguments'; did you mean 'v8::internal::Arguments'?
virtual Handle<Value> invoke(const Arguments& args);
^~~~~~~~~
v8::internal::Arguments
/opt/local/include/v8.h:145:7: note: 'v8::internal::Arguments' declared here
class Arguments;
^
V8Context.cpp:252:41: error: unknown type name 'Arguments'; did you mean 'v8::internal::Arguments'?
static Handle<Value> v8invoke(const Arguments& args) {
^~~~~~~~~
v8::internal::Arguments
/opt/local/include/v8.h:145:7: note: 'v8::internal::Arguments' declared here
class Arguments;
^
V8Context.cpp:237:42: error: member reference type 'Persistent<v8::Function>' is not a pointer
context_->make_function->Call(
~~~~~~~~~~~~~~~~~~~~~~~^
V8Context.cpp:253:75: error: no member named 'Unwrap' in 'v8::External'
PerlFunctionData* data = static_cast<PerlFunctionData*>(External::Unwrap(args[0]));
~~~~~~~~~~^
V8Context.cpp:268:32: error: unknown type name 'Arguments'; did you mean 'v8::internal::Arguments'?
PerlFunctionData::invoke(const Arguments& args) {
^~~~~~~~~
v8::internal::Arguments
/opt/local/include/v8.h:145:7: note: 'v8::internal::Arguments' declared here
class Arguments;
^
V8Context.cpp:277:40: error: unknown type name 'Arguments'; did you mean 'v8::internal::Arguments'?
virtual Handle<Value> invoke(const Arguments& args);
^~~~~~~~~
v8::internal::Arguments
/opt/local/include/v8.h:145:7: note: 'v8::internal::Arguments' declared here
class Arguments;
^
V8Context.cpp:288:30: error: unknown type name 'Arguments'; did you mean 'v8::internal::Arguments'?
PerlMethodData::invoke(const Arguments& args) {
^~~~~~~~~
v8::internal::Arguments
/opt/local/include/v8.h:145:7: note: 'v8::internal::Arguments' declared here
class Arguments;
^
V8Context.cpp:311:28: error: too few arguments to function call, at least argument 'isolate' must be specified
context = Context::New();
~~~~~~~~~~~~ ^
/opt/local/include/v8.h:5206:3: note: 'New' declared here
static Local<Context> New(
^
V8Context.cpp:313:20: error: no matching constructor for initialization of 'Context::Scope'
Context::Scope context_scope(context);
^ ~~~~~~~
/opt/local/include/v8.h:5317:9: note: candidate constructor (the implicit copy constructor) not viable: no known conversion from
'Persistent<v8::Context>' to 'const v8::Context::Scope' for 1st argument
class Scope {
^
/opt/local/include/v8.h:5319:24: note: candidate constructor not viable: no known conversion from 'Persistent<v8::Context>' to
'Handle<v8::Context>' for 1st argument
explicit V8_INLINE Scope(Handle<Context> context) : context_(context) {
^
/opt/local/include/v8.h:5324:19: note: candidate constructor not viable: requires 2 arguments, but 1 was provided
V8_INLINE Scope(Isolate* isolate, Persistent<Context>& context)) // NOLINT
^
/opt/local/include/v8config.h:336:45: note: expanded from macro 'V8_DEPRECATED'
# define V8_DEPRECATED(message, declarator) declarator
^
V8Context.cpp:314:17: error: calling a private constructor of class 'v8::HandleScope'
HandleScope handle_scope;
^
/opt/local/include/v8.h:874:13: note: declared private here
V8_INLINE HandleScope() {}
^
V8Context.cpp:317:12: error: member reference type 'Persistent<v8::Context>' is not a pointer
context->Global()->Set(
~~~~~~~^
V8Context.cpp:333:43: error: 'New' is a private member of 'v8::PersistentBase<v8::Function>'
make_function = Persistent<Function>::New(Handle<Function>::Cast(script->Run()));
^
/opt/local/include/v8.h:595:23: note: declared private here
V8_INLINE static T* New(Isolate* isolate, T* that);
^
V8Context.cpp:333:84: error: too few arguments to function call, expected 2, have 1
make_function = Persistent<Function>::New(Handle<Function>::Cast(script->Run()));
~~~~~~~~~~~~~~~~~~~~~~~~~ ^
/opt/local/include/v8.h:595:3: note: 'New' declared here
V8_INLINE static T* New(Isolate* isolate, T* that);
^
/opt/local/include/v8config.h:305:20: note: expanded from macro 'V8_INLINE'
# define V8_INLINE inline __attribute__((always_inline))
^
V8Context.cpp:335:39: error: 'New' is a private member of 'v8::PersistentBase<v8::String>'
string_wrap = Persistent<String>::New(String::New("wrap"));
^
/opt/local/include/v8.h:595:23: note: declared private here
V8_INLINE static T* New(Isolate* isolate, T* that);
^
V8Context.cpp:335:62: error: too few arguments to function call, expected 2, have 1
string_wrap = Persistent<String>::New(String::New("wrap"));
~~~~~~~~~~~~~~~~~~~~~~~ ^
/opt/local/include/v8.h:595:3: note: 'New' declared here
V8_INLINE static T* New(Isolate* isolate, T* that);
^
/opt/local/include/v8config.h:305:20: note: expanded from macro 'V8_INLINE'
# define V8_INLINE inline __attribute__((always_inline))
^
V8Context.cpp:342:17: error: member reference type 'Persistent<v8::Object>' is not a pointer
data->object->SetHiddenValue(string_wrap, External::Wrap(data));
~~~~~~~~~~~~^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
1 warning and 20 errors generated.
make: *** [V8Context.o] Error 1
~/Downloads/javascript-v8-master$
about g++
~/Downloads/javascript-v8-master$ g++ --version
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
Apple LLVM version 5.0 (clang-500.2.79) (based on LLVM 3.3svn)
Target: x86_64-apple-darwin13.0.0
Thread model: posix
my perl
~/Downloads/javascript-v8-master$ perl -V
Summary of my perl5 (revision 5 version 16 subversion 3) configuration:
Platform:
osname=darwin, osvers=12.3.0, archname=darwin-2level
uname='darwin jonatan.local 12.3.0 darwin kernel version 12.3.0: sun jan 6 22:37:10 pst 2013; root:xnu-2050.22.13~1release_x86_64 x86_64 '
config_args='-de -Dprefix=/Users/jm/perl5/perlbrew/perls/perl-5.16.3 -Aeval:scriptdir=/Users/jm/perl5/perlbrew/perls/perl-5.16.3/bin'
hint=recommended, useposix=true, d_sigaction=define
useithreads=undef, usemultiplicity=undef
useperlio=define, d_sfio=undef, uselargefiles=define, usesocks=undef
use64bitint=define, use64bitall=define, uselongdouble=undef
usemymalloc=n, bincompat5005=undef
Compiler:
cc='cc', ccflags ='-fno-common -DPERL_DARWIN -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -I/opt/local/include',
optimize='-O3',
cppflags='-fno-common -DPERL_DARWIN -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -I/opt/local/include'
ccversion='', gccversion='4.2.1 Compatible Apple Clang 4.1 ((tags/Apple/clang-421.11.66))', gccosandvers=''
intsize=4, longsize=8, ptrsize=8, doublesize=8, byteorder=12345678
d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=16
ivtype='long', ivsize=8, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8
alignbytes=8, prototype=define
Linker and Libraries:
ld='env MACOSX_DEPLOYMENT_TARGET=10.3 cc', ldflags =' -fstack-protector -L/usr/local/lib -L/opt/local/lib'
libpth=/usr/local/lib /opt/local/lib /usr/lib
libs=-lgdbm -ldbm -ldl -lm -lutil -lc
perllibs=-ldl -lm -lutil -lc
libc=, so=dylib, useshrplib=false, libperl=libperl.a
gnulibc_version=''
Dynamic Linking:
dlsrc=dl_dlopen.xs, dlext=bundle, d_dlsymun=undef, ccdlflags=' '
cccdlflags=' ', lddlflags=' -bundle -undefined dynamic_lookup -L/usr/local/lib -L/opt/local/lib -fstack-protector'
Characteristics of this binary (from libperl):
Compile-time options: HAS_TIMES PERLIO_LAYERS PERL_DONT_CREATE_GVSV
PERL_MALLOC_WRAP PERL_PRESERVE_IVUV USE_64_BIT_ALL
USE_64_BIT_INT USE_LARGE_FILES USE_LOCALE
USE_LOCALE_COLLATE USE_LOCALE_CTYPE
USE_LOCALE_NUMERIC USE_PERLIO USE_PERL_ATOF
Built under darwin
Compiled at Jun 1 2013 23:48:00
%ENV:
PERLBREW_BASHRC_VERSION="0.63"
PERLBREW_HOME="/Users/jm/.perlbrew"
PERLBREW_MANPATH="/Users/jm/perl5/perlbrew/perls/perl-5.16.3/man"
PERLBREW_PATH="/Users/jm/perl5/perlbrew/bin:/Users/jm/perl5/perlbrew/perls/perl-5.16.3/bin"
PERLBREW_PERL="perl-5.16.3"
PERLBREW_ROOT="/Users/jm/perl5/perlbrew"
PERLBREW_VERSION="0.63"
#INC:
/Users/jm/perl5/perlbrew/perls/perl-5.16.3/lib/site_perl/5.16.3/darwin-2level
/Users/jm/perl5/perlbrew/perls/perl-5.16.3/lib/site_perl/5.16.3
/Users/jm/perl5/perlbrew/perls/perl-5.16.3/lib/5.16.3/darwin-2level
/Users/jm/perl5/perlbrew/perls/perl-5.16.3/lib/5.16.3
.
~/Downloads/javascript-v8-master$
the v8 is from Macports
~/Downloads/javascript-v8-master$ v8
V8 version 3.23.15 [console: dumb]
d8>
~/Downloads/javascript-v8-master$ port contents v8
Port v8 contains:
  /opt/local/bin/v8
  /opt/local/include/v8-debug.h
  /opt/local/include/v8-platform.h
  /opt/local/include/v8-profiler.h
  /opt/local/include/v8-testing.h
  /opt/local/include/v8.h
  /opt/local/include/v8config.h
  /opt/local/include/v8stdint.h
  /opt/local/lib/libv8.dylib
  /opt/local/share/doc/v8/AUTHORS
  /opt/local/share/doc/v8/ChangeLog
  /opt/local/share/doc/v8/LICENSE
  /opt/local/share/doc/v8/LICENSE.strongtalk
  /opt/local/share/doc/v8/LICENSE.v8
  /opt/local/share/doc/v8/LICENSE.valgrind
~/Downloads/javascript-v8-master$ 
Try version from this repo: https://github.com/olegwtf/javascript-v8
It should compile with your OS X compiler

Resources