Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Compiling FLL with non-MS C++ Compiler 1

Status
Not open for further replies.

Brak

Programmer
Jul 11, 2001
158
US
Hello,

I have just recently decided to update me programs to VFP from FPW and am encountering a BIG problem.

I have been using for years Borland C++ 4.0 for creating FLLs for FPW. As you all know FPW FLL don't work in VPF, so I need to recompile them.

Now the original pro_ext.h file didn't work Borland compilers - only MS and WATCOM, but someone cameup with a manual patch to make it so that you could use Borland.

Well the pro_ext.h file is giving problem again, as I can't use my Borland with it. I have also downloaded OpenWatcom and other free C++ compilers and they won't work either.

I think its awful that MS basically forces you to use THEIR compilers.

Anyway, does anyone have a work around for this problem. I'm sure there are many people making VFP FLLs in non-MS C++ compilers.

Please help as I can't migrate to VFP without being able to recompile these FLLs.

Thanks in advance
 

Brak,

I don't know anything about C++ compilers, but surely the .H file you refer to is an ordinary text file. Can you not edit it manually to adjust the entries you need?

That said, my inclination would be to rewrite the FLLs in native VFP code, if that's possible. I don't know what your FLLs do, but there is virtually no limits to what you can code in VFP these days.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

My Visual FoxPro site: www.ml-consult.co.uk
 
Brak,
Haven't had to make FLLs since my 2.6 days... but as I understand it, no, non-MS compiler is not supported.
I would echo Mike's comments... unless you are using them for intensive vecotr graphics routines, or need controls for unusual devices, you can probably now use native VFP in the 9.0 version to do what you were doing in an FLL before. Can you give us any idea of what you are using the FLLs for, and we may be able to help get you pointed quickly in the right direction in VFP to accomplish the same thing.

Good luck.



Best Regards,
Scott

"Everything should be made as simple as possible, and no simpler."[hammer]
 
Hi Brak,

If you want I'll recompile those FLLs with MS Visual C++ for you.

Email me at n o c u r e AT h c c n e t DOT n l

Rob.
 
Mike:
I have no clue what so ever where to even begin modifing the pro_ext.h file to make it work with my three non-MS compilers.

Scott:
Not an option for several reasons. One being the need to have available the function from more than one library for more than one app/project. FP only allows one procedure to be set, where you can have a plethora of libraries. And two I have several FLLs which have A LOT of code in them so o convert then to foxcode would be quiet a task. So hence I need to have FLLs.

Rob:
Hey, I know you from the FP26 forum. Good to see you!
Thank you so much for the offer - but in the long term (or even medium term) it wouldn't solve the problem as I am constantly updating them. In fact a few are "works in progress" which I am still developing. So you compiling them for me would allow me to use the FLLs in their current state of development, but in a few days/weeks I may need to modify them (believe me - it happens more than one may think) and I would be back to where I am now. So its the proverbal "Catch a fish for a man - feed him for a day, teach him to fish - feed him for life." But thank you anyways, it was cool for you to offer!

To all:
I'm just hoping someone here has a modified pro_ext.h which allows non-MS compilers to work, or knows of an non-MS compiler which emulates MS compilers enough to trick the pro_ext.h into thinking its a MS complier.

