Real Software Forums

The forum for Real Studio and other Real Software products.
[ REAL Software Website | Board Index ]
It is currently Thu Oct 19, 2017 6:33 pm
xojo

All times are UTC - 5 hours




Post new topic Reply to topic  [ 9 posts ] 
Author Message
 Post subject: XCode and Plugin
PostPosted: Tue Nov 27, 2007 12:12 pm 
Offline
User avatar

Joined: Fri Feb 16, 2007 2:20 pm
Posts: 45
Location: Paris,France
Hi all !

I am a newbie in Plug-in but I really want to learn. I work on a macbook with XCode.
I tried one old example found on the web; I wrote a simple function "Multiplier" . I wrote it in the folder "Includes" and named it Projet_2_XCode_ReallBasic.cpp"

-----------------------------------------------------------------------------------

#include "rb_plugin.h"
static int Multiplier(int x,int y)
{
return x*y;
}

REALmethodDefinition foiDefn = {
(REALproc)Multiplier,REALnoImplementation,"Multiplier(x as integer,y as integer) as integer"
};

void PluginEntry() {
REALRegisterMethod(foiDefn);
}
-----------------------------------------------------------------------------------

When I build, Igot this message from XCode :
Building target “Projet_2_XCode_ReallBasic” of project “Projet_2_XCode_ReallBasic” with configuration “Development” — (1 error, 1 warning)

warning: 'REALRegisterMethod' is deprecated (declared at /Volumes/Documents/Projets RealBasic/Projet Plug-ins/Projet_2_XCode_ReallBasic/Includes/rb_plugin.h:627)

error: cannot convert 'REALmethodDefinition' to 'REALmethodDefinition*' for argument '1' to 'void REALRegisterMethod(REALmethodDefinition*)'

Build failed (1 error, 1 warning)


Is there somebody to help me ?

Thank you in advance !

Géraud
:shock: :D

http://perso.orange.fr/hypatiasoft


Top
 Profile  
Reply with quote  
 Post subject: Re: XCode and Plugin
PostPosted: Wed Nov 28, 2007 5:01 pm 
Offline
User avatar

Joined: Wed May 10, 2006 2:42 pm
Posts: 2985
Location: Germany
Géraud wrote:
void PluginEntry() {
REALRegisterMethod(foiDefn);
}


There is a & missing in the line.

Your homework: Find out where the & is missing :-)

Gruß
Christian

_________________
See you in Orlando, Florida for Real World 2013
More details and registration here:
http://www.realsoftware.com/community/realworld.php


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Thu Nov 29, 2007 11:18 am 
Offline
User avatar

Joined: Fri Feb 16, 2007 2:20 pm
Posts: 45
Location: Paris,France
Thank you Christian.

Homework done.

I tried this :

#include "rb_plugin.h"
static int Multiplier(int x,int y)
{
return x*y;
}

REALmethodDefinition foiDefn = {
(REALproc)Multiplier,REALnoImplementation,"Multiplier(x as integer,y as integer) as integer"
};

void PluginEntry() {
REALRegisterMethod(&foiDefn);
}

And I have this message :

warning: 'REALRegisterMethod' is deprecated (declared at /Volumes/Documents/Projets RealBasic/Projet Plug-ins/Projet_2_XCode_ReallBasic/Includes/rb_plugin.h:627)

Does "Deprecated" mean that there is a new function doing the same thing ?

Thank in advance.

Géraud :wink:


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Thu Nov 29, 2007 4:34 pm 
Offline
User avatar

Joined: Wed May 10, 2006 2:42 pm
Posts: 2985
Location: Germany
You can use REALRegisterMethod and ignore that warning.
Over the long time you may prefer to bundle all your functions into a module.

Gruß
Christian

_________________
See you in Orlando, Florida for Real World 2013
More details and registration here:
http://www.realsoftware.com/community/realworld.php


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Thu Nov 29, 2007 5:14 pm 
Offline

