small medium large xlarge

Back to: All Forums  PragPub
Generic-user-small
12 Aug 2009, 01:23
Jim Clark (4 posts)

A question for Ian about his Cucumber/iPhone article. I’m anxious to get his example working. However, I’m struggling a bit to piece everything together. I’m fairly new to xcode, obj-c and iphone dev. and like you this is mostly in my spare time.

I’ve downloaded your source, loaded in to xcode (using WordPress.xcodeproj) and have successfully built and run the Wordpress app in the simulator. It didn’t appear as if the build settings contained the Bromine settings, so I went to the Bromine site and did the following:

I added -DBROMINE_ENABLED=1 to OTHER_CFLAGS, apparently GCC_PREPROCESSOR_DEFINITIONS is the way to go, but adding “BROMINE_ENABLED” didn’t seem to work for me.

I added “/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS2.0.sdk/usr/include/libxml2” to header search paths.

I think I added the correct libxml2 file to my frameworks group.

Verified GCC_C_LANGUAGE_STANDARD is c99

Building now gives me the following errors:

Building target “WordPress” of project “WordPress” with configuration “Debug” — (3 errors)
	    cd /Users/jclark/dev/iphone/cucumber-article/app
    setenv MACOSX_DEPLOYMENT_TARGET 10.5
    setenv PATH "/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
    /Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/gcc-4.0 -arch i386 -isysroot /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator2.2.sdk -L/Users/jclark/dev/iphone/cucumber-article/app/build/Debug-iphonesimulator -F/Users/jclark/dev/iphone/cucumber-article/app/build/Debug-iphonesimulator -filelist /Users/jclark/dev/iphone/cucumber-article/app/build/WordPress.build/Debug-iphonesimulator/WordPress.build/Objects-normal/i386/WordPress.LinkFileList -mmacosx-version-min=10.5 -framework Foundation -framework UIKit -framework CoreGraphics -framework SystemConfiguration -framework QuartzCore -o /Users/jclark/dev/iphone/cucumber-article/app/build/Debug-iphonesimulator/WordPress.app/WordPress
Undefined symbols:
  ".objc_class_name_HTTPServer", referenced from:
      literal-pointer@__OBJC@__cls_refs@HTTPServer in WordPressAppDelegate.o
  ".objc_class_name_MyHTTPConnection", referenced from:
      literal-pointer@__OBJC@__cls_refs@MyHTTPConnection in WordPressAppDelegate.o
  ".objc_class_name_ScriptRunner", referenced from:
      literal-pointer@__OBJC@__cls_refs@ScriptRunner in WordPressAppDelegate.o
ld: symbol(s) not found
collect2: ld returned 1 exit status

Build failed (3 errors)

Is there something else I need to do to get the HTTPServer built and incorporated in to the app? I’ve successfully built the HTTPServer project, however, I’m not sure how to tie that in to the WordPress app.

Any help you can provide would be greatly appreciated.

Thanks, Jim

Mr_sketchy_pragsmall
12 Aug 2009, 17:23
Ian Dees (212 posts)

Hi, Jim.

The original WordPress project file was targeted to iPhone SDK 2.0, and that setting can cause strange results on SDK 2.2.1 development machines. I’ve changed the project frameworks and include paths to use 2.2.1 instead, and it should now build correctly on a fresh 2.2.1 machine, with no extra manual steps needed. The latest code can be downloaded from http://bitbucket.org/undees/cucumber-article. (Bromine doesn’t yet target SDK 3.0 or 3.1, but they’re working on it.)

HTTPServer gets built as part of the “Bromine” target in the WordPress app; that extra .xcodeproj directory is just the sample one that came with the library.

Sincerely,

Ian

Generic-user-small
13 Aug 2009, 03:10
Jim Clark (4 posts)

Thanks for the quick reply Ian. I appreciate the help!

I started with a fresh clone of the project, but I am having the same build failure as above. I noticed the BROMINE_ENABLED flag and the header search path setting in the project.pbxproj file. But for some reason, my xcode (3.1.3) isn’t picking up the settings. I’ve added them manually but I must be missing something since it’s still not building.

Thanks, Jim

Mr_sketchy_pragsmall
14 Aug 2009, 04:14
Ian Dees (212 posts)

Hi, Jim.

Sorry about this. It looks like we’re both using the same version of Xcode. Which SDKs are installed?

We may be able to get this working by poking at the project file a bit. Is the @BROMINE_ENABLED@ setting already in the target-specific settings for just the Bromine target (right-click on Bromine and choose Get Info)? If all else fails, it may be worth doing the duct-tape approach of just @#define@-ing @BROMINE_ENABLED@ in the source code for now, just to get past this hurdle.

If it gets past compilation and still gives linker errors, it’s worth checking to see if the @ScriptRunner@ object and its dependencies are being compiled. When you highlight all the files under the Bromine target, do a Get Info, and look at the Target tab, are they all set to build for the Bromine target only?

If it’s still failing after these steps, I’d like to try an iChat screen-sharing session. Drop me a line (undees at gmail) and let me know what times are good for you during the next few days.

Sincerely,

Ian

Generic-user-small
18 Aug 2009, 03:39
Jim Clark (4 posts)

Hi Ian,

I believe I’m over this hurdle :) This is probably my lack of xcode experience. I originally was just trying to “build and go” on the Wordpress app. Once I did a build on the Bromine target, THEN did the “build and go” on the app, my app deployed and the app was able to receive http request. My debug window reported the following, while this doesn’t look like “success”, I’m making progress.

2009-08-17 23:26:39.624 WordPress[13554:20b] <plist version="1.0">  <dict>    <key>command</key>    <string>simulateTouch</string>    <key>viewXPath</key>    <string>//UIButton[currentTitle="Home"]</string>  </dict></plist>
=== simulateTouch
    viewXPath:
        //UIButton[currentTitle="Home"]
### 'viewXPath' for command 'simulateTouch' selected 0 nodes, where exactly 1 is required.
2009-08-17 23:26:51.074 WordPress[13554:20b] processing post data: 178
2009-08-17 23:26:51.075 WordPress[13554:20b] <plist version="1.0">  <dict>    <key>command</key>    <string>simulateTouch</string>    <key>viewXPath</key>    <string>//UIButton[currentTitle="Home"]</string>  </dict></plist>
=== simulateTouch
    viewXPath:
        //UIButton[currentTitle="Home"]
### 'viewXPath' for command 'simulateTouch' selected 0 nodes, where exactly 1 is required.

BTW, the issues w/ the processor directives had to do w/ me setting the directives at the app level vs. target level.

Thanks again for the help, Jim

Mr_sketchy_pragsmall
25 Aug 2009, 16:15
Ian Dees (212 posts)

Hi, Jim.

Yup, definitely good news that you’ve got touch event requests in the log now. The reason it can’t find the buttons it’s looking for is probably that it can’t log into the blog.

The test script checked into the article’s repository has placeholders for the blog name, user name, and password. They’ll need to be replaced with live WordPress credentials for a new blog (not an existing blog; the test script erases posts!).

Good luck!

–Ian

You must be logged in to comment