Compiling problems

edited February 2011 in Help request
Hey all,
I figured i'd give Orx a try but can't seem to be able to set up my developing environment.

The tests project consists of:
    main.cpp standAlone.cpp standAlone.h ORXTest.ini mainMenu.ini build.bat

I'm on a windows box so i use a batch file to build the project, this is what the build file looks like:
DEL C:UsersCarlProgrammeringORXTestORXTest.exe

C:mingw64ing++ -I C:mingw64orx-1.2dev-msvs2008include -c standAlone.cpp
C:mingw64ing++ -I C:mingw64orx-1.2dev-msvs2008include -c main.cpp

C:mingw64ing++ -o ORXTest.exe standAlone.o main.o orx.lib

C:UsersCarlProgrammeringORXTestORXTest.exe

That generates a lot of undefined reference errors such as:
main.o:main.cpp:(.text+0x1502): undefined reference to `__imp_orxModule_AddDepen
dency'
main.o:main.cpp:(.text+0x1515): undefined reference to `__imp_orxModule_AddDepen
dency'
main.o:main.cpp:(.text+0x1528): undefined reference to `__imp_orxModule_AddDepen
dency'
main.o:main.cpp:(.text+0x153b): undefined reference to `__imp_orxModule_AddDepen
dency'

As if I havent linked with a library, is there something wrong with the build script or what is going on here?

Thanks in advance! :P

Comments

  • edited February 2011
    Hi C++arl and welcome here!

    You're using the Visual Studio 2008 binaries with gcc and that won't work, as you have noticed! ;)

    If you want to use gcc on windows, I'd suggest using the MinGW package instead. Inside you'll get the liborx.a for linking purposes and another version of orx.dll for execution.

    Let me know if this fixes your issue. Don't hesitate if you have any other questions! :)
  • edited February 2011
    Thanks for answering!
    You're using the Visual Studio 2008 binaries with gcc and that won't work, as you have noticed!
    Well now I feel stupid, I just took the top download :p

    Okay, so I'm now using the mingw binaries and the following build script:
    ::
    :: Skript för att kompilera och länka C/C++ kod.
    :: C++arl Feb 2011.
    
    ::Ta bort gamla filer.
    IF EXIST main.o del main.o
    IF EXIST standAlone.o del standAlone.o
    IF EXIST ORXTest.exe del ORXTest.exe
    
    :: Kompilera alla filer.
    C:mingw64ing++ -I C:mingw64orx-1.2dev-mingwinclude -c standAlone.cpp
    C:mingw64ing++ -I C:mingw64orx-1.2dev-mingwinclude -c main.cpp
    
    :: Länka ihop dom. <fil1 fil2 fil3 etc -o exenamn>
    C:mingw64ing++ standAlone.o main.o C:mingw64orx-1.2dev-mingwlibliborx.a -o ORXTest.exe
    
    :: Ta bort .o-filer.
    IF EXIST main.o del main.o
    IF EXIST standAlone.o del standAlone.o
    
    :: Kör programmet.
    IF EXIST ORXTest.exe cls
    IF EXIST ORXTest.exe ORXTest.exe
    

    But I still get the same errors as before :(

    What to do?

    EDIT: I'm on a 64-bit system, could that have something to do with it? I'm guessing the libraries are 32-bit which means I can't link with them, is there a 64-bit version of the libraries, I cant seem to find one in the downloads section?
  • edited February 2011
    Mmh, looks good to me. Which version of gcc are you using though?
    The 1.2 release was made with 4.2.x and is not compatible with latest 4.5.x. It might also be the 32b/64b difference.

    Next version, 1.3, will be compiled with gcc 4.5.x but will still be 32b, unless someone offers to compile a 64b version.

    You can get orx's source and compile it yourself. It compiles out of the box as long as you get both src and extern packages (or sync the svn, which will give you a much more recent and capable version of orx ;)).

    Hope this helps!
  • edited February 2011
    I think it probably ahs to do with 32 vs. 64 bits. That means i need a 64 bit version of liborx.a, in order to get this i downloaded the orx-src-1.2.zip but I cant find the source for the libraries? I have no idea how libraries work so I'm probably just looking in the wrong place, how do I do this?
  • edited February 2011
    You also need the orx-extern package (which contains the external dependencies for the plugins). You might want to recompile them for 64bit though, which might be annoying.
    The default plugins use the following external dependencies: SOIL, OpenAL-soft, GLFW, libsndfile and Box2D. All of these have a codelite project for compiling them with mingw.

    Are you sure it's not an incompatibility with gcc instead? Which version are you using? If it's 4.5.x, I'd recommend trying to sync the svn version as the external libraries have all been recompiled with that version of gcc. Which means you would only have to compile orx if that were to be the real issue.

    Good luck! =)
  • edited February 2011
    Yea, i've got version 4.5.3. I'll see what I can do, thanks for your help! :)
  • edited February 2011
    Np, that's why I'm here! ;)
    I suggest trying the svn and everything should work fine (orx compiles out of the box if you sync the whole /orx/trunk).
Sign In or Register to comment.