Building JSCocoa for iPhone - JSValueRef Error

31 views
Skip to first unread message

Mithin

unread,
Feb 3, 2010, 12:18:49 PM2/3/10
to JSCocoa
Hi,

I am trying to build JSCocoa for iPhone by including the JSCocoa code
as part of my project. When I compile I see following errors

...JSCocoa/iPhone/../JSCocoaPrivateObject.h:48: error: expected
specifier-qualifier-list before 'JSValueRef'
...JSCocoa/iPhone/../JSCocoaPrivateObject.h:49: error: expected
specifier-qualifier-list before 'JSContextRef'

Any idea how I can fix it?

Thanks!

Patrick Geiller

unread,
Feb 3, 2010, 7:51:05 PM2/3/10
to jsc...@googlegroups.com

Looks like it's missing JavascriptCore — this is a private framework on the iPhone. Check out iPhoneTest2, it includes the JavascriptCore headers from OSX. The functions themselves are fetched at runtime by JavascriptCore-dlsym.m .

-Patrick

> --
> JSCocoa: http://inexdo.com/JSCocoa
> Source: http://github.com/parmanoir/jscocoa/tree/master
> Docs: http://code.google.com/p/jscocoa/
> Group: http://groups.google.com/group/jscocoa
> Unsubscribe: jscocoa+u...@googlegroups.com

Mithin

unread,
Feb 4, 2010, 12:17:03 AM2/4/10
to JSCocoa
Including the framework in the project and the headers in the code is
not fixing the errors.

Any idea what can be the issue?

-Mithin

Patrick Geiller

unread,
Feb 4, 2010, 9:44:05 AM2/4/10
to jsc...@googlegroups.com

Start from iPhoneTest2, not from a new project. The iPhone support only exists in there.

-Patrick

Steve Conover

unread,
Mar 1, 2011, 6:59:46 PM3/1/11
to Mithin, jsc...@googlegroups.com
For others who aren't satisfied until they understand what's going on
under the hood, the problem here appears to be that

#include "JavascriptCore.h"

needs to be in the .pch file.

-Steve

Steve Conover

unread,
Mar 1, 2011, 7:10:27 PM3/1/11
to jsc...@googlegroups.com
And make sure to do the following:

- In Project Settings
- Other Linker Flags -lxml2
- Header Search Paths /usr/include/libxml2

- Don't forget to add iPhone.bridgesupport under JSCocoa/iPhone.

- Note that main.m (unsurprisingly) is changed vs the default main.m.

-Steve

Reply all
Reply to author
Forward
0 new messages