Built a successful external?

Are you developing an External using the LiveCode Externals SDK?

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
dmash
Posts: 9
Joined: Thu Nov 08, 2007 5:25 pm

Built a successful external?

Post by dmash » Fri Jun 27, 2008 12:56 am

Has anyone out there (outside of the company) actually created an extension for Revolution? I tried following the tutorial with no luck and haven't been able to get real technical support from RunRev without paying for consulting/support. I don't think a registered user should have to pay for support when the step-by-step tutorial doesn't work as advertised.

The tutorial is missing information and while admittedly it is a difficult proposition to create a single tutorial for both Mac and Windows with many OS and Revolution version changes since its creation, it seems to be full of errors and is of little help in actually getting started - Even the most basic project doesn't work even if you follow the steps exactly as written.

Part of the allure of the product is the promise of extensibility, but I wonder if it really is. I would really like to hear from any user that has successfully created an extension!

Thanks,
David

Lynn P.
Posts: 79
Joined: Sun Apr 09, 2006 1:09 pm

Post by Lynn P. » Fri Jun 27, 2008 1:51 am

I didn't have any luck either. :(
I asked for help here also, but no one answered. Hope you get some answers. It seemed to work for some and not for others. It's been a while since I've tried it.

trevordevore
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 1005
Joined: Sat Apr 08, 2006 3:06 pm
Location: Overland Park, Kansas
Contact:

Post by trevordevore » Fri Jun 27, 2008 2:55 am

Hi David,

I use quite a few externals (OS X and Windows) that we have created in house and that use the SDK that Mark Waddingham published in the newsletter articles. What is it you are trying to do and where to things go wrong?
Trevor DeVore
ScreenSteps - https://www.screensteps.com

LiveCode Repos - https://github.com/search?q=user%3Atrevordevore+topic:livecode
LiveCode Builder Repos - https://github.com/search?q=user%3Atrevordevore+topic:livecode-builder

dmash
Posts: 9
Joined: Thu Nov 08, 2007 5:25 pm

WHat didn't work

Post by dmash » Fri Jun 27, 2008 7:50 pm

I was just trying to follow their tutorial to build an external, basically I followed the steps exactly, compiled the external using xCode and that worked fine, but the liking to a stack didn't work. Calling the external gives an error. My guess is the path to the external is incorrect from xCode, but I couldn't get a helpful response without agreeing to pay for a support ticket...

trevordevore
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 1005
Joined: Sat Apr 08, 2006 3:06 pm
Location: Overland Park, Kansas
Contact:

Post by trevordevore » Fri Jun 27, 2008 8:05 pm

You may be running into the XCode bug that Mark mentions in article 1:

http://www.runrev.com/newsletter/novemb ... etter5.php
Now choose the Debug configuration and click Build and when it has finished click Debug. (The previous two steps shouldn't be necessary, but there seems to be a glitch in XCode that prevents it picking up the correct settings for launching the debug executable if you have only ever built a Debug variant of a project - from now on you won't need to build a release variant before a debug one in this project).
Did you build a release version of the external first and then try the debug version?

Basically the issue is that there is an environmental variable that XCode is supposed to pass to the Revolution engine when it launches. This environmental variable helps Revolution locate the debug build of the external is located in. When the variable does not get set then Revolution fails to load the external, thus all of your calls to the external fail.

Check out the stack script of the test stack and you should see the code that loads the external. If you want to know if the external loaded properly check the 'externalPackages' property of the stack that has the 'externals' property set.
Trevor DeVore
ScreenSteps - https://www.screensteps.com

LiveCode Repos - https://github.com/search?q=user%3Atrevordevore+topic:livecode
LiveCode Builder Repos - https://github.com/search?q=user%3Atrevordevore+topic:livecode-builder

n.allan
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 153
Joined: Mon Mar 12, 2007 12:06 pm

Post by n.allan » Fri Jun 27, 2008 8:06 pm

Yes I have created 2 externals for winxp so far using Visual C++ 2008 express edition.

One is used to send mouse clicks outside the rev stack and the other is a beast :) It wraps a C++ SDK for features that I think would be cool in rev. I will post about it here in a week or so once I have all the big bugs ironed out.

I can show you the code for the clicker external if you think it would help. I can comment it up good and proper to make things as clear as possible.

I know what you mean about the newsletter being VERY particular. I looked months ago, tried, failed, then gave up, then tried again, failed again, gave up, etc...

The newletter is intended for people who know C++, otherwise you are not equipped to create an external. C++ being C++ is very powerfull and can read or write areas of memory that can crash your computer no problem. Thus if you put a space or a capital letter in the wrong place, your code will not compile. Its a polar opposite to rev scripting language. :)

My advice to you is. Keep at it. Get a book on C++ and NOT Visual C++ like I did (that will really confuse you!) One day you will just look at the code and understand how things work.

dmash
Posts: 9
Joined: Thu Nov 08, 2007 5:25 pm

Post by dmash » Sun Jun 29, 2008 7:58 pm

Thanks, Trevor, I'll try your suggestions!
David