Talk about MS and anti-trust issues. Its weird that everyone got all uptight about IE being intigrated into the OS - where even with IE intergration you can still use other browsers (Windows doesn't reject other browsers) - and IE is free, so even if Windows only accepted IE it doesn't cost you any money. But here Visual C++ isn't free and they are basically forcing me to buy another one of thier's. Now that's a monopoly: VFP needing MSVC++, not IE being packaged with Windows!

In the mean time I guess I'll start looking on ebay for used copies of VC++ just incase there are no other options.
 
It's not just the pro_ext.h file you would need to modify. There are all sorts of macros, #defines, libraries etc., that are part of the MS compiler, which interact with VFP - which is also compiled using the MS compiler. Changing a few lines of code in the pro_ext.h ain't going to work.
If you're going to be doing that much twiddling with the libraries, you should probably bite the bullet and purchase the MS compiler.
You should be able to get a decent deal on Visual Studio somewhere.


-Dave Summers-
[cheers]
Even more Fox stuff at:
 
Not an option for several reasons. One being the need to have available the function from more than one library for more than one app/project. FP only allows one procedure to be set, where you can have a plethora of libraries.

Actually, you can now set multiple procedures... You do this by including the ADDITIVE caluse to the SET PROCEDURE TO clause. I appreciate that you may have lots of code, but given the task of tweeking C compilers, and time involved with that, you may have an easier time. Plus, you would long term be getting yourself away from the dependancy of another compiler.

I think as you get into VFP you'll find that a LOT has changed, and if you are writing entierly in code, for building screens and fields and the like, you will do yourself a huge favor by spending some time taking advantage of what VFP will really do for you, instead of just using it as a "Better FoxPro". Just a suggestion... Hang in there, you'll get it.



Best Regards,
Scott

"Everything should be made as simple as possible, and no simpler."[hammer]
 
I tried the Pelles C with some results.

The error I kept on getting with the other comiplers was a error about "Multithread DLL" and a switch/flag for it. But in my compiers there was nothing aobut this option/switch/flag. And the error messages always pointed ot the pro_ext.h file.

Anyways the Pelles C had in it options the Multithread DLL, so I am no longer getting this error - but am getting others.
So maybe the real problem isn't the compiler nor the peo_ext.h file, but rather having the right options/switches/flags.

So to those who actually make FLLs (such as Rob) what are the settings/options/switches/flags in order to make a FLL.

So far what I am doing is:
making a new empty Win32 DLL project.
I create a new cpp file.
I add my code from another of my 16bit FLL.
I go into the project options and change "runtime library" to "Multithread DLL"

So what other alterations do I need to do?

My cousin is currently taking C++ in college and he has Vicual C++ on his computer. So if I need to I could go to his place and try to compile it. But no sense in doing that now considering it might not work on his compiler without knowing the proper options/settings/switches/flags.
 
Brak,
Not writing FLL's anymore... have converted everything I needed to VFP. Sorry I could not be of more help.



Best Regards,
Scott

"Everything should be made as simple as possible, and no simpler."[hammer]
 
Brak,

If you need info on How To.. please email me at

n o c u r e A T h c c n e t D O T n l and I'll send you a word document which explains in detail how to create FLL's

Rob.
 
Thank you Rob! That was exactly the info I needed.

Now I just have to look around for a free compiler which will allow for such configuring.

The Pelles C almost worked, except for the problem that it is only C, and C++ is needed for the VFP FLLs.

So if there was a Pelles C++ I would probably be set to go.

I would like to ask everyone on this thread to give a star to Rob, cause the doc he sent me was exactly the info I needed to know how to set up an DLL in C++ to create a FLL.

Thanks Rob!!!!
 
Brak,

have a look at the FREE Visual C++ Express from Microsoft.
The only problem is that it has no IDE but you can do without that.

Rob.
 
I suggest putting this info in the FAQ - because overwise it will not be available to the community. It's not even in this thread.
 
Good suggestion,

I'll think about a rewrite because what I've sent Brak has screen-captures in it to clarify things.
This might take a while...

Rob.
 
@Brak

Quote:
The Pelles C almost worked, except for the problem that it is only C, and C++ is needed for the VFP FLLs.


This is an incorrect assumption.
VFP FLLs can be written in plain C without any problem.

Rob.
 
Rob:
How is that possilbe when the stdafx.cpp and the stdafx.h (actually afx.h) files need C++ to compile.
in fact when I try to do so in Pelles C I get the follow error:
afx.h(15): fatal error #1014: #error: MFC requires C++ compilation (use a .cpp suffix).

Can you create a FLL without using these files?

Would you terribly mind downloading and installing Pelles C and see if you can get it to compile a FLL?

Thanks again!
 
Its the MFC, the foundation classes that create the problem, so you have to stick to Microsoft Visual C(++)

Rob.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top