Kirix Support Forums

MinGW

Please post all general questions, comments, bug reports, and any other wxWebConnect feedback here.

MinGW

Postby psc on Fri Aug 20, 2010 11:15 pm

hi all,

anyone successfully compiled wxwebconnect with MinGw, be it dll or static? I have not enough knowledge in C++ and MinGw, but i guess it should be doable?

to Kirix or anyone who wants to try it, it's very easy to install MinGw:

download and install in C:\MinGw
add env vars: PATH = C:\MinGW\bin;
create a makefile.gcc

open a command prompt:
mingw32-make -f makefile.gcc > errorlog.txt 2>&1
psc
Registered User
 
Posts: 5
Joined: Wed Jul 14, 2010 7:32 am

Re: MinGW

Postby evstevemd on Fri Aug 27, 2010 9:18 pm

I cannot see this is useful.
Would you elaborate how you got it working with MinGW?
evstevemd
Registered User
 
Posts: 5
Joined: Sun Jan 24, 2010 9:38 am

Re: MinGW

Postby psc on Sat Aug 28, 2010 2:45 am

I think you misread my post. I am asking if someone successfully built wxWebConnect for MinGw. I read somewhere that kirix people do not use MinGw and to encourage them trying it, i gave a quick installation how-to. From what i have read, nobody successfully used wxWebConnect with MinGw so far...
psc
Registered User
 
Posts: 5
Joined: Wed Jul 14, 2010 7:32 am

Re: MinGW

Postby garrizano on Mon Oct 11, 2010 6:42 pm

That's exactly what I want to do too.
Can somebody tell how to compile wxWebConnect whit mingw, I need to work with CodeBlocks.
Thanks.
garrizano
Registered User
 
Posts: 4
Joined: Mon Oct 11, 2010 6:36 pm

Re: MinGW

Postby spell on Wed Nov 03, 2010 9:58 am

I successfully built the wxWebConnect to static lib.
The solution:
nsbase.h, line 239:
Code: Select all
#if (defined WIN32 && not defined __GNUWIN32__)
#define NS_DECLARE_STATIC_IID_ACCESSOR(iid) \
    static const nsIID& GetIID() { \
        static nsIID nsiid = iid; \
        return nsiid; \
    }
#else
#define NS_DECLARE_STATIC_IID_ACCESSOR(...) \
    static const nsIID& GetIID() { \
        static nsIID nsiid = __VA_ARGS__; \
        return nsiid; \
    }
#endif

The NS_DECLARE_STATIC_IID_ACCESSOR(iid) macro is not suitable for gcc.

But, the built lib is wrong.

The GeckoEngine::Init() function crash at runtime at this line: (the problem is same as viewtopic.php?f=25&t=829&start=0&st=0&sk=t&sd=a )
Code: Select all
LOG;
m_appshell = nsCreateInstance(appshell_cid);
LOG;


The nsCreateInstance is not return, because it's crashing during the return.

Code: Select all
ns_smartptr<nsISupports> nsCreateInstance(const nsCID& cid)
{
    ns_smartptr<nsISupports> res;
    static nsIID nsISupportsIID = NS_ISUPPORTS_IID;

    ns_smartptr<nsIComponentManager> comp_mgr;
    NS_GetComponentManager(&comp_mgr.p);
    if (comp_mgr)
    {
        comp_mgr->CreateInstance(cid,
                                 0,
                                 nsISupportsIID,
                                 (void**)&res.p);
    }
    LOG;
    return res;
}


The LOG before the "return res;" line is shown, but the LOG after the "m_appshell = nsCreateInstance(appshell_cid);" line is not.

Explanation:
Code: Select all
#define LOG printf("line: %i\n",__LINE__);


I compile with mingw with gcc-3.4, gcc-4.5.0-1, gcc-tdm-4.5.1, gcc-tdm-4.5.1-dw2, but all of them is crashing at the same line.
(with Code::Blocks)

I don't understand why.

Thanks for help.
spell
Registered User
 
Posts: 1
Joined: Wed Nov 03, 2010 9:15 am

Re: MinGW

Postby jonmmorgan on Wed Nov 03, 2010 10:07 am

As the answer is in the post you link to, I would expect this to be an alignment issue. XULRunner will have been built with MSVC++, so the alignment in a version of WebConnect built with MSVC++ should be the same. On the other hand, there is no guarantee that the alignment in MinGW will be the same as the MSVC++ alignment (if you built XULRunner itself with MinGW you might have a better chance of it working, but I have no idea of whether doing this would be easy or hard).
jonmmorgan
Registered User
 
Posts: 94
Joined: Fri May 14, 2010 9:48 am

Re: MinGW

Postby gabdab on Thu Feb 24, 2011 7:47 am

..same problem with macros trying to cross compile under Linux for Windows.
Does recompiling xulrunner with mingw solve the issue ?
Anyone managed to do it ?
gabdab
Registered User
 
Posts: 2
Joined: Thu Feb 24, 2011 7:44 am

Re: MinGW

Postby jonmmorgan on Fri Feb 25, 2011 6:57 am

MinGW is a tier 3 platform for Mozilla (https://developer.mozilla.org/en/Suppor ... igurations). What this means is that there is someone who tries to keep it working, but it's not guaranteed to work at any time. It also notes that "some features are disabled because they require MS COM or the w32api project doesn't expose the necessary Windows APIs". It doesn't elaborate on which features these are, so I don't know whether they would affect wxWebConnect working. Nor do I know if 1.9.2 is one of the versions where a MinGW compile would work.

I think it is better to just use MSVC++. It is the standard C++ compiler on the platform, which is why it is used in the official builds of Python, Mozilla and other prominent open source software. There is no problem developing free software with it (seeing as I use both Python and the standard wxWebConnect with XULRunner, I do it).
jonmmorgan
Registered User
 
Posts: 94
Joined: Fri May 14, 2010 9:48 am

Re: MinGW

Postby gabdab on Sun Feb 27, 2011 5:35 am

MSVC++ fine.
I need a Linux port though :)
gabdab
Registered User
 
Posts: 2
Joined: Thu Feb 24, 2011 7:44 am

Re: MinGW

Postby jonmmorgan on Sun Feb 27, 2011 8:00 am

wxWebConnect works with gcc on Linux, and gcc/x86 is a tier 1 platform for Linux. I've had no trouble running wxWebConnect on Linux. I'm not sure why would need MinGW on Windows, that's all.
jonmmorgan
Registered User
 
Posts: 94
Joined: Fri May 14, 2010 9:48 am

Return to wxWebConnect Questions, Thoughts & Feedback