ukimiku
Posts: 101
Joined: Thu Oct 22, 2009 10:45 am

Re: Built a successful external?

Post by ukimiku » Sat Dec 05, 2009 6:15 pm

Yes, tried it this morning on Windows Vista, and it worked like a charm. I used the SDK from the article and followed the steps outlined there to the letter. Except I had to use Visual C++ Express 2008 from Microsoft. Since the article said one should use the 2005 edition, I tried to download that, but had to realize that it wasn't available for download any more. So I gave the 2008 version a try. This version always complains about the files being "old", but nevertheless loads and compiles them fine.

The only caveat I encountered was after I had finished the Debug state of the "Hello, %s" program. Then I had to put the compiled .dll file somewhere - but where? My first attempt was putting the dll into the folder in which the calling stack resided, but that failed. I then reread the article and found that I had to create an "Externals" folder within the standard document folder of my system, and put the dll into that folder. Then the Release version of the dll worked, too.

I am rather excited about being able to extend Runrev now. I only have to learn c++ :) But that has been on my list for a while anyhow, so now seems like a good time to actually do that. And no, you don't have to know the least about C++ to make the example dll from the tutorial work. In fact, I consider the article to be exceptionally clear and thorough enough even for C++ novices who only know how to download the Visual C++ from MS and load a file from there, copy a few snippets of code and paste them into the editor.

Regards,

InfoCentral
Posts: 90
Joined: Thu Feb 11, 2010 5:14 am
Location: Los Angeles

Re: Built a successful external?

Post by InfoCentral » Thu Feb 25, 2010 11:38 pm

Do you have to use C++ or can I use Python? I would prefer keeping the learning curve down as much as possible.
"I am an Apple user and whatever they tell me I know it is for my own good and for the good of the collective..."

WaltBrown
Posts: 466
Joined: Mon May 11, 2009 9:12 pm
Location: NE USA

Re: Built a successful external?

Post by WaltBrown » Thu Jun 03, 2010 5:23 pm

I have tried moving the dll and associated files around, both External Article 1 stacks have empty in $EXTERNAL_LIBRARY and the externalFunctions. Is this a VS9 issue?

Thanks, Walt
Walt Brown
Omnis traductor traditor

RRobert
Posts: 151
Joined: Sat Feb 28, 2009 8:20 pm

Re: Built a successful external?

Post by RRobert » Thu Jun 03, 2010 10:54 pm

InfoCentral wrote:Do you have to use C++ or can I use Python? I would prefer keeping the learning curve down as much as possible.
C or C++

Robert

WaltBrown
Posts: 466
Joined: Mon May 11, 2009 9:12 pm
Location: NE USA

Re: Built a successful external?

Post by WaltBrown » Thu Jun 03, 2010 11:43 pm

Tried again for the seventh time. Cleaned out everything, redownloaded and executed the newsletter instructions and Externals Creator afresh, got two stacks, myNameTest and myNameExternalWrapper, still no go. Neither stack lists any external references. When I manually add an external reference to myName.dll to either stack, it still does not find "rnaHellowWorld".

Is there a way to turn on debugging for the DLL so I can see the step where libExternals creates the two test stacks? VS9 wants an executable. It offers regsrv32 as an executable, but that cannot be used because it has no symbol table and the debugger exits.

regsvr32 seems to think a module is not registered. The module cannot be registered manually either - the external.c or .h file do not indicate the apparently missing dll register entry point. Is there any other source file included that I can debug the dll entry point and registration?

Thanks,
Walt
Walt Brown
Omnis traductor traditor

WaltBrown
Posts: 466
Joined: Mon May 11, 2009 9:12 pm
Location: NE USA

Re: Built a successful external?

Post by WaltBrown » Fri Jun 04, 2010 4:13 am

Nope, I thought I had fixed it, something else fixed it and I cannot reproduce the success.
Walt Brown
Omnis traductor traditor

jimwitte
Posts: 5
Joined: Thu Mar 10, 2011 6:24 am

Re: Built a successful external?

Post by jimwitte » Thu Mar 10, 2011 5:54 pm

I'm using xCode, and got an error about the 10.2.8 SDK not being found. I reset the SDK to 10.4u in the preferences, as well as setting the GCC version to 4.0 for the release target (check this for all targets), and it worked.

I assume you can just delete the PPC target all together, which would be easier. There is also a warning about a missing end-of-line in the .exports file, and another warning about some compiler flag "-mlong-branch" which I have NO idea of how to change - or what to change it to. But it's just a warning, so I'll leave it..

mwieder
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3581
Joined: Mon Jan 22, 2007 7:36 am
Location: Berkeley, CA, US
Contact:

Re: Built a successful external?

Post by mwieder » Thu Mar 10, 2011 11:01 pm

I assume you can just delete the PPC target all together
That's my approach. I'm not targetting non-intel macs at this point, so I just removed that target and all's well. Note: if you really do need the OSX 10.2.8 sdk files, they're on Apple's site, but you have to dig for them. It's nowhere obvious and a big download.

Post Reply

Return to “Building Externals”