Overview
Features
Download
Documentation
Community
Add-Ons & Services

CYGWIN problem

Please post support and help requests here.

CYGWIN problem

Postby merdem » 25 Jul 2006, 19:18

Hi all,

I can see a CYGWIN make config file under [SOME_DIR]poco-1.1.2.olduildconfig.
When I try to do the following under Win32 (XP):

set POCO_CONFIG=CYGWIN
make

After some compilation I get the following compiler error:

##############################
** Compiling src/CppUnitException.cpp (debug, shared)
g++ -Iinclude -I/cygdrive/e/distributions/poco-1.1.2/Foundation/include -I/cygdrive/e/distributions/poco-1.1.2/XML/include -I/cygdrive/e/distributions/poco-1.1.2/Util/include -I/cygdrive/e/distributions/poco-1.1.2/Net/include -I/cygdrive/e/distributions/poco-1.1.2/CppUnit/include -DPOCO_BUILD_HOST=GOBY -D_XOPEN_SOURCE=500 -D_REENTRANT -D_THREAD_SAFE -g -D_DEBUG -DPOCO_DLL -c src/CppUnitException.cpp -o /cygdrive/e/distributions/poco-1.1.2/CppUnit/obj/CYGWIN_NT-5.2/i686/debug_shared/CppUnitException.o
src/CppUnitException.cpp:14: error: definition of static data member 'CppUnit::CppUnitException::CPPUNIT_UNKNOWNFILENAME' of dllimport'd class.
src/CppUnitException.cpp:14: warning:'CppUnit::CppUnitException::CPPUNIT_UNKNOWNFILENAME' defined locally after being referenced with dllimport linkage src/CppUnitException.cpp:15: error: definition of static data member 'CppUnit::CppUnitException::CPPUNIT_UNKNOWNLINENUMBER' of dllimport'd class.
src/CppUnitException.cpp:15: warning:'CppUnit::CppUnitException::CPPUNIT_UNKNOWNLINENUMBER' defined locally after being referenced with dllimport linkage
make[1]: *** [/cygdrive/e/distributions/poco-1.1.2/CppUnit/obj/CYGWIN_NT-5.2/i686/debug_shared/CppUnitExceptio
n.o] Error 1
make[1]: Leaving directory `/cygdrive/e/distributions/poco-1.1.2/CppUnit'
make: *** [all] Error 2
##############################

The problem seems the following error:

src/CppUnitException.cpp:14: error: definition of static data member 'CppUnit::CppUnitException::CPPUNIT_UNKNOWNFILENAME' of dllimport'd class.

I tried to find an explanation for this error but couldn't find one. I am using gcc version 3.4.4 (cygming special).

Murat
merdem
 
Posts: 14
Joined: 19 Jul 2006, 22:28

Re: CYGWIN problem

Postby peter » 26 Jul 2006, 08:31

Hi Murat,
I started Cygwin support some time ago but never found the time to finish it.
So officially, it is not supported but if you find a way to make it run, we'll gladly
incorporate your changes :-)

cu,
Peter

> Hi all,
>
> I can see a CYGWIN make config file under [SOME_DIR]poco-1.1.2.olduildconfig.
> When I try to do the following under Win32 (XP):
>
> set POCO_CONFIG=CYGWIN
> make
>
> After some compilation I get the following compiler error:
>
> ##############################
> ** Compiling src/CppUnitException.cpp (debug, shared)
> g++ -Iinclude -I/cygdrive/e/distributions/poco-1.1.2/Foundation/include -I/cygdrive/e/distributions/poco-1.1.2/XML/include -I/cygdrive/e/distributions/poco-1.1.2/Util/include -I/cygdrive/e/distributions/poco-1.1.2/Net/include -I/cygdrive/e/distributions/poco-1.1.2/CppUnit/include -DPOCO_BUILD_HOST=GOBY -D_XOPEN_SOURCE=500 -D_REENTRANT -D_THREAD_SAFE -g -D_DEBUG -DPOCO_DLL -c src/CppUnitException.cpp -o /cygdrive/e/distributions/poco-1.1.2/CppUnit/obj/CYGWIN_NT-5.2/i686/debug_shared/CppUnitException.o
> src/CppUnitException.cpp:14: error: definition of static data member 'CppUnit::CppUnitException::CPPUNIT_UNKNOWNFILENAME' of dllimport'd class.
> src/CppUnitException.cpp:14: warning:'CppUnit::CppUnitException::CPPUNIT_UNKNOWNFILENAME' defined locally after being referenced with dllimport linkage src/CppUnitException.cpp:15: error: definition of static data member 'CppUnit::CppUnitException::CPPUNIT_UNKNOWNLINENUMBER' of dllimport'd class.
> src/CppUnitException.cpp:15: warning:'CppUnit::CppUnitException::CPPUNIT_UNKNOWNLINENUMBER' defined locally after being referenced with dllimport linkage
> make[1]: *** [/cygdrive/e/distributions/poco-1.1.2/CppUnit/obj/CYGWIN_NT-5.2/i686/debug_shared/CppUnitExceptio
> n.o] Error 1
> make[1]: Leaving directory `/cygdrive/e/distributions/poco-1.1.2/CppUnit'
> make: *** [all] Error 2
> ##############################
>
> The problem seems the following error:
>
> src/CppUnitException.cpp:14: error: definition of static data member 'CppUnit::CppUnitException::CPPUNIT_UNKNOWNFILENAME' of dllimport'd class.
>
> I tried to find an explanation for this error but couldn't find one. I am using gcc version 3.4.4 (cygming special).
>
> Murat
peter
 
