SVN ORX and visual C++ 2010

edited February 2010 in Help request
Im trying to install ORX to visual C++ 2010 express.

This is what happens when trying to debug.
Installed using this guide: http://orx-project.org/wiki/en/orx/tutorials/setup_msvs
And some improvisation, but i cant get it to work.

(I did do some searching before asking, no results.)
1>------ Build started: Project: 01_Object, Configuration: Debug Win32 ------
1>C:Program Files (x86)MSBuildMicrosoft.Cppv4.0Microsoft.CppBuild.targets(935,5): warning MSB8012: TargetPath(c:usersjuhadocumentsvisual studio 2010ProjectsmainDebug1_Object.exe) does not match the Linker's OutputFile property value (C:UsersJuhaDocumentsVisual Studio 2010Projectsin1_Object_d.exe). This may cause your project to build incorrectly. To correct this, please make sure that $(OutDir), $(TargetName) and $(TargetExt) property values match the value specified in %(Link.OutputFile).
1>C:Program Files (x86)MSBuildMicrosoft.Cppv4.0Microsoft.CppBuild.targets(937,5): warning MSB8012: TargetName(01_Object) does not match the Linker's OutputFile property value (01_Object_d). This may cause your project to build incorrectly. To correct this, please make sure that $(OutDir), $(TargetName) and $(TargetExt) property values match the value specified in %(Link.OutputFile).
1>     Creating library c:usersjuhadocumentsvisual studio 2010ProjectsmainDebug1_Object.lib and object c:usersjuhadocumentsvisual studio 2010ProjectsmainDebug1_Object.exp
1>LINK : fatal error LNK1561: entry point must be defined
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

