Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
XE7 64-bit not working
#1
Forgive me for opening another thread but it is essential here that I get this going - I have staked my reputation on IntraWeb against almost irresistable opposition from the VS dot crap camp - so to recap ...

I have a clean install of XE7 on a 64-bit W7 PC with the latest IntraWeb release freshly downloaded and installed according to the instructions including removing the bundled edition.  On 32-bit platform an app builds and runs perfectly just like I am used to.

I start a new project in a new and completely different directory, adding 64-bit platform and removing 32-bit platform, I put a button on the IW form and build...

[ilink64 Error] Error: Unresolved external 'WinMain' referenced from C:\PROGRAM FILES (X86)\EMBARCADERO\STUDIO\15.0\LIB\WIN64\RELEASE\C0W64.O

I open Project | View Source where I know the main is located, there I see...

#if _WIN64
int WINAPI _tWinMain(HINSTANCE, HINSTANCE, LPTSTR, int)
#elif __WIN32__
WINAPI WinMain(HINSTANCE, HINSTANCE, LPSTR, int)
#endif
{

So, I try renaming _tWinMain to just WinMain and rebuild - success !

Then I run the app, which immediately crashes out with "The application was unable to start correctly (0x0000007b)."

So there was obviously a reason why WinMain was renamed.  Now I am stumpped and need to make progress...

Help Alexandre my hero !!!

PS I should have said - I'm using C++ Builder not Delphi.

PPS...
Since the whole rational behind this new project is to add a Web form to the 64-vit VCL app....

I tried adding IW to a VCL application using the technique I developed last year (and which was so successful I published it in the then C++ Builder Journal) thinking this would navigate around the Linker error - which it did.  But unfortunately the program still crashed out on start-up with the same Unable to start correctly ... error as above.

I am quite willing to pay for support and a solution !


Denville.


Attached Files
.doc   IntraWeb - add a web page.doc (Size: 29.5 KB / Downloads: 0)
Reply
#2
Hi
you probably don't need the #if #endif, this will work for both:
#include <tchar.h>
int WINAPI _tWinMain(HINSTANCE, HINSTANCE, LPTSTR, int)
{
}
But don't forget to set _TCHAR to wchar_t.

Best Regards
Juergen
Reply
#3
Thanks Juergen but the point is that with main named _tWinMain I get the linker problem during build.  By renamimg main to WinMain I get a clean compile but the app crashes out immediately on start-up.

Denville
Reply
#4
I have created an empty project from scratch with XE6.
I needed to add
#include <tchar.h>
to have the correct WinMain definitions, setting _TCHAR is not needed.
If i compile with packages then i get the same result as you.
But if i compile with static libraries i get an exception: No server controller is defined !!!
Reply
#5
Denville,

We are looking at the reported x64 issue for XE7 and will get this working. As XE being older releases there are few x64 users on them so issues like this don't get reported until someone finds them. With our extensive compiler support we support *dozens* of variations in each and every release so we thank you for the reports.
Reply
#6
Thank you so much - yes I realise what a headache it must be and you really do have my sympathy.  I must remain with older platforms (principally CPB6 !!! but XE7 for some later projects) for complex safety case reasons - the entire safety case will have to be reviewed if I change compiler version.

I am a devoted fan of IntraWeb, for a geriatric like me having used CPB since version 1 it is a God-send and it works very well on 32-bit platform.  The only reason I am looking at 64-bits is that some third-party .dll's have been updated and 32-bit versions are being discontinued.  As I say, the VS converts are snapping at my heels!

I am prepared to pay (a reasonable amount !) for your time and effort fixing this.

Denville.
Reply
#7
Hi Denville,

I'm working on it. Hopefully I'll have a working version early this week. But I believe you are correct.

Unfortunately (?) we support 49 different compilers!!! Yes, that's true!

Delphi and C++ Builder Win 32: 2009, 2010, XE => 6

Delphi and C++ Builder Win32 and Win64: XE2 (Delphi x64 only), XE3, XE4, XE5, XE6, XE7, XE8, Seattle, Berlin, Tokyo, Rio => 43

It is virtually impossible to get everything manually tested at each release. Although every single combination is tested periodically.

Cheers
Reply
#8
Now you can feel my pain when I tested our new zLib library which needs to be compiled differently depending on this combination. And they were 100% tested.
Reply
#9
This project template works correctly. The only difference is the inclusion of tchar.h. I don't know why it started failing in new projects in some C++ IDEs, not in others.

There is no AV regarding ServerController missing or something.

Can you please test it and let me know?


Code:
//---------------------------------------------------------------------------

#include <vcl.h>
#pragma hdrstop
#include <tchar.h>
USEFORM("Unit1.cpp", IWForm1); /* TIWAppForm: File Type */
USEFORM("ServerController.cpp", IWServerController); /* TIWServerControllerBase: File Type */
USEFORM("UserSessionUnit.cpp", IWUserSession); /* TIWUserSessionBase: File Type */
//---------------------------------------------------------------------------
#include <IWRtlFix.hpp>
#include <IWStart.hpp>
//---------------------------------------------------------------------------
#if _WIN64
int WINAPI _tWinMain(HINSTANCE, HINSTANCE, LPTSTR, int)
#elif __WIN32__
WINAPI WinMain(HINSTANCE, HINSTANCE, LPSTR, int)
#endif
{
        try
        {
           TIWStart::Execute(true);
        }
        catch (Exception &exception)
        {

        }
        return 0;
}
//---------
Reply
#10
(03-11-2019, 08:22 AM)Alexandre Machado Wrote: This project template works correctly. The only difference is the inclusion of tchar.h. I don't know why it started failing in new projects in some C++ IDEs, not in others.

There is no AV regarding ServerController missing or something.

Can you please test it and let me know?


Code:
//---------------------------------------------------------------------------

#include <vcl.h>
#pragma hdrstop
#include <tchar.h>
USEFORM("Unit1.cpp", IWForm1); /* TIWAppForm: File Type */
USEFORM("ServerController.cpp", IWServerController); /* TIWServerControllerBase: File Type */
USEFORM("UserSessionUnit.cpp", IWUserSession); /* TIWUserSessionBase: File Type */
//---------------------------------------------------------------------------
#include <IWRtlFix.hpp>
#include <IWStart.hpp>
//---------------------------------------------------------------------------
#if _WIN64
int WINAPI _tWinMain(HINSTANCE, HINSTANCE, LPTSTR, int)
#elif __WIN32__
WINAPI WinMain(HINSTANCE, HINSTANCE, LPSTR, int)
#endif
{
        try
        {
           TIWStart::Execute(true);
        }
        catch (Exception &exception)
        {

        }
        return 0;
}
//---------

Hi and thanks so much - I am away from the office this week but I will test it first thing next week.

Sincerely,
Denville.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)