Another problem... D:

edited March 2012 in Help request
Cactus back with another problem! :D

Well, I've started Grey's tutorials over again and things have been working fine, but when I build it (Grey's Second Tutorial right before the image of the pink background) I get this build message:
1>------ Build started: Project: project, Configuration: Debug Win32 ------
1>Compiling...
1>Main.cpp
1>c:orx_msvs_2008-devprojectmain.cpp(1) : fatal error C1083: Cannot open include file: 'StandAlone.h': No such file or directory
1>StandAlone.cpp
1>Generating Code...
1>Build log was saved at "file://c:ORX_msvs_2008-devprojectDebugBuildLog.htm"
1>project - 1 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

Since it referenced to Main.cpp here's the code for that:
#include "StandAlone.h"

int main( int argc, char** argv )
{
	orx_Execute( argc, argv, StandAlone::Init, StandAlone::Run, StandAlone::Exit );

	return 0;
}

Just tell me if you need more code to help me with the problem.

Thanks again!
--Cactus

Comments

  • edited March 2012
    Hey Cactus,

    The very first thing you do in tutorial 2 is create the StandAlone.h file -- have you done that? :) -- that error looks like it's missing.
  • edited March 2012
    That's the weird part.
    I did make StandAlone.h
    #ifndef __STANDALONE_H__
    #define __STANDALONE_H__
    
    #include "orx.h"
    
    class StandAlone
    {
    public:
    	static StandAlone* Instance();
    
    	static orxSTATUS orxFASTCALL Init();
    	static orxSTATUS orxFASTCALL Run();
    	static void orxFASTCALL Exit();
    
    protected:
    	StandAlone();
    	StandAlone(const StandAlone&);
    	StandAlone& operator= (const StandAlone&);
    
    private:
    	static StandAlone* m_Instance;
    };
    
    #endif
    
  • edited March 2012
    If StandAlone.h is in the same directory as StandAlone.cpp, I think it should work...

    One piece of advice from me is to start learning with other people's projects. The source code and the VS project files for Iarwain's tutorials are in the orx package in /orx/tutorial/src and /orx/tutorial/build, respectively.

    Since those projects are known to build correctly, you could start opening those in VS and build them immediately. Then start changing little things such as project settings or config settings until you become more comfortable.

    I hope that's helpful.
  • edited March 2012
    Hmmm.

    They're both in the same folder:
    source

    Main.cpp isn't though, would that have anything to do with it?

    EDIT: I tried moving it into the source file, but that way I couldn't open it.

    Confusing xD
  • edited March 2012
    Hello! =)

    As Grey and acksys said, StandAlone.h needs to be in the same folder than Main.cpp as you're including it from there.

    If you move Main.cpp, you have to re-add it to your solution otherwise Visual Studio won't be able to find it.

    Another option is to add your source folder in the include path list for your project, this way visual studio will look not only in the current folder of the file (where Main.cpp is) but also in any paths you added to the list.

    Does it make sense? :)
  • edited March 2012
    Could you please explain to me how to re-add it into my solution?
  • edited March 2012
    On your project: right click->add->existing item
  • edited March 2012
    I would also recommend looking for some visual studio and C/C++ tutorials. :)

    Unfortunately I don't know of any in English, but maybe someone else has some interesting links to share on that topic?
  • edited March 2012
    Ya, it's understandable. The learning curve is not small.

    Here is a lot of stuff on Visual C++: http://msdn.microsoft.com/en-us/vstudio/hh386302

    Bruce Eckel's Thinking in C++ is a very good and free book on C++ for some with a little programming experience already: http://www.mindview.net/Books/DownloadSites

    @ChaoticCactus, once again, I would recommend you begin with the project files included with the Orx source code. They are known to build properly already so you can get started picking apart projects that are already assembled for you.

    It will be less frustrating since you can take working code and start changing things to see how changes affect the result.
  • edited March 2012
    @Iarwain
    Unfortunately, Project>Add>Existing file didn't work.
  • edited March 2012
    Is there a download link for the source code? If so, where is it?
  • edited March 2012
    Get it here: http://sourceforge.net/projects/orx/files/orx/orx - 1.3rc0 (2513)/orx-src-1.3rc0.zip/download

    There are tutorial projects for all modern Visual Studio versions.
  • edited March 2012
    I've to admit I too prefer altering existing sources for learning purposes. :)

    If you use the link acksys gave you, you'll also need the *-extern-* package otherwise orx plugins won't compile.

    There's also a tutorial package matching the official tutorials from the wiki. I think all this is mentioned in the README file if you need it.

    Lastly, if you'd rather not bother with multiple downloads, there's also the option of syncing the version directly from the SVN repository on sourceforge which is much newer than the one from the downloadable packages.
  • edited March 2012
    Thanks for all your help everybody!
    I'll use that code to teach myself!
    Thanks!
    --Cactus
  • edited March 2012
    Whenever I try to build a file It says that It:

    1) Can't open file orxd.lib
    2) Can't include file SDL.h, no such file or directory.

    Should I setup SDL for vs2008?
    And what should I do about orx.lib?
    Once I solve those problems I hopefully won't have any more issues! :D
  • edited March 2012
    Hey there! =)

    Did you get the package version or the SVN one?
    If you got the src package, did you also get the extern one (which contains all the dependencies of orx' plugins)?

    Lastly, SDL is actually not needed. :)
    Are you building the embedded dynamic release/profile/debug versions? (With the emphasis on embedded dynamic)
  • edited March 2012
    Where's the download for the extern one? :P

    I got the "orx-1.3rc0" version if that's the src package.

    And, what's the embedded dynamic release?
  • edited March 2012
    The files are all here: http://sourceforge.net/projects/orx/files/orx/orx - 1.3rc0 (2513)/

    To compile orx itself you need the *-src-* and the *-extern-*.

    There are different configurations that can be used to compile ord.
    Embedded means that the plugins are embedded inside orx instead of being hotloaded at runtime.
    Dynamic means you're using the .dll version of orx, as opposed to static.
    Release = full optimization, no debug messages
    Profiler = full optimization, no debug messages, profiler available (ie. orx has been instrumented for finding CPU costs)
    Debug = slow version with all the debug messages, that's the one you use most of the time when developing

    As a reminder, all this is explained in the README file. You can find the SVN version of that file here (but it's also in all the packages).
  • edited March 2012
    Now that I have both the src and the extern downloaded, what do I do with them, I've analyzed the README but it didn't help much.

    Uuuggghhh.
    Every tutorial I try ends in failure. There's always some sort of crazy build message saying that I have this error, and that. And I have no way to fix them, it doesn't help that I'm completely new to this and am pretty clueless. Well, either way, I hope that eventually I'm able to sort it all out with the help of the Orx community. :unsure:
  • edited March 2012
    As faistoiplaisir and acksys already recommended, I think you should look for C/C++ tutorials/books for beginners.

    Compiling orx is very similar to compiling any C/C++ project. And I do think it's a pretty straightforward setup to which you need to get accustomed.

    Also, without the content of your error message and the precise description of what you did it's impossible for us to help you. :)
  • edited March 2012
    With a little search on google with term 'learn C++', I found this website : http://www.learncpp.com/

    I didn't read it, but it seems there's a lot of section, covering the beginning and more.

    Ok, it's long to read/understand/pratice, but really, you need some basics. You can't have positive result with your code if you don't understand it.

    I'm sure that there's a ton of basics tutorial where you can learn this language, google can help you ! ;)

    Another example, if you have problem to setup a simple project with Visual Studio, a google search with "visual studio tutorial" will certainly give you some good informations.

    When you have a problem, the first thing do to is: search by yourself, after that, if don't find the solution, you can ask somewhere/someone! It's the best way to learn something ;)
Sign In or Register to comment.