How to run from the source

Discussion in 'Development General' started by coyotte508, Nov 10, 2010.

Thread Status:
Not open for further replies.
  1. coyotte508

    coyotte508 Well-Known Member Administrator Server Owner Administrator Server Owner

    Joined:
    Apr 21, 2010
    Messages:
    6,363
    Likes Received:
    168
    Well you're using Visual Studio to compile the project instead of mingw...

    If you didn't do it on purpose, go in your project option, choose the version of Qt and choose the one named Qt 4.8.0 MingW
     
  2. StevoDuhHero

    StevoDuhHero New Member

    Joined:
    Jun 20, 2011
    Messages:
    12
    Likes Received:
    0
    I didn't do that on purpose, I've been using Qt version 4.8.1 MingW but my tool chains only options are Visual Studio and I don't know if that matters.
    [​IMG]
     
  3. coyotte508

    coyotte508 Well-Known Member Administrator Server Owner Administrator Server Owner

    Joined:
    Apr 21, 2010
    Messages:
    6,363
    Likes Received:
    168
    I see Qt 4.8.1 MSVC2010. Try to list the Qt Version available (not the toolchains) ?
     
  4. StevoDuhHero

    StevoDuhHero New Member

    Joined:
    Jun 20, 2011
    Messages:
    12
    Likes Received:
    0
  5. coyotte508

    coyotte508 Well-Known Member Administrator Server Owner Administrator Server Owner

    Joined:
    Apr 21, 2010
    Messages:
    6,363
    Likes Received:
    168
    And when you click on the Manage... button, can you add a MinGW for Qt 4.8.0 / 4.8.1 ?
     
  6. StevoDuhHero

    StevoDuhHero New Member

    Joined:
    Jun 20, 2011
    Messages:
    12
    Likes Received:
    0
  7. coyotte508

    coyotte508 Well-Known Member Administrator Server Owner Administrator Server Owner

    Joined:
    Apr 21, 2010
    Messages:
    6,363
    Likes Received:
    168
    Lol that sucks. You probably didn't install it with mingw when qt detected msvc (default install!).

    Well I made a quick fix on the source. If you download it again it *should* compile under Qt 4.7.4, so you can use MinGW 4.7.4.

    If that doesn't work, you have to find a way to install Qt with mingw and not visual studio. But that should work.
     
  8. StevoDuhHero

    StevoDuhHero New Member

    Joined:
    Jun 20, 2011
    Messages:
    12
    Likes Received:
    0
    D:<

    Issues:
    C:\Users\Steven\Desktop\HeroicClient\src\Teambuilder\serverchoice.cpp:85: error: 'InitialSortOrderRole' is not a member of 'Qt'

    Compile output:
    http://pastebin.com/B7kTX3Ch

    Should I reinstall Qt?
     
  9. coyotte508

    coyotte508 Well-Known Member Administrator Server Owner Administrator Server Owner

    Joined:
    Apr 21, 2010
    Messages:
    6,363
    Likes Received:
    168
    I fixed the code again - try again.

    You can always reinstall Qt, but it's not fun.
     
  10. StevoDuhHero

    StevoDuhHero New Member

    Joined:
    Jun 20, 2011
    Messages:
    12
    Likes Received:
    0
    Why no work :'(

    I know, I've reinstalled it 5 times or something D:<

    C:\Users\Steven\Desktop\HeroicClient\src\Teambuilder\serverchoice.cpp:85: error: unterminated argument list invoking macro "QT_VERSION_CHECK"
     
  11. kupo

    kupo Member

    Joined:
    Feb 10, 2011
    Messages:
    63
    Likes Received:
    0
    ...Why does it compile so much easier on Linux than it does on windows?
     
  12. coyotte508

    coyotte508 Well-Known Member Administrator Server Owner Administrator Server Owner

    Joined:
    Apr 21, 2010
    Messages:
    6,363
    Likes Received:
    168
    Try again. (still a fix :x)
     
  13. StevoDuhHero

    StevoDuhHero New Member

    Joined:
    Jun 20, 2011
    Messages:
    12
    Likes Received:
    0
    Thank you! It works now :D
     
  14. coyotte508

    coyotte508 Well-Known Member Administrator Server Owner Administrator Server Owner

    Joined:
    Apr 21, 2010
    Messages:
    6,363
    Likes Received:
    168
    Lol, what a relief ^^

    Well now PO is compatible with Qt 4.7, I guess that's a bonus.
     
  15. kazzaluis

    kazzaluis Member

    Joined:
    Jun 15, 2012
    Messages:
    93
    Likes Received:
    0
    i don't understand this :/ is exist a guide with imgs ???
     
  16. Blastcore

    Blastcore Developer

    Joined:
    Jul 19, 2010
    Messages:
    763
    Likes Received:
    1
    No, there's no guide with images. It's pretty easy.
     
  17. kupo

    kupo Member

    Joined:
    Feb 10, 2011
    Messages:
    63
    Likes Received:
    0
    Minor problem here for someone's build:
    Running build steps for project Utilities...
    Configuration unchanged, skipping qmake step.
    Starting: "C:\QtSDK\mingw\bin\mingw32-make.exe"
    C:/QtSDK/mingw/bin/mingw32-make.exe -f Makefile.Debug
    mingw32-make.exe[1]: Entering directory `C:/Users/Gary/Desktop/coyotte508-pokemon-online-0048b9f/src/Utilities'
    g++ -c -std=c++0x -g -frtti -fexceptions -mthreads -Wall -DQT_LARGEFILE_SUPPORT -DCORO2 -DQT_DLL -DQT_GUI_LIB -DQT_CORE_LIB -DQT_HAVE_MMX -DQT_HAVE_3DNOW -DQT_HAVE_SSE -DQT_HAVE_MMXEXT -DQT_HAVE_SSE2 -DQT_THREAD_SUPPORT -I"c:\QtSDK\Desktop\Qt\4.8.1\mingw\include\QtCore" -I"c:\QtSDK\Desktop\Qt\4.8.1\mingw\include\QtGui" -I"c:\QtSDK\Desktop\Qt\4.8.1\mingw\include" -I"c:\QtSDK\Desktop\Qt\4.8.1\mingw\include\ActiveQt" -I"debug" -I"c:\QtSDK\Desktop\Qt\4.8.1\mingw\mkspecs\win32-g++" -o debug\otherwidgets.o otherwidgets.cpp
    mingw32-make.exe[1]: Leaving directory `C:/Users/Gary/Desktop/coyotte508-pokemon-online-0048b9f/src/Utilities'
    g++: error: CreateProcess: No such file or directory
    mingw32-make.exe[1]: *** [debug/otherwidgets.o] Error 1
    mingw32-make.exe: *** [debug] Error 2
    The process "C:\QtSDK\mingw\bin\mingw32-make.exe" exited with code 2.
    Error while building project Utilities (target: Desktop)
    When executing build step 'Make'
    [/HIDE]
    I believe he's missing g++, correct? Any idea where to get it?
     
    Last edited: Aug 20, 2012
  18. TheUnknownOne

    TheUnknownOne Member

    Joined:
    Mar 28, 2011
    Messages:
    988
    Likes Received:
    3
    Try compiling with Release, not debug
     
  19. kupo

    kupo Member

    Joined:
    Feb 10, 2011
    Messages:
    63
    Likes Received:
    0
    Still same error...
     
  20. Lamperi

    Lamperi I see what you did there

    Joined:
    Apr 25, 2010
    Messages:
    2,647
    Likes Received:
    11
    Look up the mingw download link in the first post.
     
  21. Crystal Moogle

    Crystal Moogle Ayaya~ Administrator Administrator

    Joined:
    Jul 19, 2010
    Messages:
    3,205
    Likes Received:
    531
    PO Trainer Name:
    Hanako
    I can build everything fine and get it running etc, except for one small problem :x

    C:\Users\Kate\CrystalPO\src\Teambuilder\downloadmanager.cpp:172: error: 'run' is not a member of 'QtConcurrent'

    That whole part:
    Code (C++):
    1.  
    2. void DownloadManager::updateDownloaded()
    3. {
    4.     QNetworkReply *reply = qobject_cast<QNetworkReply*> (sender());
    5.  
    6.     if (!reply) {
    7.         return;
    8.     }
    9.  
    10.     reply->deleteLater();
    11.  
    12.     if (updateReady()) {
    13.         return; //sad but necessary
    14.     }
    15.  
    16.     if (reply->error()) {
    17.         QMessageBox::critical(NULL, tr("Update download failed"), reply->errorString());
    18.         return;
    19.     }
    20.  
    21.     QFileInfo info(QUrl(targetDownload).toString());
    22.  
    23.     qDebug() << "File: " << info.fileName();
    24.  
    25.     QString path = appDataPath("Updates/", true) + info.fileName();
    26.  
    27.     QFile out(path);
    28.     out.open(QIODevice::WriteOnly);
    29.  
    30.     if (!out.isOpen()) {
    31.         qDebug() << "Error when writing to file " << path << "for updates.";
    32.         return;
    33.     }
    34.  
    35.     QByteArray data = reply->readAll();
    36.  
    37.     qDebug() << "Downloaded data size: " << data.length();
    38.  
    39.     out.write(data);
    40.  
    41.     if (out.error() == QFile::NoError) {
    42.         loadCurrentUpdateId();
    43.  
    44.         QSettings settings;
    45.         settings.setValue("Updates/ZipDownloadedFor", currentUpdateId);
    46.         settings.setValue("Updates/ZipPath", path);
    47.         settings.setValue("Updates/ZipDownloaded", true);
    48.  
    49.         QtConcurrent::run(this,&DownloadManager::extractZip, path);
    50.     }
    51. }
    52.  
    [/HIDE]
    As you can see I haven't changed anything :x

    Once I comment out that line everything works fine, but that's not really a fix for it... I have the latest Mingw since as I said everything else works, I just dunno why that one doesn't work
     
    Last edited: Oct 1, 2012
  22. TheUnknownOne

    TheUnknownOne Member

    Joined:
    Mar 28, 2011
    Messages:
    988
    Likes Received:
    3
    I think it should be "QConcurrent::run". Not sure though.
     
  23. Crystal Moogle

    Crystal Moogle Ayaya~ Administrator Administrator

    Joined:
    Jul 19, 2010
    Messages:
    3,205
    Likes Received:
    531
    PO Trainer Name:
    Hanako
    Installing 4.8.3 libraries fixed it (despite the docs saying it should work on 4.8.1...) so it's solved now I guess.
     
  24. audinowho

    audinowho New Member

    Joined:
    Jan 15, 2013
    Messages:
    4
    Likes Received:
    0
    Currently trying to install Qt for Windows. Does version 5.0 work for this? (the only download for it seems to be for VS 2010) I tried installing for version 4.8.4 for Windows (minGW 4.4), but it doesn't seem to agree with the later version of minGW I've got (specifically, asking for win 32 api 3.13 when I have 3.17).

    P.S. Awesome simulator; I love that this is open source, I always wanted to contribute something like this when it comes to pokemon. :)
     
  25. coyotte508

    coyotte508 Well-Known Member Administrator Server Owner Administrator Server Owner

    Joined:
    Apr 21, 2010
    Messages:
    6,363
    Likes Received:
    168
    Qt 5.0 is not yet release for minGW so I too am stuck with 4.8.4!

    The later version of the api is fine, don't worry
     
  26. audinowho

    audinowho New Member

    Joined:
    Jan 15, 2013
    Messages:
    4
    Likes Received:
    0
    Thanks. I had to fiddle around a lot with settings here and there, but I managed to get pretty far in getting this thing set up. nmake on Qt took a monstrous amount of time to install. I've never used Qt before... I guess I'll have to take my time to familiarize myself with this IDE.

    For now I'm just trying to build and run the client. src/Utilities, src/PokemonInfo, and src/BattleManager all built without any problems. However when I tried building src/Teambuilder, this happened: http://pastebin.com/Hjy5txxa (trouble starts at line 179)

    Any tips?
     
  27. Lamperi

    Lamperi I see what you did there

    Joined:
    Apr 25, 2010
    Messages:
    2,647
    Likes Received:
    11
    It is suggested by Googling that you have compiled Qt and PO with different versions of the mingw GCC compiler. This only happens at teambuilder since it includes main-function.
     
  28. coyotte508

    coyotte508 Well-Known Member Administrator Server Owner Administrator Server Owner

    Joined:
    Apr 21, 2010
    Messages:
    6,363
    Likes Received:
    168
    Hold on, just use Qt 4.8.4, don't compile it yourself :O (i suggest that's what you meant by nmake etc...)

    If you follow the steps in the OP it should just go fine...

    I could use teamviewer to set you up otherwise. What exactly have you done?
     
  29. audinowho

    audinowho New Member

    Joined:
    Jan 15, 2013
    Messages:
    4
    Likes Received:
    0
    Oh, so compiling the Qt libraries wasn't necessary, and all that was needed was to run the first installer from the "Qt libraries 4.8.4 for Windows (minGW 4.4, 317 MB)" download on their download page?

    At this point I've done a lot of things, and the long install times kind of dragged it over a few days. I'll see if I can remember all the steps I did that led up to this point.

    But to be sure, there's no need to run configure on Qt at any point?
     
  30. coyotte508

    coyotte508 Well-Known Member Administrator Server Owner Administrator Server Owner

    Joined:
    Apr 21, 2010
    Messages:
    6,363
    Likes Received:
    168
  31. audinowho

    audinowho New Member

    Joined:
    Jan 15, 2013
    Messages:
    4
    Likes Received:
    0
    Thanks for the help. It took a few tries but I finally got the teambuilder to work and run!
     
  32. huggye

    huggye New Member

    Joined:
    Dec 28, 2010
    Messages:
    16
    Likes Received:
    0
    is PO compatible with Qt 5.1.0? I successfully compiled it in "release mode" but i can't run the exe file (Pokémon-Online.exe). if i run it directly from Qt Creator it works fine.
     
  33. coyotte508

    coyotte508 Well-Known Member Administrator Server Owner Administrator Server Owner

    Joined:
    Apr 21, 2010
    Messages:
    6,363
    Likes Received:
    168
    you need to paste all the necessary dlls in the PO folder to run it directly (look at the client install for an example)
     
  34. huggye

    huggye New Member

    Joined:
    Dec 28, 2010
    Messages:
    16
    Likes Received:
    0
  35. coyotte508

    coyotte508 Well-Known Member Administrator Server Owner Administrator Server Owner

    Joined:
    Apr 21, 2010
    Messages:
    6,363
    Likes Received:
    168
    use a program to find out what dlls PO is using when it's running in Qt creator, and paste all those dlls in its folder.
     
  36. ROMaster2

    ROMaster2 Member

    Joined:
    Oct 29, 2013
    Messages:
    63
    Likes Received:
    0
    PO Trainer Name:
    ROMaster2
    Could you update the first post's steps again to include how to properly install Qt? Either I'm incompetent or things have changed quite a bit since then.
     
  37. coyotte508

    coyotte508 Well-Known Member Administrator Server Owner Administrator Server Owner

    Joined:
    Apr 21, 2010
    Messages:
    6,363
    Likes Received:
    168
  38. ROMaster2

    ROMaster2 Member

    Joined:
    Oct 29, 2013
    Messages:
    63
    Likes Received:
    0
    PO Trainer Name:
    ROMaster2
    Thanks, I must have been installing the wrong one.

    I've managed to get it to build and run the server, but I end up running into a lot of errors: http://pastebin.com/9xPWb0hg

    I'm using the files from the latest build from po-server-goodies. I'm running it from a folder in My Documents.
     
    Last edited: Nov 10, 2013
  39. coyotte508

    coyotte508 Well-Known Member Administrator Server Owner Administrator Server Owner

    Joined:
    Apr 21, 2010
    Messages:
    6,363
    Likes Received:
    168
    The errors are script errors. The server works fine.
     
  40. coyotte508

    coyotte508 Well-Known Member Administrator Server Owner Administrator Server Owner

    Joined:
    Apr 21, 2010
    Messages:
    6,363
    Likes Received:
    168
    It's a warning, and changing the order of includes breaks it.
     
Thread Status:
Not open for further replies.