error: undefined reference to 'GetCurrentFiber'

Discussion in 'Development General' started by Curly Brace, Jun 22, 2014.

  1. Curly Brace

    Curly Brace Friend of Mimigas.

    Joined:
    Jun 22, 2014
    Messages:
    4
    Likes Received:
    0
    PO Trainer Name:
    Curly Brace
    Hello.
    I am trying to compile an unmodified copy of Pokémon Online, pulled directly from the GitHub today (22/06/14) on Windows 7. I understand that when you compile on Windows, "HAS_FIBERS" is defined as true. However, when I try to compile libraries\Utilities\coro\coro.c, I get the following error:
    pokemon-online\src\libraries\Utilities\coro\Coro.c:186: error: undefined reference to `GetCurrentFiber'.
    This error appears twice; one for each instance that "GetCurrentFiber" appears in.
    I have tried defining winnt.h, where GetCurrentFiber is defined, but I still receive the same error.
    Is the source currently compilable on Windows, and if so, is there a solution?
    Thank you for your time.

    Edit: I solved my issue thanks to these steps:
     
    Last edited: Jun 23, 2014
  2. Fuzzysqurl

    Fuzzysqurl baa baa mareep I do what I want Server Owner Developer I do what I want Server Owner Developer

    Joined:
    Sep 12, 2012
    Messages:
    2,096
    Likes Received:
    967
    Just gonna be blunt: I have no idea what you're talking about (mainly because out of all the errors I've encountered, this has not been one of them), but I'll try to help anyway...

    First, the dumb question: Are you using QtCreator to compile?
    If so, continue on. If not, I'll be of zero use in this thread.

    What Build Kit are you using to compile? (I'm not sure if this matters, but hey, I already said I have no idea :] I know mine compiles perfectly fine).
    >>I have the QT 5.2.0 Kit which uses the MinGW 4.8 32bit compiler.

    When you are trying to compile, explain what you are doing.
    >>If you right click "Teambuilder" and hit "Run" it will build a Client for you. Doing the same for "Server" will build you a Server. "BattleServer" is optional to build and run separately, as "Server" will already launch it if its not running

    I know Windows can have some problems with running in Debug mode (though, I guess it needs to compile before it can even be run...) so change it to Release mode if you finally get it working, but nothing stays open when someone tries to connect.
     
  3. Curly Brace

    Curly Brace Friend of Mimigas.

    Joined:
    Jun 22, 2014
    Messages:
    4
    Likes Received:
    0
    PO Trainer Name:
    Curly Brace
    Yes, I'm using the creator.

    I'm using QT 5.3.0 with MinGW 4.8.2 32bit.
    I am trying to compile only the server and have passed CONFIG += po_server to qmake. I then rightclick Pokemon Online [master] and click build. After some time, it errors at coro.c.

    Of course, I can't change it to release yet as it does not finish compiling at all.
     
  4. Fuzzysqurl

    Fuzzysqurl baa baa mareep I do what I want Server Owner Developer I do what I want Server Owner Developer

    Joined:
    Sep 12, 2012
    Messages:
    2,096
    Likes Received:
    967
    Ah. Mine worked fine when I did that, so unfortunately I can't even try to diagnose it on my end... I tried checking various other builds, like going back in time to see if anything breaks, but everything compiles properly on my end...

    I usually just click a bunch of things and it ends up working though... Try Run qmake maybe? Try Rebuild? Try Clean? I mean, if it's already broken, there's not too much more you can do to make it worse...
     
  5. Curly Brace

    Curly Brace Friend of Mimigas.

    Joined:
    Jun 22, 2014
    Messages:
    4
    Likes Received:
    0
    PO Trainer Name:
    Curly Brace
    I ran qmake and did a rebuild, which also runs a make clean on the project. No dice, still the same error.
    The thing is, GetCurrentFiber is in winnt.h, which I have on my build system and also have defined. I don't see why it would say that it's undefined...
     
  6. SongSing

    SongSing KILLL

    Joined:
    Jan 2, 2013
    Messages:
    641
    Likes Received:
    191
    PO Trainer Name:
    SongSing
    I think I had this once, you need to change the build to release (can be done above the play/debug/build buttons in the bottom left) then build the subprojects in the correct order (libraries, other stuff), and it should be fine
     
    Curly Brace likes this.
  7. Curly Brace

    Curly Brace Friend of Mimigas.

    Joined:
    Jun 22, 2014
    Messages:
    4
    Likes Received:
    0
    PO Trainer Name:
    Curly Brace
    After a reclone of the git repo, doing that solved my problem and I compiled without issue. Thank you very much!
     
  8. SongSing

    SongSing KILLL

    Joined:
    Jan 2, 2013
    Messages:
    641
    Likes Received:
    191
    PO Trainer Name:
    SongSing
    No problem, glad to help :)
     
  9. Crystal Moogle

    Crystal Moogle Ayaya~ Administrator Administrator

    Joined:
    Jul 19, 2010
    Messages:
    3,205
    Likes Received:
    531
    PO Trainer Name:
    Hanako
    I get this problem and it makes it impossible to build in Debug in qt 5.3.2. Dunno if older versions are the same. Release is fine, just Debug.
     
  10. SongSing

    SongSing KILLL

    Joined:
    Jan 2, 2013
    Messages:
    641
    Likes Received:
    191
    PO Trainer Name:
    SongSing
    yeaa that's why i said change to release
    idk why it doesnt work in debug, probaly reasons
     
  11. WindBellKL

    WindBellKL New Member

    Joined:
    Nov 23, 2012
    Messages:
    23
    Likes Received:
    1
    I met the exactly same problem after upgrading from Qt 5.1 to Qt 5.4 and after one day searching I got this post..
    After some debugging, I found the reason:
    GetCurrentFiber() is an INLINE function, and the way to control how INLINE works changes when MinGW upgrades. For some unknown reasons (I am not a expert in MinGW anyway), when in Debug mode, GetCurrentFiber() is not treated as INLINE but an external function. However, because it is assumed to be inline, it is undefined in external. That's why we see this error, and it does not happen in Release mode.

    A dirty solution is replace all GetCurrentFiber() with (PVOID)__readfsdword(0x10), which is its definition in winnt.h. Then PO can be compiled in DEBUG mode.

    Maybe it is better if someone reports it to Qt/MinGW community to deal with this problem.
     
    coyotte508 likes this.