using fis.c in a c++ project

M

Martin

Hi to all,
I'm a newbie with the c++, I have the preparation of base given from
the Deitel & Deitel... I am trying to use the fis.c class of matlab
fuzzy toolbox in my c++ project.
Watching the fismain.c I have thought that it was corrected to use the
preprocessor #includes "fis.c" but when I compile give errors on the
fis.c. I think because it's a class written in C. How I can make in
order to use in my c++ project the functions of the class fis? I pray
to you you help me... I use eclipse... thanks to all
 
W

W Marsh

Hi to all,
I'm a newbie with the c++, I have the preparation of base given from
the Deitel & Deitel... I am trying to use the fis.c class of matlab
fuzzy toolbox in my c++ project.
Watching the fismain.c I have thought that it was corrected to use the
preprocessor #includes "fis.c" but when I compile give errors on the
fis.c. I think because it's a class written in C. How I can make in
order to use in my c++ project the functions of the class fis? I pray
to you you help me... I use eclipse... thanks to all

fis.c isn't a header file - it should be compiled separately rather
than including directly into your source code. I imagine there is an
appropriate header file (most likely with the file extension .h)
containing definitions for items in the fis.c, which you will include
into your source files to reference the items in fis.c. As it's C
code, you will probably need to include the header like this (assuming
it's called fis.h):

extern "C"
{
#include "fis.h"
}
 
M

Martin

I've used #include "fis.c" because it's used in a c example class,
fismain.c

I found in a subdirectory the file fis.h but it does'nt contain the
function of the fis class... However I tryed to compile fis.c with cc
of cygwin and it report this error :
/usr/lib/gcc/i686-pc-cygwin/3.4.4/../../../libcygwin.a(libcmain.o)::
undefined reference to '-WinMain@16'
collect2: ld returned 1 exit status...

what is mean???
 
W

W Marsh

I've used #include "fis.c" because it's used in a c example class,
fismain.c

I found in a subdirectory the file fis.h but it does'nt contain the
function of the fis class... However I tryed to compile fis.c with cc
of cygwin and it report this error :
/usr/lib/gcc/i686-pc-cygwin/3.4.4/../../../libcygwin.a(libcmain.o)::
undefined reference to '-WinMain@16'
collect2: ld returned 1 exit status...

what is mean???

I'm afraid this is off-topic here, so all I'll say is that it seems
like you are compiling a Windows program by mistake, so it's looking
for WinMain as an entry point instead of main. You should really ask
about that in a Cygwin group.

As for fis.h - it won't contain many actual function bodies, but if
it's the right file it will contain the declarations for the
functions.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,734
Messages
2,569,441
Members
44,832
Latest member
GlennSmall

Latest Threads

Top