Joined: Thu Sep 28, 2006 12:29 am
Posts: 154
Location: Austin, TX
Moved to the plugins section.

First of all, I wouldn't recommend that you ignore that warning. If that function is marked as deprecated, it will probably be removed soon, forcing you to rewrite part of your plugin.

Instead, like Christian suggested, try registering a module and putting your method inside of that. You can see this in action by taking a look at the "Complete Module" example in the SDK,


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Tue Dec 04, 2007 6:00 am 
Offline
User avatar

Joined: Fri Feb 16, 2007 2:20 pm
Posts: 45
Location: Paris,France
:( Hi All,

I am desperate !
I tried "Complete module" given by RealBasic in PlugIn SDK and I can't compile it in XCode without errors (5 errors 7 warnings)
Tell me what I'm doing wrong !

RealSoftware, please, give examples that works !!!

I really want to learn how to make PlugIn !

Géraud (http://perso.orange.fr/hypatiasoft MacBook OS 10.4.10)


here is the result :


Plugins SDK/Examples/Complete Module/CompleteModule.cpp: In function 'void PlayWithCat(REALstringStruct*)':
Plugins SDK/Examples/Complete Module/CompleteModule.cpp:135: warning: 'REALMessageBox' is deprecated (declared at /Volumes/Documents/Projets RealBasic/Projet Plug-ins/MonPremierPlugIn/Includes/rb_plugin.h:738)
Plugins SDK/Examples/Complete Module/CompleteModule.cpp:135: warning: 'REALMessageBox' is deprecated (declared at /Volumes/Documents/Projets RealBasic/Projet Plug-ins/MonPremierPlugIn/Includes/rb_plugin.h:738)
Plugins SDK/Examples/Complete Module/CompleteModule.cpp: In function 'REALstringStruct* PlayWithMoose()':
Plugins SDK/Examples/Complete Module/CompleteModule.cpp:145: error: '::GetTickCount' has not been declared
Plugins SDK/Examples/Complete Module/CompleteModule.cpp: In function 'void DanceWithWolves(unsigned char, REALstringStruct*)':
Plugins SDK/Examples/Complete Module/CompleteModule.cpp:161: warning: 'REALMessageBox' is deprecated (declared at /Volumes/Documents/Projets RealBasic/Projet Plug-ins/MonPremierPlugIn/Includes/rb_plugin.h:738)
Plugins SDK/Examples/Complete Module/CompleteModule.cpp:161: warning: 'REALMessageBox' is deprecated (declared at /Volumes/Documents/Projets RealBasic/Projet Plug-ins/MonPremierPlugIn/Includes/rb_plugin.h:738)
Plugins SDK/Examples/Complete Module/CompleteModule.cpp: In function 'REALstringStruct* FolderItemExtensionGetter(REALobjectStruct*)':
Plugins SDK/Examples/Complete Module/CompleteModule.cpp:224: error: '::OutputDebugStr' has not been declared
Plugins SDK/Examples/Complete Module/CompleteModule.cpp:230: error: '::OutputDebugStr' has not been declared
Plugins SDK/Examples/Complete Module/CompleteModule.cpp:237: error: '::OutputDebugStr' has not been declared
Plugins SDK/Examples/Complete Module/CompleteModule.cpp:249: error: '::OutputDebugStr' has not been declared
Plugins SDK/Examples/Complete Module/CompleteModule.cpp: In function 'void PluginEntry()':
Plugins SDK/Examples/Complete Module/CompleteModule.cpp:295: warning: comparison between signed and unsigned integer expressions
Plugins SDK/Examples/Complete Module/CompleteModule.cpp:296: warning: 'REALRegisterMethod' is deprecated (declared at /Volumes/Documents/Projets RealBasic/Projet Plug-ins/MonPremierPlugIn/Includes/rb_plugin.h:627)
Plugins SDK/Examples/Complete Module/CompleteModule.cpp:296: warning: 'REALRegisterMethod' is deprecated (declared at /Volumes/Documents/Projets RealBasic/Projet Plug-ins/MonPremierPlugIn/Includes/rb_plugin.h:627)
Plugins SDK/Examples/Complete Module/CompleteModule.cpp:135: warning: 'REALMessageBox' is deprecated (declared at /Volumes/Documents/Projets RealBasic/Projet Plug-ins/MonPremierPlugIn/Includes/rb_plugin.h:738)
Plugins SDK/Examples/Complete Module/CompleteModule.cpp:135: warning: 'REALMessageBox' is deprecated (declared at /Volumes/Documents/Projets RealBasic/Projet Plug-ins/MonPremierPlugIn/Includes/rb_plugin.h:738)
Plugins SDK/Examples/Complete Module/CompleteModule.cpp:145: error: '::GetTickCount' has not been declared
Plugins SDK/Examples/Complete Module/CompleteModule.cpp:161: warning: 'REALMessageBox' is deprecated (declared at /Volumes/Documents/Projets RealBasic/Projet Plug-ins/MonPremierPlugIn/Includes/rb_plugin.h:738)
Plugins SDK/Examples/Complete Module/CompleteModule.cpp:161: warning: 'REALMessageBox' is deprecated (declared at /Volumes/Documents/Projets RealBasic/Projet Plug-ins/MonPremierPlugIn/Includes/rb_plugin.h:738)
Plugins SDK/Examples/Complete Module/CompleteModule.cpp:224: error: '::OutputDebugStr' has not been declared
Plugins SDK/Examples/Complete Module/CompleteModule.cpp:230: error: '::OutputDebugStr' has not been declared
Plugins SDK/Examples/Complete Module/CompleteModule.cpp:237: error: '::OutputDebugStr' has not been declared
Plugins SDK/Examples/Complete Module/CompleteModule.cpp:249: error: '::OutputDebugStr' has not been declared
Plugins SDK/Examples/Complete Module/CompleteModule.cpp:295: warning: comparison between signed and unsigned integer expressions
Plugins SDK/Examples/Complete Module/CompleteModule.cpp:296: warning: 'REALRegisterMethod' is deprecated (declared at /Volumes/Documents/Projets RealBasic/Projet Plug-ins/MonPremierPlugIn/Includes/rb_plugin.h:627)
Plugins SDK/Examples/Complete Module/CompleteModule.cpp:296: warning: 'REALRegisterMethod' is deprecated (declared at /Volumes/Documents/Projets RealBasic/Projet Plug-ins/MonPremierPlugIn/Includes/rb_plugin.h:627)

Build failed (5 errors, 7 warnings)


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Tue Dec 04, 2007 12:08 pm 
Offline
Real Software Engineer

Joined: Sat Dec 24, 2005 8:18 pm
Posts: 7858
Location: Canada, Alberta, Near Red Deer
Dont start with REAL's sdk examples :)

Use this starter and follow the instructions closely
http://www.thismuchiknow.co.uk/?p=20

You should have a working starter up very quickly


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Mon Dec 10, 2007 11:24 am 
Offline
User avatar

Joined: Fri Feb 16, 2007 2:20 pm
Posts: 45
Location: Paris,France
Thanks a lot Npalardy ! It works !
I can now work to write subroutine in C++.

One last question. How can I use my subroutines written in C++ in Xcode to make plugin for windows ? Is there a freeware like XCode for Windows ?

Thanks in advance.

Géraud.

http://perso.orange.fr/hypatiasoft


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Mon Dec 10, 2007 11:33 am 
Offline
Real Software Engineer

Joined: Sat Dec 24, 2005 8:18 pm
Posts: 7858
Location: Canada, Alberta, Near Red Deer
Several from what I know
Lookup MS Visual Studio Express (I think that's the name)
MinGW which is a gcc based complier for Windows.
Also look up Bloodshed DevC++ which is a free IDE


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 9 posts ] 

All times are UTC - 5 hours


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group