Comments

  • edited February 2010
    Hi juha!

    I haven't vs 2010 express at home yet, but I think I know the issue. Grey's tutorial was for creating a new project for a stand alone executable made with orx.
    However, tutorials #1 - #9 are plugins projects (ie. a .DLL not a .EXE) to be used with orx launcher (orx.exe/orxd.exe). I suggest you use the vs2008 solution from the tutorial package in /build/msvs2008 and load it with vs express 2010, I presume it will then convert the solution to the new format and you'll have all the tutorials ready for compiling.

    If you still want to start with an empty project from scratch, you can do so with the source code from tutorial #10 or #11 (they both are stand alones).
    I'll probably convert all the tutorials to stand alone in the future and provide express 2010 pre-compiled files but it won't happen before a couple of months.
  • edited February 2010
    Thank you for your fast reply.

    I have managed to get the linker things straight.

    But the problem's still there.
    It goes away when putting int main(){} in the beginning, but then the program just flashes, and doesn't run the rest.

    I also tried loading the solution from orx utorialuildmsvs2008 and converting them, but they wont compile.
    1>------ Build started: Project: 01_Object, Configuration: Debug Win32 ------
    1>  01_Object.c
    1>     Creating library c:usersjuhadocumentsvisual studio 2010projectsin1_Object.lib and object c:usersjuhadocumentsvisual studio 2010projectsin1_Object.exp
    1>LINK : fatal error LNK1561: entry point must be defined
    ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
    

    This is compiling tutorial 11
    1>------ Rebuild All started: Project: 11_Spawner, Configuration: Dynamic Release Win32 ------
    1>  11_Spawner.c
    1>C:Program Files (x86)MSBuildMicrosoft.Cppv4.0Microsoft.CppBuild.targets(935,5): warning MSB8012: TargetPath(C:UsersJuhaDocumentsVisual Studio 2010Projects	utorialuildmsvs2008Dynamic Release11_Spawner.exe) does not match the Linker's OutputFile property value (C:UsersJuhaDocumentsVisual Studio 2010Projects	utorialinmsvs200811_Spawner.exe). This may cause your project to build incorrectly. To correct this, please make sure that $(OutDir), $(TargetName) and $(TargetExt) property values match the value specified in %(Link.OutputFile).
    1>LINK : fatal error LNK1181: cannot open input file 'orx.lib'
    ========== Rebuild All: 0 succeeded, 1 failed, 0 skipped ==========
    
  • edited February 2010
    juha wrote:
    Thank you for your fast reply.

    NP :)
    I have managed to get the linker things straight.

    But the problem's still there.
    It goes away when putting int main(){} in the beginning, but then the program just flashes, and doesn't run the rest.

    That means you're linking to create an executable instead of a dynamic library as it's looking for an entry point. Adding a main won't make it work, unfortunately. I'll see if there's something I'm missing as soon as I have a working vs2010 installed at home.
    I also tried loading the solution from orx utorialuildmsvs2008 and converting them, but they wont compile.

    I'll try to get vs express 2010 on my computer during the week as soon as I find enough time for that and I'll try on my side.
    1>------ Build started: Project: 01_Object, Configuration: Debug Win32 ------
    1>  01_Object.c
    1>     Creating library c:usersjuhadocumentsvisual studio 2010projectsin1_Object.lib and object c:usersjuhadocumentsvisual studio 2010projectsin1_Object.exp
    1>LINK : fatal error LNK1561: entry point must be defined
    ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
    

    This is compiling tutorial 11
    1>------ Rebuild All started: Project: 11_Spawner, Configuration: Dynamic Release Win32 ------
    1>  11_Spawner.c
    1>C:Program Files (x86)MSBuildMicrosoft.Cppv4.0Microsoft.CppBuild.targets(935,5): warning MSB8012: TargetPath(C:UsersJuhaDocumentsVisual Studio 2010Projects	utorialuildmsvs2008Dynamic Release11_Spawner.exe) does not match the Linker's OutputFile property value (C:UsersJuhaDocumentsVisual Studio 2010Projects	utorialinmsvs200811_Spawner.exe). This may cause your project to build incorrectly. To correct this, please make sure that $(OutDir), $(TargetName) and $(TargetExt) property values match the value specified in %(Link.OutputFile).
    1>LINK : fatal error LNK1181: cannot open input file 'orx.lib'
    ========== Rebuild All: 0 succeeded, 1 failed, 0 skipped ==========
    

    There's a difference in output paths here: a Dynamic Release has been added by visual 2010. Also he's not finding orx.lib which should be in the tutorial/lib/msvs2008 folder. So again I suspect something weird happening with the paths when converting the project to vs2010. :dry:

    I'll have a pretty busy week but I'll try to find some time so that you can get started as it's frustrating to get stuck with silly linking issue.
    I totally know the feeling: that was exactly what happened to me yesterday for many hours when trying to build an iPhone executable with orx: I kept getting mystical linking errors I've never seen in 15 years of coding! :S
  • edited February 2010
    I just updated the svn repository with all the files for msvs2010, including all the project files + external library binaries + tutorial binaries.

    Everything should work even if you get some warning when compiling about paths being different. I'll clean all this mess later, probably for the next release. :)

    Also I'm adding the orx-dev-msvs2010 and orx-tutorial-msvs2010 packages to the sourceforge files (they should be there before tonight).

    If you have any trouble with the new files, please let me know! :)
  • edited February 2010
    The sounds great! I'm glad the issues with MSVS 2010 are already being hammered out. I checked out the beta earlier and was hoping that Orx would be available once Visual C++ 2010 was fully released! It looks like my wish is already coming true!
  • edited May 2010
    I had exactly the same problem with VS 2008. Now I know it is because the tutorial is about making a .dll. (The tutorial shows .exe as output.) http://grey.orx-project.org/tutorial_data/tutorial_1/9_Linker.png

    Otherwise, the tutorials & support is much better than elsewhere.
  • edited May 2010
    Ahh, never noticed this topic before! Yes, my tutorials (which include the Visual Studios introduction) are about making a stand-alone application that uses ORX dynamic libraries (dlls). The standard tutorials #1 though #9 work on the principal of using the Prebuilt ORX executable, and creating "game" dlls which are then loaded.

    If you wish to see what I do differently with ORX, there's a link in my signature to my tutorial set. Which is also available at the bottom of the tutorials wiki page.
  • edited May 2010
    Grey was faster than lightning, as usual! :)

    So yes, tutorial #1-#9 are confusing as they create plugins for orx launcher. Tutorials 10&11 are for making stand alones though. But it's probably better to go with Grey's ones from the beginning as they as much more easy to understand. :)

    I'm glad you enjoy the wiki and orx so far, let us know if you have any other questions/concerns/comments! :)
  • edited May 2010
    Thanks for the timely feedback! :lol:

    I went back to project -> linker properties and...
    1. changed output file to .dll
    2. set Init as entry point symbol.
    3. set Subsystem to Windows/Console.

    Those should probably go at the end of the existing tutorial.
    (VS 2008 Screenshots included)
    entrypt.PNG

    That being said, it still doesn't work. I'm still pretty sure the last steps are needed because the linker won't generate a dll image without them.
    Now the builds with no errors or warnings, but when I run "orx hellorx_d.dll" from command line, nothing shows up on screen or in debug log. If I use -c switch (like the demos) it crashes. The .ini file is in same folder.

    I'll try building the standalone later. I prefer this "old school" way even though it can be a headache at first because if an .exe is made & I can get the debugger to step into my source code, the way is clear.
    entrypt 33.2K
  • edited May 2010
    mpbell wrote:
    Thanks for the timely feedback! :lol:

    Our pleasure! :D
    I went back to project -> linker properties and...
    1. changed output file to .dll
    2. set Init as entry point symbol.
    3. set Subsystem to Windows/Console.

    So, normally you shouldnt put any entry point, orx will scan the dll till it find its own entry point (declared by the macro you used, so it's not Init :)).

    The subsystem shouldn't matter for a .dll, console is a good settings.

    You also need to adjust a couple of things like no manifest, linking against the non-dll version of visual C library runtime, ...
    It's a sweet nightmare but you can just download the corresponding orx-tutorial-* package and see how the projects setups are done there. :)
    Those should probably go at the end of the existing tutorial.
    (VS 2008 Screenshots included)
    entrypt.PNG

    I was more thinking of replacing all the plugins tutorials by stand alone ones. :D Simply it takes time to update all the project files + wiki, and I'd rather focus on the 1.2 release (iPhone + SDL/OpenGL/OpenAL) for now.
    That being said, it still doesn't work. I'm still pretty sure the last steps are needed because the linker won't generate a dll image without them.
    Now the builds with no errors or warnings, but when I run "orx hellorx_d.dll" from command line, nothing shows up on screen or in debug log. If I use -c switch (like the demos) it crashes. The .ini file is in same folder.

    The -c switch only takes config files as parameters. Adding the dll on the command line won't change anything either.
    In order to load your dll, you need to specify it inside orx.ini (look at the GameFile config property). Again, you can download the tutorial package and see how things are done with it. But if I were you I'd directly make a stand alone! ;)
    I'll try building the standalone later. I prefer this "old school" way even though it can be a headache at first because if an .exe is made & I can get the debugger to step into my source code, the way is clear.

    And it's definitely easier to setup in visual studio. Even the required code is now very short with only 3 callbacks to define and a single function call to initialize and run orx. The plugins were a valid alternative back in the days when creating a stand alone with orx was really painful. :)
  • edited May 2010
    I studied the tutorials closely & made sure the compiling/linking options in the command line matched but no love was to be found. :(

    A wiser man might give up at this point but let me assure you, I am not he! On to the standalone!

    If this works, I will save you the tutorial rewrite & post every step for a Hello World type tutorial. (With a bit more spice, of course.)
  • edited May 2010
    Wish I'd seen this earlier. Look at my tutorials (link in my signature) that's -exactly- what it does. Step by step, stand alone project, introducing quite a few things that ORX does.

    I've tried to write them so someone who's never touched a compiler before can at least have a go at this.

    Either way, good luck!

    <edit>
    ugh... okay just to be clear, my tutorials are how to create -using- orx, not compile orx itself.

    If the issue is compiling orx, please disregard my comments :(
    </edit>
  • edited May 2010
    Your tutorial was great! I always find that stuff after banging my head against the wall.

    All I had to do was follow the directions... >.> <.<

    I didn't have any problems compiling, just copying the right project options. Your screen shots did most the work for me.

    Thanks a million! :woohoo:
  • edited May 2010
    Glad to be of help, truth be told, I wrote those tutorials as a way of teaching myself how to use ORX. So the fact they're sane is pure coincidence *laughs*
  • edited May 2010
    Btw, we're still waiting for the next tutorial! ^^

    Did you decide what you wanted to put in it?
    Hint, hint: FX could be nice as they're an unusual feature for game engines. ;)
  • edited May 2010
    I've a fairly good idea what I want to do with the next tutorial, however I'm currently living without a working video card. (hardware takes down my computer when I do -any- 3d rendering)... so I won't be working on the next tute 'till I can replace that :P
  • edited May 2010
    Or you can contribute with a text-based render plugin! :P
  • edited May 2010
    haha, almost sounds like a fun project, if ridiculous XD
  • edited May 2010
    I wish someone will add display/render plugins using libcaca one day! :D
    http://caca.zoy.org/wiki/libcaca
Sign In or Register to comment.