RE: need -mrtd to create Excel DLL?

2004-07-12 Thread Hannu E K Nevalainen
> From: Lester Ingber

[snip]
>  The `rtd' instruction is supported by the 68010, 68020, 68030,
>  68040, 68060 and CPU32 processors, but not by the 68000 or 5200.
> 8< bottom cut <- top
> ->8

Heh... ;-P

 I wonder what kind of side effect the -mrtd flag has when used for the
cygwin compiler.

 I've hard to believe that Excel grok's M68K code. ;-D

(Documentation for intel CPU behaviour missing? Isn't it nice.)


/Hannu E K Nevalainen, B.Sc. EE - 59+16.37'N, 17+12.60'E --76-->

** on a mailing list; please keep replies on that particular list **

-- printf("LocalTime: UTC+%02d\n",(DST)? 2:1); --
--END OF MESSAGE--


--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Problem reports:   http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ:   http://cygwin.com/faq/



RE: need -mrtd to create Excel DLL?

2004-07-13 Thread Siegfried Heintze
Lester,
 It works! Thank you. Assuming these will be archived, maybe this can help
someone else.

Since I'm wondering if Excel was caching something, I decided to use C# and
it works!
 Thanks,
Siegfried

Here is the example of calling cygwin C from C#:
--begin here --

//  Begin commands to execute this file using MS.NET with bash
//  cat 

Re: need -mrtd to create Excel DLL?

2004-07-13 Thread Lester Ingber
Siegfried:

Hi. I did not use any __declspec keywords, etc. -- just vanilla C
code which runs as well under gcc or g++ under Cygwin, FreeBSD, or
SPARC/Solaris, etc.  Creating DLLs is another matter -- I've just tested
this using Cygwin/gcc under XP Pro.  As I said, I cannot get this to
work under Cygwin/g++.

I tested the application with Excel using the dlltest.xls file in
http://www.xraylith.wisc.edu/~khan/software/gnu-win32/
but without the other modifications in his cdll.[ch] files.
To use his dlltest.xls, I named my DLL the same, and created
double dll_double_square (double d)
as one of my functions which called a series of other functions in other
files before returning.

I used the following lines in my Makefile.  No other special code changes
were required in any of my .c or .h files:

CC = gcc
MY_OBJS = \
[.o files]

DLL_OPTION=-mrtd # needed for Excel DLL
CYGWIN_OPTION=-mno-cygwin $(DLL_OPTION)
CDEBUGFLAGS = -g -O2 -Wall
CFLAGS = $(CDEBUGFLAGS) $(CYGWIN_OPTION)

dllmodule = cdll
obj_libs = $(MY_OBJS)
dependency_libs = -lm

# no need for run.exe when creating DLLs -- without a main()
compile: $(MY_OBJS)
@$(CC) -o run.exe $(MY_OBJS) ${dependency_libs}

cdll:
make -i compile
$(CC) $(CFLAGS) -shared -o ${dllmodule}.dll \
-Wl,--out-implib=${dllmodule}.lib \
-Wl,--compat-implib \
-Wl,--add-stdcall-alias \
-Wl,--enable-stdcall-fixup \
-Wl,--enable-auto-import \
-Wl,--enable-auto-image-base \
-Wl,--whole-archive ${obj_libs} \
-Wl,--export-all-symbols \
-Wl,--output-def=${dllmodule}.def \
-Wl,--no-whole-archive ${dependency_libs}

Lester

: Lester,
:  It works! Thank you. Assuming these will be archived, maybe this can help
: someone else.
: 
: Since I'm wondering if Excel was caching something, I decided to use C# and
: it works!
: 
:  Thanks,
: Siegfried
: 
: Here is the example of calling cygwin C from C#:

:: I was able to create a dll from many C files, representing fairly complex
:: calculations, using the following in my Makefile, without having to add
:: any keywords like "__declspec", using info from the Cygwin docs.
:: ...
:: Lester


--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Problem reports:   http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ:   http://cygwin.com/faq/



Re: need -mrtd to create Excel DLL?

2004-07-13 Thread Igor Pechtchanski
On Tue, 13 Jul 2004, Lester Ingber wrote:

> Siegfried:
>
> Hi. I did not use any __declspec keywords, etc. -- just vanilla C
> code which runs as well under gcc or g++ under Cygwin, FreeBSD, or
> SPARC/Solaris, etc.  Creating DLLs is another matter -- I've just tested
> this using Cygwin/gcc under XP Pro.  As I said, I cannot get this to
> work under Cygwin/g++.
> [snip]

Lester,

It is unlikely you'll be able to get g++ to link with Microsoft's C++
object files -- they use different name mangling schemes.  The common way
of linking different flavors of C++ is to wrap C++ functions with 'extern
"C"' declarations.  This will start to get ugly once you decide to
interface instance functions, etc.
Igor
-- 
http://cs.nyu.edu/~pechtcha/
  |\  _,,,---,,_[EMAIL PROTECTED]
ZZZzz /,`.-'`'-.  ;-;;,_[EMAIL PROTECTED]
 |,4-  ) )-,_. ,\ (  `'-'   Igor Pechtchanski, Ph.D.
'---''(_/--'  `-'\_) fL a.k.a JaguaR-R-R-r-r-r-.-.-.  Meow!

"I have since come to realize that being between your mentor and his route
to the bathroom is a major career booster."  -- Patrick Naughton

--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Problem reports:   http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ:   http://cygwin.com/faq/



How to update official cygwin documentation for g77 and gcc? (was: RE: need -mrtd to create Excel DLL?)

2004-07-13 Thread Siegfried Heintze
Lester,
 Yeah, I did the same (with regard to __declspec keywords). Odd, Excell
won't read the DLL but C# will! I was just using Excell because it was handy
to test with. Good thing I really don't need excel. My real concern is
calling g77 from C# (which works). I got C# to call gcc too under cygwin.
Too bad my email wrapped my carefully prepared sample source code.

So our examples should go into the cygwin documentation! How can these be
inserted into to the documentation? Can someone tell us? Surely there will
be others who don't want to buy the Microsoft C++ or FORTRAN compilers but
want their C/FORTRAN code to interact with other Microsoft languages like
C#, VB.NET, Javascript.NET, J#.

Incidentally, I did discover that Microsoft is giving away their C/C++
compiler these days. It is part of the .NET Framework SDK (go to
http://search.microsoft.com to look for it). This free version of the
compiler seems to be able to compile C++ but does not have the standard C++
header files, only the standard C header files. I assume folks would still
prefer g77/gcc to Microsoft's, however. Oopss -- that is off topic. Sorry...



   Siegfried

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of
Lester Ingber
Sent: Tuesday, July 13, 2004 1:34 PM
To: [EMAIL PROTECTED]
Subject: Re: need -mrtd to create Excel DLL?

Siegfried:

Hi. I did not use any __declspec keywords, etc. -- just vanilla C
code which runs as well under gcc or g++ under Cygwin, FreeBSD, or
SPARC/Solaris, etc.  Creating DLLs is another matter -- I've just tested
this using Cygwin/gcc under XP Pro.  As I said, I cannot get this to
work under Cygwin/g++.

I tested the application with Excel using the dlltest.xls file in
http://www.xraylith.wisc.edu/~khan/software/gnu-win32/
but without the other modifications in his cdll.[ch] files.
To use his dlltest.xls, I named my DLL the same, and created
double dll_double_square (double d)
as one of my functions which called a series of other functions in other
files before returning.

I used the following lines in my Makefile.  No other special code changes
were required in any of my .c or .h files:

CC = gcc
MY_OBJS = \
[.o files]

DLL_OPTION=-mrtd # needed for Excel DLL
CYGWIN_OPTION=-mno-cygwin $(DLL_OPTION)
CDEBUGFLAGS = -g -O2 -Wall
CFLAGS = $(CDEBUGFLAGS) $(CYGWIN_OPTION)

dllmodule = cdll
obj_libs = $(MY_OBJS)
dependency_libs = -lm

# no need for run.exe when creating DLLs -- without a main()
compile: $(MY_OBJS)
@$(CC) -o run.exe $(MY_OBJS) ${dependency_libs}

cdll:
make -i compile
$(CC) $(CFLAGS) -shared -o ${dllmodule}.dll \
-Wl,--out-implib=${dllmodule}.lib \
-Wl,--compat-implib \
-Wl,--add-stdcall-alias \
-Wl,--enable-stdcall-fixup \
-Wl,--enable-auto-import \
-Wl,--enable-auto-image-base \
-Wl,--whole-archive ${obj_libs} \
-Wl,--export-all-symbols \
-Wl,--output-def=${dllmodule}.def \
-Wl,--no-whole-archive ${dependency_libs}

Lester

: Lester,
:  It works! Thank you. Assuming these will be archived, maybe this can help
: someone else.
: 
: Since I'm wondering if Excel was caching something, I decided to use C#
and
: it works!
: 
:  Thanks,
: Siegfried
: 
: Here is the example of calling cygwin C from C#:

:: I was able to create a dll from many C files, representing fairly complex
:: calculations, using the following in my Makefile, without having to add
:: any keywords like "__declspec", using info from the Cygwin docs.
:: ...
:: Lester


--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Problem reports:   http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ:   http://cygwin.com/faq/



--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Problem reports:   http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ:   http://cygwin.com/faq/