Posts: 67
Joined: 11 Jul 2006, 16:26
Location: Austria

Re: CYGWIN problem

Postby merdem » 01 Aug 2006, 18:27

After examining the makefile structure, I believe the problem lies in the $(target)_EXPOTRS macro.

For instance, in CppUnit.h it says:

// The following block is the standard way of creating macros which make exporting
// from a DLL simpler. All files within this DLL are compiled with the CppUnit_EXPORTS
// symbol defined on the command line. this symbol should not be defined on any project
// that uses this DLL. This way any other project whose source files include this file see
// CppUnit_API functions as being imported from a DLL, wheras this DLL sees symbols
// defined with this macro as being exported.

...but nowhere in the makefile structure I see the macro $(target)_EXPORTS defined. So, during link time everything is declared as dllimport. When I add:

CXXFLAGS += -D$(target)_EXPORTS

to CppUnit makefile, CppUnit compilation unit compiles fine with success.

Of course, I might be totally wrong. This is only my gutfeeling after a short examination.

Can anybody confirm or disprove this?

Thnx,

Murat

> Hi all,
>
> I can see a CYGWIN make config file under [SOME_DIR]poco-1.1.2.olduildconfig.
> When I try to do the following under Win32 (XP):
>
> set POCO_CONFIG=CYGWIN
> make
>
> After some compilation I get the following compiler error:
>
> ##############################
> ** Compiling src/CppUnitException.cpp (debug, shared)
> g++ -Iinclude -I/cygdrive/e/distributions/poco-1.1.2/Foundation/include -I/cygdrive/e/distributions/poco-1.1.2/XML/include -I/cygdrive/e/distributions/poco-1.1.2/Util/include -I/cygdrive/e/distributions/poco-1.1.2/Net/include -I/cygdrive/e/distributions/poco-1.1.2/CppUnit/include -DPOCO_BUILD_HOST=GOBY -D_XOPEN_SOURCE=500 -D_REENTRANT -D_THREAD_SAFE -g -D_DEBUG -DPOCO_DLL -c src/CppUnitException.cpp -o /cygdrive/e/distributions/poco-1.1.2/CppUnit/obj/CYGWIN_NT-5.2/i686/debug_shared/CppUnitException.o
> src/CppUnitException.cpp:14: error: definition of static data member 'CppUnit::CppUnitException::CPPUNIT_UNKNOWNFILENAME' of dllimport'd class.
> src/CppUnitException.cpp:14: warning:'CppUnit::CppUnitException::CPPUNIT_UNKNOWNFILENAME' defined locally after being referenced with dllimport linkage src/CppUnitException.cpp:15: error: definition of static data member 'CppUnit::CppUnitException::CPPUNIT_UNKNOWNLINENUMBER' of dllimport'd class.
> src/CppUnitException.cpp:15: warning:'CppUnit::CppUnitException::CPPUNIT_UNKNOWNLINENUMBER' defined locally after being referenced with dllimport linkage
> make[1]: *** [/cygdrive/e/distributions/poco-1.1.2/CppUnit/obj/CYGWIN_NT-5.2/i686/debug_shared/CppUnitExceptio
> n.o] Error 1
> make[1]: Leaving directory `/cygdrive/e/distributions/poco-1.1.2/CppUnit'
> make: *** [all] Error 2
> ##############################
>
> The problem seems the following error:
>
> src/CppUnitException.cpp:14: error: definition of static data member 'CppUnit::CppUnitException::CPPUNIT_UNKNOWNFILENAME' of dllimport'd class.
>
> I tried to find an explanation for this error but couldn't find one. I am using gcc version 3.4.4 (cygming special).
>
> Murat
merdem
 
Posts: 14
Joined: 19 Jul 2006, 22:28

Re: CYGWIN problem

Postby peter » 04 Aug 2006, 09:08

Hi murat,
yes, confirmed. if you go to your CppUnit Makefile and change it to look like
this:

include $(POCO_BASE)/build/rules/global

SHAREDOPT_CXX += -DCppUnit_EXPORTS

it compiles fine.

But fore Foundation you have to disable the Floating point environment which is not supported by CYGWIN. Go the CYGWIN rules file and change CXXFlags to

CXXFLAGS = -DPOCO_NO_FPENVIRONMENT

Also if you don't want to set the POCO_TARGET flag before compiling,
simply open your build/rules/global file and set POCO_CONFIG to:
ifndef POCO_CONFIG
POCO_CONFIG = $(shell $(POCO_BUILD)/script/archname)
endif

Copy the following content to a file named poco/build/script/archname
(set chmod 755):
#!/bin/sh
MYARCH=`uname`
ISCYG=`echo ${MYARCH} | grep "CYGWIN"`
if [ ${ISCYG} == ${MYARCH} ]; then
echo "CYGWIN"
else
echo $ISCYG
fi

Hope that helps,
Peter

EDIT: My CYGWIN seems to have problems to find FPEnvironment_DUMMY when compiling Foundation project. Do you have the same error?

EDIT2: Found it. Not CygWin related but simply an error in FPEnvironment.h.
I've fixed it already and it will be in the next release but so that you can continue,
change the file to:
#if defined(POCO_NO_FPENVIRONMENT)
#include "Foundation/FPEnvironment_DUMMY.h"
#elif defined(__osf__) || defined(__VMS)

EDIT3: Another feature not supported by CYGWIN is std::wstring
Add the following to Foundation/UnicodeConverter. Not the best
solution but at least it compiles:

#if defined(__CYGWIN__)
#include
namespace std
{
typedef basic_string < wchar_t, char_traits < wchar_t > , allocator < wchar_t > > wstring;
};
#endif


peter
 
Posts: 67
Joined: 11 Jul 2006, 16:26
Location: Austria

Re: Re: CYGWIN problem

Postby marlowa » 13 Aug 2006, 13:19

> Hi murat,
> yes, confirmed. if you go to your CppUnit Makefile and change it to look like
> this:
>
> include $(POCO_BASE)/build/rules/global
>
> SHAREDOPT_CXX += -DCppUnit_EXPORTS
>
> it compiles fine.
[snip]
This is great news! Will this make it into the upcoming 1.2 release?
marlowa
 
Posts: 36
Joined: 19 Jul 2006, 09:02
Location: United_Kingdom

Re: CYGWIN problem

Postby mark » 29 Aug 2006, 13:58

I think the arch script has two bugs. This version should fix them:

#!/bin/sh
MYARCH=`uname`
ISCYG=`echo ${MYARCH} | grep "CYGWIN"`
if [ "${ISCYG}" = "${MYARCH}" ] ; then
echo "CYGWIN"
else
echo $MYARCH
fi
mark
 
Posts: 1
Joined: 27 Aug 2006, 15:09

Re: Re: CYGWIN problem

Postby peter » 30 Aug 2006, 07:36

As of the latest Poco version (1.2final)
this script is no longer needed.
Simply extract Poco1.2.tar.gz
run ./configure
and do a make.
Well, that would be the ideal way, unfortunately,
there is still a bug left in the generated Foundation/include/Poco/Config.h file :-(.
So after you've typed ./configure, edit this file and remove
the #undef POCO_NO_FPENVIRONMENT.
Then make will work.
cu
Peter

UPDATE: v1.2.1 is checked in which fixes CYGWIn. Should work out of the box now :-)

> I think the arch script has two bugs. This version should fix them:
>
> #!/bin/sh
> MYARCH=`uname`
> ISCYG=`echo ${MYARCH} | grep "CYGWIN"`
> if [ "${ISCYG}" = "${MYARCH}" ] ; then
> echo "CYGWIN"
> else
> echo $MYARCH
> fi
>
peter
 
Posts: 67
Joined: 11 Jul 2006, 16:26
Location: Austria


Return to Support

Who is online

Users browsing this forum: No registered users and 3 guests