Moda to C++Builder

Questions about Marilou Open Devices Access (MODA)
Post Reply
Guillermo Gebhart
Posts: 28
Joined: Fri Apr 04, 2008 6:19 pm

Moda to C++Builder

Post by Guillermo Gebhart » Fri Apr 25, 2008 7:29 pm

Hi, I want to compile my control application with C++Builder from borland. I've included the ModaCPP.h file but i get lot of errors after compilation.
Any ideas?

Thanks

LR
Posts: 305
Joined: Mon Feb 12, 2007 11:55 pm
Location: FR

Post by LR » Fri Apr 25, 2008 9:38 pm

Hi,

Can you show us the error messages ? (please copy/paste the error log). Also, MODA is open source, you may have to rebuild library for borland, creating a moda-x86-win-bcxxxx.lib ?
LR

Guillermo Gebhart
Posts: 28
Joined: Fri Apr 04, 2008 6:19 pm

Post by Guillermo Gebhart » Fri Apr 25, 2008 9:54 pm

these are the errors. I`ll try to rebuild library


[BCC32 Error] windowstolinux.h(13): E2209 Unable to open include file 'sys/socket.h'
[BCC32 Error] windowstolinux.h(14): E2209 Unable to open include file 'netdb.h'
[BCC32 Error] windowstolinux.h(15): E2209 Unable to open include file 'netinet/in.h'
[BCC32 Error] windowstolinux.h(16): E2209 Unable to open include file 'netinet/tcp.h'
[BCC32 Error] windowstolinux.h(51): E2176 Too many types in declaration
[BCC32 Error] windowstolinux.h(51): E2146 Need an identifier to declare
[BCC32 Error] windowstolinux.h(52): E2176 Too many types in declaration
[BCC32 Error] windowstolinux.h(52): E2146 Need an identifier to declare
[BCC32 Error] windowstolinux.h(53): E2176 Too many types in declaration
[BCC32 Error] windowstolinux.h(53): E2146 Need an identifier to declare
[BCC32 Error] windowstolinux.h(54): E2176 Too many types in declaration
[BCC32 Error] windowstolinux.h(54): E2146 Need an identifier to declare
[BCC32 Error] windowstolinux.h(88): E2209 Unable to open include file 'pthread.h'
[BCC32 Error] windowstolinux.h(98): E2303 Type name expected
[BCC32 Error] windowstolinux.h(98): E2139 Declaration missing ;
[BCC32 Error] windowstolinux.h(124): E2303 Type name expected
[BCC32 Error] windowstolinux.h(124): E2139 Declaration missing ;
[BCC32 Error] iosfwd(254): E2238 Multiple declaration for 'char_traits<wchar_t>::int_type'
[BCC32 Error] iosfwd(136): E2344 Earlier declaration of 'char_traits<wchar_t>::int_type'
[BCC32 Error] iosfwd(260): E2238 Multiple declaration for 'char_traits<wchar_t>::assign(wchar_t &,const wchar_t &)'
[BCC32 Error] iosfwd(141): E2344 Earlier declaration of 'char_traits<wchar_t>::assign(wchar_t &,const wchar_t &)'
[BCC32 Error] iosfwd(265): E2238 Multiple declaration for 'char_traits<wchar_t>::eq(const wchar_t &,const wchar_t &)'
[BCC32 Error] iosfwd(146): E2344 Earlier declaration of 'char_traits<wchar_t>::eq(const wchar_t &,const wchar_t &)'
[BCC32 Error] iosfwd(270): E2238 Multiple declaration for 'char_traits<wchar_t>::lt(const wchar_t &,const wchar_t &)'
[BCC32 Error] iosfwd(151): E2344 Earlier declaration of 'char_traits<wchar_t>::lt(const wchar_t &,const wchar_t &)'
[BCC32 Error] iosfwd(276): E2238 Multiple declaration for 'char_traits<wchar_t>::compare(const wchar_t *,const wchar_t *,unsigned int)'
[BCC32 Error] iosfwd(156): E2344 Earlier declaration of 'char_traits<wchar_t>::compare(const wchar_t *,const wchar_t *,unsigned int)'
[BCC32 Error] iosfwd(283): E2238 Multiple declaration for 'char_traits<wchar_t>::length(const wchar_t *)'
[BCC32 Error] iosfwd(167): E2344 Earlier declaration of 'char_traits<wchar_t>::length(const wchar_t *)'
[BCC32 Error] iosfwd(290): E2238 Multiple declaration for 'char_traits<wchar_t>::copy(wchar_t *,const wchar_t *,unsigned int)'
[BCC32 Error] iosfwd(176): E2344 Earlier declaration of 'char_traits<wchar_t>::copy(wchar_t *,const wchar_t *,unsigned int)'
[BCC32 Error] iosfwd(298): E2238 Multiple declaration for 'char_traits<wchar_t>::find(const wchar_t *,unsigned int,const wchar_t &)'
[BCC32 Error] iosfwd(187): E2344 Earlier declaration of 'char_traits<wchar_t>::find(const wchar_t *,unsigned int,const wchar_t &)'
[BCC32 Error] iosfwd(305): E2238 Multiple declaration for 'char_traits<wchar_t>::move(wchar_t *,const wchar_t *,unsigned int)'
[BCC32 Error] iosfwd(197): E2344 Earlier declaration of 'char_traits<wchar_t>::move(wchar_t *,const wchar_t *,unsigned int)'
[BCC32 Error] iosfwd(312): E2238 Multiple declaration for 'char_traits<wchar_t>::assign(wchar_t *,unsigned int,wchar_t)'
[BCC32 Error] iosfwd(212): E2344 Earlier declaration of 'char_traits<wchar_t>::assign(wchar_t *,unsigned int,wchar_t)'
[BCC32 Error] iosfwd(323): E2238 Multiple declaration for 'char_traits<wchar_t>::to_int_type(const wchar_t &)'
[BCC32 Error] iosfwd(227): E2344 Earlier declaration of 'char_traits<wchar_t>::to_int_type(const wchar_t &)'
[BCC32 Error] iosfwd(334): E2238 Multiple declaration for 'char_traits<wchar_t>::eof()'
[BCC32 Error] iosfwd(238): E2344 Earlier declaration of 'char_traits<wchar_t>::eof()'
[BCC32 Error] iosfwd(355): E2238 Multiple declaration for 'char_traits<char>::assign(char &,const char &)'
[BCC32 Error] iosfwd(141): E2344 Earlier declaration of 'char_traits<char>::assign(char &,const char &)'
[BCC32 Error] iosfwd(360): E2238 Multiple declaration for 'char_traits<char>::eq(const char &,const char &)'
[BCC32 Error] iosfwd(146): E2344 Earlier declaration of 'char_traits<char>::eq(const char &,const char &)'
[BCC32 Error] iosfwd(365): E2238 Multiple declaration for 'char_traits<char>::lt(const char &,const char &)'
[BCC32 Error] iosfwd(151): E2344 Earlier declaration of 'char_traits<char>::lt(const char &,const char &)'
[BCC32 Error] iosfwd(371): E2238 Multiple declaration for 'char_traits<char>::compare(const char *,const char *,unsigned int)'
[BCC32 Error] iosfwd(156): E2344 Earlier declaration of 'char_traits<char>::compare(const char *,const char *,unsigned int)'
[BCC32 Error] iosfwd(378): E2238 Multiple declaration for 'char_traits<char>::length(const char *)'
[BCC32 Error] iosfwd(378): E2228 Too many error or warning messages

LR
Posts: 305
Joined: Mon Feb 12, 2007 11:55 pm
Location: FR

Post by LR » Fri Apr 25, 2008 10:14 pm

Ok, windowstolinux.h does not detect you are running on windows.

in the very firsts lines:
#if defined(WIN32) || defined(_WINDLL)
#ifndef _WINDOWS
#define _WINDOWS
#endif
#endif

#ifndef _WINDOWS
#define _LINUX

Can you say us what is the symbol defined by borland, symbol that is used to detect program is runinng under windows ? (WIN32 or _WINDLL is used by Microsoft only i think). Finding the defined symbol, add it into windows detection at the location "BORLANDSPECIFICSYMBOL" :

#if defined(WIN32) || defined(_WINDLL) || defined("BORLANDSPECIFICSYMBOL")
#ifndef _WINDOWS
#define _WINDOWS
#endif
#endif

Hum, you can also opt for Visual Studio Express : it's free (do not forget to download the required platform SDK)
LR

Guillermo Gebhart
Posts: 28
Joined: Fri Apr 04, 2008 6:19 pm

Post by Guillermo Gebhart » Mon Apr 28, 2008 1:57 pm

I need to use Borland c++ Builder

The windowstolinux error was solved. Now I get this errors:

[C++ Error] Image.h(75): E2238 Multiple declaration for 'CameraImage::Display(void *,int,int)'

[C++ Error] Image.h(74): E2344 Earlier declaration of 'CameraImage::Display(void *,int,int)'

[C++ Error] Main.cpp(54): E2268 Call to undefined function '_cprintf'

Thanks

LR
Posts: 305
Joined: Mon Feb 12, 2007 11:55 pm
Location: FR

Post by LR » Mon Apr 28, 2008 2:26 pm

Wa are trying to get Borland C++ builder to be sure all is working fine with this compiler.

Waiting that, i suggest you to "comment" the Display functions, that are specific to Windows (using HDC) : in Image.h and Image.cpp.

the _cprintf function may be replaced by a simple prinft ? or a cprintf ...
LR

Guillermo Gebhart
Posts: 28
Joined: Fri Apr 04, 2008 6:19 pm

Post by Guillermo Gebhart » Mon Apr 28, 2008 7:56 pm

I've done the comments.
Then the linker said that there was invalid OMF simbols in moda-x86-win-vc6.lib and xklib-x86-win-vc6.lib, so I convert them with the coff2omf tool.
Now the linker says this:

[Linker Error] Unresolved external 'ModaCPP::Connection::~Connection()' referenced from C:\DOCUMENTS AND SETTINGS\CASA\MIS DOCUMENTOS\FACULTAD\PROYECTO FINAL\SREI_SIMULACIÓN\PROGRAM\SMART1\DEBUG\MAIN.OBJ

[Linker Error] Unresolved external 'xkode::lib::String::~String()' referenced from C:\DOCUMENTS AND SETTINGS\CASA\MIS DOCUMENTOS\FACULTAD\PROYECTO FINAL\SREI_SIMULACIÓN\PROGRAM\SMART1\DEBUG\MAIN.OBJ

[Linker Error] Unresolved external 'ModaCPP::Connection::Connection(bool)' referenced from C:\DOCUMENTS AND SETTINGS\CASA\MIS DOCUMENTOS\FACULTAD\PROYECTO FINAL\SREI_SIMULACIÓN\PROGRAM\SMART1\DEBUG\MAIN.OBJ

[Linker Error] Unresolved external 'ModaCPP::Connection::Connect(xkode::lib::String)' referenced from C:\DOCUMENTS AND SETTINGS\CASA\MIS DOCUMENTOS\FACULTAD\PROYECTO FINAL\SREI_SIMULACIÓN\PROGRAM\SMART1\DEBUG\MAIN.OBJ

I get 26 similar linker errors.

please help

Thanks

LR
Posts: 305
Joined: Mon Feb 12, 2007 11:55 pm
Location: FR

Post by LR » Mon Apr 28, 2008 10:49 pm

I think the best to do is that we do the build ourselves. I don't known Borland and there is a lot of downloads on Borland website. Do you know where i can download it just to to the test ? Perhaps you can do a FTP with the CD you are using ?
LR

Guillermo Gebhart
Posts: 28
Joined: Fri Apr 04, 2008 6:19 pm

Post by Guillermo Gebhart » Mon Apr 28, 2008 11:10 pm

In the following link you can donwload the 30 days free Codegear RAD Studio Trial:

http://cc.codegear.com/item/24994

Thanks for any help.

adminforum
Site Admin
Posts: 95
Joined: Wed Feb 07, 2007 11:10 am
Location: Montpellier - FR

Post by adminforum » Tue Apr 29, 2008 11:18 am

We downloaded BC ++, we are modifying the xklib and moda library code. I will sent you the library by email shortly when all is OK.

adminforum
Site Admin
Posts: 95
Joined: Wed Feb 07, 2007 11:10 am
Location: Montpellier - FR

Post by adminforum » Tue Apr 29, 2008 3:06 pm

We sent you the email with new libraries for Builder C++ . Please inform us saying if all is ok or not.

Admin

Gabriel
Posts: 3
Joined: Fri Nov 27, 2009 8:11 pm
Location: Paraná, Entre Ríos, Argentina
Contact:

Post by Gabriel » Fri Nov 27, 2009 8:53 pm

Hi, I'm a student of Bioengineering in the Entre Ríos National University. I have begun working with Marilou. I want to create a program in C + + Builder to simulate but I have compiling problems with the file "ModaCPP.h".
The error is this:

"[Linker Error] 'D:\MARILOU2009\GABRIEL\MODACPP.H' constains invalid OMF record, type 0x2f"

I really appreciate any help. Thanks.

LR
Posts: 305
Joined: Mon Feb 12, 2007 11:55 pm
Location: FR

Post by LR » Fri Nov 27, 2009 11:34 pm

Hi Gabriel,

We build MODACPP for Borland Builder 2009 and we never had this error ...

What is your builder version ?
Does the linker gives the line where this OMF record (?) occurs ?
LR

Gabriel
Posts: 3
Joined: Fri Nov 27, 2009 8:11 pm
Location: Paraná, Entre Ríos, Argentina
Contact:

Post by Gabriel » Sat Nov 28, 2009 12:42 am

On my computer I have installed version 6 of C + + Builder. No, the linker gives no line.
This is my cpp file.

#include <clx.h>
#include "ModaCPP.h"
#pragma hdrstop
#pragma link "D:\\Marilou\\Gabriel\\ModaCPP.h"
#pragma argsused
//Settings:
#define SIMULATEDROBOT "/robot1"
#define MODASERVER "localhost"

int main(int argc, TCHAR* argv[])
{
ModaCPP::Connection *connection=new ModaCPP::Connection(true);
if(connection->Connect(MODASERVER))
{
_cprintf("Connexion to %s ok\r\n",MODASERVER);
ModaCPP::RobotPHX *robot=connection->QueryRobotPHX(SIMULATEDROBOT);
if(robot)
{
cprintf("robot found\r\n");
delete robot;
}
else
{
cprintf("robot not found\r\n");
}
}
else
{
cprintf("Unable to connect to moda server : be sure Exec is running and MODA TCP/UDP ports are open\r\n");
}
connection->Disconnect();
delete connection;
_getch();
return 0;
}
I copied this from the Marilou's tutorial.

Thank you very much!

LR
Posts: 305
Joined: Mon Feb 12, 2007 11:55 pm
Location: FR

Post by LR » Sat Nov 28, 2009 2:56 pm

According to your previous message, the error seems to be in ModaCPP.h.

The char 0x2F is the '/'

Search in ModaCPP.h the line that contains 'L27' string, and remove all the comment near this line (including this line). This is the only location that can be ambiguous for Borlan ...

Please try that and say me if all is OK.
LR

Post Reply