Modify

Opened 16 years ago

Closed 16 years ago

#2325 closed defect (fixed)

webkit-image compilation under MacOS X

Reported by: axel.roeslein@… Owned by: team
Priority: major Milestone:
Component: Core Version:
Keywords: Cc:

Description

I tried to use the wsmplugin with josm running under MacOS X (Java 1.5 or Java 1.6).
This doesn't work properly with Yahoo images because of a missing "webkit-image"
installation.

No I tried to build this myself. I got Apple's Developer Tools plus a fresh download of Qt 4.5

This run's fine:

moc webkit-image.cpp >webkit-image.h

This doesn't work though:

g++ webkit-image.cpp -o webkit-image -lQtCore -lQtWebKit -lQtGui -O2 \
-L/Developer/Applications/Qt/QtCreator.app/Contents/Frameworks

Undefined symbols:

"QNetworkAccessManager::setProxy(QNetworkProxy const&)", referenced from:

_main in ccIMD9Hd.o

"QNetworkProxy::setType(QNetworkProxy::ProxyType)", referenced from:

_main in ccIMD9Hd.o

"QNetworkProxy::~QNetworkProxy()", referenced from:

_main in ccIMD9Hd.o
_main in ccIMD9Hd.o

"QNetworkProxy::setHostName(QString const&)", referenced from:

_main in ccIMD9Hd.o

"QNetworkProxy::setPort(unsigned short)", referenced from:

_main in ccIMD9Hd.o

"QNetworkProxy::QNetworkProxy()", referenced from:

_main in ccIMD9Hd.o

ld: symbol(s) not found
collect2: ld returned 1 exit status

What else do I need?

I managed to create an executable with the QtCreator but when installed
this has other problems. josm-tested.jar doesn't work at all, josm-latest
will use my "webkit-image" but runs anå endless loop, spitting out
in == null! messages.

Thanks for any guidance
Axel

Attachments (0)

Change History (11)

comment:1 by stoecker, 16 years ago

Try adding -lQtNetwork to add the required library.

comment:2 by stoecker, 16 years ago

BTW http://www.dstoecker.eu/webkit-image is a macos-version without the QT libs which you need to install yourself.

comment:3 by axel.roeslein@…, 16 years ago

Fine, one step further

g++ webkit-image.cpp -o webkit-image -lQtCore -lQtWebKit -lQtGui -lQtNetwork -O2 \
  -L/Developer/Applications/Qt/QtCreator.app/Contents/Frameworks

now compiles fine.

The dynamic libraries aren't found at runtime though.

~/work/josm > ./webkit-image "file:////Users/ar/.josm/plugins/wmsplugin/ymap.html?bbox=10.00,53.52,10.01,53.53&srs=EPSG:4326&width=500&height=500"
dyld: Library not loaded: @executable_path/../Frameworks/libQtCore.dylib
  Referenced from: /Users/ar/work/josm/./webkit-image
  Reason: image not found
Trace/BPT trap
~/work/josm > otool -L webkit-image
webkit-image:
        @executable_path/../Frameworks/libQtCore.dylib (compatibility version 4.5.0, current version 4.5.0)
        @executable_path/../Frameworks/libQtWebKit.dylib (compatibility version 4.5.0, current version 4.5.0)
        @executable_path/../Frameworks/libQtGui.dylib (compatibility version 4.5.0, current version 4.5.0)
        @executable_path/../Frameworks/libQtNetwork.dylib (compatibility version 4.5.0, current version 4.5.0)
        /usr/lib/libstdc++.6.dylib (compatibility version 7.0.0, current version 7.4.0)
        /usr/lib/libgcc_s.1.dylib (compatibility version 1.0.0, current version 1.0.0)
        /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 111.1.3)

I wouldn't like to setup those @executable_path/../Frameworks files.
Is there a way to statically link?

OTOH: The webkit-image build with QtCreator works and uses static libs.
I'd just prefer the building by a script which should make it easier for
others to build, debug their own.

Regards,

Axel

comment:4 by stoecker, 16 years ago

Option -static?

comment:5 by anonymous, 16 years ago

unfortunately not

FATAL:incompatible feature used: section type non_lazy_symbol_pointers (must specify "-dynamic" to be used)

comment:6 by axel.roeslein@…, 16 years ago

Hello

from reading the Qt documentation I learned that I'd need to recompile Qt itself
in order to build a statically linked app.

I guess this is all overkill. webkit-image would have a full load of libraries for
a seemingly simple task.

I would like to reimplement webkit-image with Perl, Ruby, Java or even AppleScript.
The current problem is just my poor knowledge of C++ and the used libraries.

If anybody could give me functional desription I'd port it to another base.

Regards,

Axel

comment:7 by stoecker, 16 years ago

Well, that's easy. You need to make a tool which downloads a webpage and supplies it as picture of correct size. You need a HTML rendering engine supporting complex JavaScript for this. That's why I choose webkit, as this is available on the major plattforms.

in reply to:  7 comment:8 by axel.roeslein@…, 16 years ago

Understood.

It looks to me as if just the ObjC binding of WebKit is a viable solution.
WebKit could be assumed instaleld by default on any Mac, Qt is currently
an extra installation, right?

Java would fit better but I haven't found a good binding yet. Anybody?

comment:9 by axel.roeslein@…, 16 years ago

I have trouble in understanding the necessary procedure.

A sample request sent out from a browser

ymap.html?bbox=...&width=500&height=500

will give me back e.g. 24 JPEG images, each 256x265 Pixel.
The included JavaScript code somehow reduces the number of displayed images.

In ~/.josm/plugins/wmsplugin/cache I find 9 images, each 400x672 Pixel

Would webkit-image just extract every JPEG from the webkit view and wmsplugins
cares for the rest? Do I need to use the JavaScript set window use?

comment:10 by stoecker, 16 years ago

Yes, you need to output the JavaScript window. This is reduced to the dimensions of the requested geographic coordinates.

comment:11 by stoecker, 16 years ago

Resolution: fixed
Status: newclosed

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain team.
as The resolution will be set.
The resolution will be deleted. Next status will be 'reopened'.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.