Pococapsule with MinGW

18 views
Skip to first unread message

Pascal

unread,
Aug 5, 2009, 8:12:39 PM8/5/09
to pococapsule
Hi everyone

Currently, I am trying to compile and use pococapsule with MinGW - not
very successfully, unfortunately. Using the precompiled DLLs is out of
the question, as they were compiled with VC, and using MSYS, I get
hundreds of warnings and errors like this:

pocoenv.C:1: warning: -fpic ignored for target (all code is position
independent)
pocoenv.C:25: warning: 'POCO_AppEnv::POCO_AppEnv()' redeclared without
dllimport attribute: previous dllimport ignored
...
pocoenv.o: In function `POCO_AppEnv':
c:\c++\pococapsule-cpp\src\capsule/pocoenv.C:25: undefined reference
to `_imp___ZTV11POCO_AppEnv'

Any suggestions on this issue?

Thank you in advance
Pascal

Ke Jin

unread,
Aug 8, 2009, 1:07:09 PM8/8/09
to pococapsule
Hi Pascal,

The errors you encountered were caused you were using a wrong
makefile. I guess you simply used the linux makefile for mingw on
windows. See detail comments inline.

Regards,
Ke

On Aug 5, 5:12 pm, Pascal <pascal_kess...@hotmail.com> wrote:
> Hi everyone
>
> Currently, I am trying to compile and use pococapsule with MinGW - not
> very successfully, unfortunately. Using the precompiled DLLs is out of
> the question, as they were compiled with VC, and using MSYS, I get
> hundreds of warnings and errors like this:
>
> pocoenv.C:1: warning: -fpic ignored for target (all code is position
> independent)
> pocoenv.C:25: warning: 'POCO_AppEnv::POCO_AppEnv()' redeclared without
> dllimport attribute: previous dllimport ignored
> ...

The -fpic is a compile flag for compiling on linux. You should not use
the pococapsule's linux makefile for mingw. Other warning messages
indicates that you didn't have the BUILD_POCOCAPSULE marco defined.

I tested with mingw with the following compile line in the capsule
directory without get even a single line of error and warning:

c:\pococapsule-cpp\src\capsule>gcc -Wall -O3 -c -DBUILD_POCOCAPSULE -I
\pococapsule-cpp\include -I. *.C

> pocoenv.o: In function `POCO_AppEnv':
> c:\c++\pococapsule-cpp\src\capsule/pocoenv.C:25: undefined reference
> to `_imp___ZTV11POCO_AppEnv'
>

This is a link error. What link line you used. I tested with the
following link line to build the pococapsule engine DLL without
getting even a single line of warning or error:

c:\pococapsule-cpp\src\capsule>g++ *.o -shared -o pococapsule.dll

I will add a makefile for mingw on windows in later release.

Hope this helps.
Ke

Ke Jin

unread,
Aug 8, 2009, 3:50:49 PM8/8/09
to pococapsule
Sorry, it should be -DBUILD_POCOCAPSULE_DLL

Pascal

unread,
Aug 12, 2009, 4:43:42 PM8/12/09
to pococapsule
I did in fact use the linux make file, hoping it would work for any
almost gnu compilant system :-) .

In this case, I will try your non-makefile approach and give you some
feedback on that. It would be great if I could use pococapsule on
Windows as well.

IoC and AOP FTW :-P !

Thank you for your help and best regards
Pascal

Ke Jin

unread,
Aug 12, 2009, 10:03:05 PM8/12/09
to pococapsule
H Pascal,

Thanks for your feedback in advance.

You should encounter no major obstacles to make the minGW build
PocoCapsule, including all out-of-the-box IoC examples, to work on
windows. However, I am not sure whether minGW is binary compatible to
other compilers (especially VC++). If they are not binary compatible
and your application has to use a third party binary component built
with VC++ (or another non-minGW compiler, such as C++ builder), you
would have to use the same C++ to build PocoCapsule as well (and vice
versa).

Regards,
Ke
Reply all
Reply to author
Forward
0 new messages