How to build Hello World example with Livecode 5.0.2
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
How to build Hello World example with Livecode 5.0.2
I attempted to build the "hello world" example from the newsletter articles in Livecode 5.0.2 on Windows 7 using Microsoft Visual C++ 2010 Express. Quite a few steps seem to have changed from the time the article was written. I thought it would be helpful to document the steps I needed to take to make it work.
Downloaded the sample files, followed the directions in the tutorial here:
http://revmedia.runrev.com/developers/l ... ls-part-1/
"External Creator V3.rev" still works, but opening "rnahello.vcproj" generates messages saying the project needs to be converted. I did that. Then I added the initial source code examples. The #include statements in the tutorial are blank in the tutorial, so I used the following:
#include <cstdlib>
#include <cstdio>
#include <cstring>
I corrected this:
#include <revolution/external.h>
to this:
#include <C:\Users\zigraphix\Documents\livecode\ExternalsEnvironmentV3\libexternal\src\external.h>
I also needed to make changes in the environment in VisualC++ to launch Livecode, rather than trying to launch the dll directly:
Clicked the Debug green triangle, got this:
Clicked yes. Livecode launched. Made edits to rnahellotest as described in tutorial. Also needed to manually add dll to stack:
Once I had completed these steps, I was able to put some text in the "Name" field and click the button, and get a popup with "Hello, *" where * is the content typed into the Name field.
I hope this helps someone.
Downloaded the sample files, followed the directions in the tutorial here:
http://revmedia.runrev.com/developers/l ... ls-part-1/
"External Creator V3.rev" still works, but opening "rnahello.vcproj" generates messages saying the project needs to be converted. I did that. Then I added the initial source code examples. The #include statements in the tutorial are blank in the tutorial, so I used the following:
#include <cstdlib>
#include <cstdio>
#include <cstring>
I corrected this:
#include <revolution/external.h>
to this:
#include <C:\Users\zigraphix\Documents\livecode\ExternalsEnvironmentV3\libexternal\src\external.h>
I also needed to make changes in the environment in VisualC++ to launch Livecode, rather than trying to launch the dll directly:
Clicked the Debug green triangle, got this:
Clicked yes. Livecode launched. Made edits to rnahellotest as described in tutorial. Also needed to manually add dll to stack:
Once I had completed these steps, I was able to put some text in the "Name" field and click the button, and get a popup with "Hello, *" where * is the content typed into the Name field.
I hope this helps someone.
Re: How to build Hello World example with Livecode 5.0.2
Hi and thanks (isn't about time that RunRev update the article to LiveCode 4.6 ?)
When you say:
Can you explain ?
Thanks
Trevix
When you say:
In the picture it is hard to see what the "command argument" has to points to.....I also needed to make changes in the environment in VisualC++ to launch Livecode, rather than trying to launch the dll directly:..
Can you explain ?
Thanks
Trevix
Trevix
OSX 14.3.1 xCode 15 LC 10 DP7 iOS 15> Android 7>
OSX 14.3.1 xCode 15 LC 10 DP7 iOS 15> Android 7>
Re: How to build Hello World example with Livecode 5.0.2
Also...when I press the Debug green triangle, I've got this error (translated from italian) from Visual Express C++ 2010:
Impossible to start the application 'C:\Documents and Settings\userName\....\ExternalsEnvironmentV3\_build\Debug\libexternal.lib'
The binary format of the file is not reconized or supported.
I'm using LiveCode 4.6.4
Thansk
Trevix
Impossible to start the application 'C:\Documents and Settings\userName\....\ExternalsEnvironmentV3\_build\Debug\libexternal.lib'
The binary format of the file is not reconized or supported.
I'm using LiveCode 4.6.4
Thansk
Trevix
Trevix
OSX 14.3.1 xCode 15 LC 10 DP7 iOS 15> Android 7>
OSX 14.3.1 xCode 15 LC 10 DP7 iOS 15> Android 7>
Re: How to build Hello World example with Livecode 5.0.2
You can click the picture to get a full-size view. I think this is the cause of your other error, too. When you click the Debug triangle, Visual C++ will try to launch a program. If you don't tell it otherwise, it will try to launch your compiled dll or the library or whatever directly, which won't work. You need to tell it to launch Livecode.trevix wrote:Hi and thanks (isn't about time that RunRev update the article to LiveCode 4.6 ?)
When you say:In the picture it is hard to see what the "command argument" has to points to.....I also needed to make changes in the environment in VisualC++ to launch Livecode, rather than trying to launch the dll directly:..
Can you explain ?
Thanks
Trevix
-
- VIP Livecode Opensource Backer
- Posts: 3581
- Joined: Mon Jan 22, 2007 7:36 am
- Location: Berkeley, CA, US
- Contact:
Re: How to build Hello World example with Livecode 5.0.2
Elizabeth-
Rather than hardcodethe path to the external.h header file, it's probably better to edit the project settings and add the path to the folder ("C:\Users\zigraphix\Documents\livecode\ExternalsEnvironmentV3\libexternal") to the place to look for include files (it's not in front of me right now, so I don't have the exact name). That way the project is more portable, or at least the source files are.
Rather than hardcodethe path to the external.h header file, it's probably better to edit the project settings and add the path to the folder ("C:\Users\zigraphix\Documents\livecode\ExternalsEnvironmentV3\libexternal") to the place to look for include files (it's not in front of me right now, so I don't have the exact name). That way the project is more portable, or at least the source files are.
-
- VIP Livecode Opensource Backer
- Posts: 3581
- Joined: Mon Jan 22, 2007 7:36 am
- Location: Berkeley, CA, US
- Contact:
Re: How to build Hello World example with Livecode 5.0.2
...and yes... I agree the article on the web should be updated/corrected.
Re: How to build Hello World example with Livecode 5.0.2
Thanks. I've never used the Visual series of IDEs before, so I really am just feeling my way around.
-
- VIP Livecode Opensource Backer
- Posts: 3581
- Joined: Mon Jan 22, 2007 7:36 am
- Location: Berkeley, CA, US
- Contact:
Re: How to build Hello World example with Livecode 5.0.2
Yeah - it's a bit... er... quirky. Nothing's easy to find. Basically, once I got a project that created a proper external dll I saved off a generic copy of it and use that to start any new external project. Otherwise I have to try to fiddle with things and find out what settings need to be tweaked and it's a pita.
Re: How to build Hello World example with Livecode 5.0.2
Chances are that libExternal is set as the startup project. (it will be the hilited IE dark entry in the list on the left) To fix this, right click on your project, and choose set as startup project.
And ty ty ty edmalton! Got it to work thx to your direction.
And ty ty ty edmalton! Got it to work thx to your direction.
trevix wrote:Also...when I press the Debug green triangle, I've got this error (translated from italian) from Visual Express C++ 2010:
Impossible to start the application 'C:\Documents and Settings\userName\....\ExternalsEnvironmentV3\_build\Debug\libexternal.lib'
The binary format of the file is not reconized or supported.
I'm using LiveCode 4.6.4
Thansk
Trevix