Topic-icon ubuntu-16.04.1-desktop-amd64 compile mingw error

More
22 Sep 2016 04:37 #33968 by sejeong
sejeong replied.

sejeong wrote: * Add Error Message

$ export PATH="/opt/mingw/usr/bin:$PATH"
$ i686-pc-mingw32-qmake-qt5 DEFINES+=BOOST_THREAD_USE_LIB porkerth.pro
$ make release

afert error
/PokerTH-1.1.1-src/src/core/common/avatarmanager.cpp:64:9: error: reference to 'ifstream' is ambiguous
ifstream inputStream;

mingw/usr/lib/gcc/i686-w64-mingw32.static/4.9.4/include/c++/iosfwd:160:34: note:
typedef class std::basic_ofstream<char> std::ofstream

/PokerTH-1.1.1-src/src/core/common/avatarmanager.cpp:367:38: 'o' wasnot declared in this scope
if(!o.fail()){

please help (__)

The following user(s) said Thank You: Ghost__

Please Log in or Create an account to join the conversation.

More
22 Sep 2016 10:42 - 22 Sep 2016 11:00 #33971 by tahr
tahr replied.

sejeong wrote: /PokerTH-1.1.1-src/src/core/common/avatarmanager.cpp:64:9: error: reference to 'ifstream' is ambiguous
ifstreaminputStream;


Hi sejeong,

For some reason I don't know, compiler is not able to choose between std::ifstream and boost::filesystem::ifstream. There is were ambiguity is found.
You can try to modify avatarmanager.cpp and add namespace "std::" before declaration of fstream variables (do a backup of original code before any change).

I mean, in line 63-65:
struct AvatarFileState {
	std::ifstream		inputStream;
};

and in line 366:
std::ofstream o(fileName.c_str(), ios_base::out | ios_base::binary | ios_base::trunc);

Don't know the reason because I have same code, and it compiles to me without any change (for Linux). So, I think it could be because of Mingw compiler cannot choose the correct namespace or a there is compiler option missed in windows version.

PS: Let us know any progress you make.

Regards,
tahr
The following user(s) said Thank You: Ghost__

Please Log in or Create an account to join the conversation.

More
22 Sep 2016 11:38 - 22 Sep 2016 18:22 #33972 by tahr
tahr replied.
Hi sejeong,

I found the reason:

From: https://github.com/pokerth/pokerth/commit/69f820bb3d7c4dc8c838f115cb4c7ee5fd188721

Starting with Boost 1.60.0 <boost/filesystem.hpp> includes <boost/filesystem/fstream.hpp>, which declares ifstream and ofstream types that make the unqualified names ifstream and ofstream ambiguous.
The names must be qualified to refer to the std versions.


So, you must qualify fstream variables to std::, or use a previous version of boost (bad option).

Have a look at link, to see which files you must change and how, and tell us if it works.

Regards,
tahr
The following user(s) said Thank You: Ghost__, sp0ck

Please Log in or Create an account to join the conversation.

More
23 Sep 2016 04:44 #33987 by sejeong
sejeong replied.
Thank you

But add error message

Failure information is shown below

- from ../PokerTH-1.1.1-src/src/net/common/chatcleanermanager.cpp:33:
../PokerTH-1.1.1-src/src/third_party/websocketpp/websocketpp/error.hpp:125:18: error: looser throw specifier for 'virtual const char* websocketpp::error::category::name() const'
char const * name() const _WEBSOCKETPP_NOEXCEPT_TOKEN_ {

* I deeply thank you.
The following user(s) said Thank You: Ghost__

Please Log in or Create an account to join the conversation.

More
23 Sep 2016 09:31 - 23 Sep 2016 09:32 #33989 by tahr
tahr replied.

sejeong wrote: - from ../PokerTH-1.1.1-src/src/net/common/chatcleanermanager.cpp:33:
../PokerTH-1.1.1-src/src/third_party/websocketpp/websocketpp/error.hpp:125:18: error: looser throw specifier for 'virtual const char* websocketpp::error::category::name() const'
char const * name() const _WEBSOCKETPP_NOEXCEPT_TOKEN_ {

Hi, sejeong

I don't know where that error comes from, because chatcleanmanager.cpp:33, refers only to a header file: #include <net/asiosendbuffer.h>, which doesn't access to websocket libraries (directly).

Please attach FULL compilation log in a text file.

Anyway, if I have time this weekend I'll try to install MXE and compile project for Windows to see if I have same problem.

Regards,
tahr
The following user(s) said Thank You: Ghost__, sp0ck

Please Log in or Create an account to join the conversation.

More
25 Sep 2016 02:13 - 04 Oct 2016 15:12 #34062 by tahr
tahr replied.
Hi sejeong,

I successfully compiled and tested PTH (v.1.1.1) for Windows with MXE on 64bit-Ubuntu 14.04.
It's slightly different from documentation, so I'll post here how I did step by step:

1. Install MXE
#Install requirements for MXE... http://mxe.cc/#requirements
#For Debian and derivatives (such as Ubuntu)
sudo apt-get install \
    autoconf automake autopoint bash bison bzip2 flex gettext\
    git g++ gperf intltool libffi-dev libgdk-pixbuf2.0-dev \
    libtool libltdl-dev libssl-dev libxml-parser-perl make \
    openssl p7zip-full patch perl pkg-config python ruby scons \
    sed unzip wget xz-utils 

# On 64-bit Debian 
sudo apt-get install g++-multilib libc6-dev-i386

# On Debian 8 or Ubuntu 14.10 (or later)
sudo apt-get install libtool-bin

#Download MXE and build necessary packages
cd /opt
git clone https://github.com/mxe/mxe.git mingw # ./mingw folder created 
cd mingw 
sudo make gcc 
sudo make qt #takes a long time, over 1h
sudo make boost 
sudo make curl
sudo make libgsasl
sudo make sdl_mixer
sudo make tinyxml
sudo make tinyxml2
sudo make libircclient
sudo make protobuf

2. Download PTH
# Download PTH from Github 
# Choose any directory you like. I used: ~/git/windows
mkdir -p ~/git/windows
cd ~/git/windows 
git clone http://github.com/pokerth/pokerth.git # ./pokerth folder created 
cd pokerth 
# switch to stable version
git checkout stable 
# now command 'git branch' should output '* stable' 

3. Edit files to quality fstream types to "std::"
To see how, take a look at https://github.com/pokerth/pokerth/commit/69f820bb3d7c4dc8c838f115cb4c7ee5fd188721


Not necessary. Already corrected in commit: https://github.com/pokerth/pokerth/commit/65eea1d6ec4bdf63a5a08a044138d5ea4d06e2b9

4. Build PTH
cd ~/git/windows/pokerth
export PATH=/opt/mingw/usr/bin:$PATH 
# Compile. Command is slightly different from docum 
i686-w64-mingw32.static-qmake-qt4 DEFINES+=BOOST_THREAD_USE_LIB pokerth.pro 
make release

Build process leaves executable in ~/git/windows/pokerth/release/pokerth.exe
Copy executable and ~/git/windows/pokerth/data in a Windows Folder
Run it!! :D

Tested on Windows 7 and a virtualized WinXP

Hope this helps!

Regards,
tahr
The following user(s) said Thank You: Ghost__

Please Log in or Create an account to join the conversation.

Champions of

PokerTH - live

The PokerTH spectator tool.

Member Login

 advert
NOTE! This site uses cookies and similar technologies.
Cookies make it easier for us to provide you with our services. With the usage of our services you permit us to use cookies.
More information

We use cookies to personalize content and ads to offer features for social media and analyze the number of hits on our website. We also provide information about your use of our website to our partner for social media, advertising and analysis on.
http://www.google.com/intl/de/policies/privacy/partners/