Problem with Build

edited March 2012 in Help request
I finally got things working, and was following a tutorial , but when I tried to build it I got this message:
1>c:orx_msvs_2008-devprojectsourcemain.cpp(13) : error C3861: 'orxPLUGIN_DECLARE_ENTRY_POINT': identifier not found
1>c:orx_msvs_2008-devprojectsourcemain.cpp(15) : error C2065: 'orxSTATUS_SUCCESS' : undeclared identifier
1>Build log was saved at "file://c:ORX_msvs_2008-devprojectDebugBuildLog.htm"
1>project - 13 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

What am I doing wrong? D:

Comments

  • edited March 2012
    Hi !

    Can you paste here the code of your main.cpp file ? (at least the 15 first line;))

    Maybe it can be more easy to find what's wrong.
  • edited March 2012
    orxSTATUS Init()
    {
    	orxConfig_Load("../01_Object.ini");
    
    	orxInput_Load(orxSTRING_EMPTY);
    
    	orxViewport_CreateFromConfig("Viewport");
    
    	orxObject_CreateFromConfig("Object");
    
    	orxSTATUS Init(){....}
    
    	orxPLUGIN_DECLARE_ENTRY_POINT(Init);
    
    	return orxSTATUS_SUCCESS;
    }
    

    There ya go! :)
  • edited March 2012
    Hmm,

    Did you take a look at the 01_Object.c file ? (https://orx.svn.sourceforge.net/svnroot/orx/trunk/tutorial/src/01_Object/01_Object.c)

    At the begining, there's an include line :
    #include "orxPluginAPI.h"
    

    You have to add it in your code, it's not a "comment line".

    Lines beginning with "#" are not comment. It's called preprocessor directive, you can read some information here : http://en.wikipedia.org/wiki/C_preprocessor

    Without that, the C compiler know nothing about about orx's defines and/or orx's functions.

    I suggest you to read some tutorial about C development. To program something with orx it's very essential to know the basics of this language. Without that, it will be very difficult to have some result ;)

    Hope that help !
  • edited March 2012
    Oh!
    Actually, I didn't notice that part, there's so many lines of comments it's hard to distinguish what's what!

    Thanks!
  • edited March 2012
    Aw man!
    Now I'm really confused!

    Well, I added that line and this is the message that I got:
    1>c:orx_msvs_2008-devprojectsourcemain.cpp(13) : error C2601: 'Init' : local function definitions are illegal
    1>        c:orx_msvs_2008-devprojectsourcemain.cpp(4): this line contains a '{' which has not yet been matched
    1>c:orx_msvs_2008-devprojectsourcemain.cpp(15) : error C2598: linkage specification must be at global scope
    1>c:orx_msvs_2008-devprojectsourcemain.cpp(15) : error C2601: 'orxPlugin_MainInit' : local function definitions are illegal
    1>        c:orx_msvs_2008-devprojectsourcemain.cpp(4): this line contains a '{' which has not yet been matched
    1>c:orx_msvs_2008-devprojectsourcemain.cpp(13) : error C2143: syntax error : missing ';' before '...'
    1>Build log was saved at "file://c:ORX_msvs_2008-devprojectDebugBuildLog.htm"
    1>project - 4 error(s), 0 warning(s)
    ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
    

    I followed Grey's tutorial and I'm not sure what's wrong!
    Anymore help? :S
  • edited March 2012
    Hi ChaoticCactus!

    Well, there's some invalid C code in what you pasted:

    ChaoticCactus wrote:
    orxSTATUS Init()
    {
    	orxConfig_Load("../01_Object.ini");
    
    	orxInput_Load(orxSTRING_EMPTY);
    
    	orxViewport_CreateFromConfig("Viewport");
    
    	orxObject_CreateFromConfig("Object");
    
    	orxSTATUS Init(){....} <= This looks like a local function definition, and that's one of the compiler complaints
    
    	orxPLUGIN_DECLARE_ENTRY_POINT(Init); <= This shouldn't be inside any function, it's another function definition (made by a macro)
    
    	return orxSTATUS_SUCCESS;
    }
    

    So in the end, it should be something like:
    #include "orxPluginAPI.h"
    
    orxSTATUS Init()
    {
    	orxConfig_Load("../01_Object.ini");
    
    	orxInput_Load(orxSTRING_EMPTY);
    
    	orxViewport_CreateFromConfig("Viewport");
    
    	orxObject_CreateFromConfig("Object");
    
    	return orxSTATUS_SUCCESS;
    }
    
    orxPLUGIN_DECLARE_ENTRY_POINT(Init);
    
  • edited March 2012
    Well, I tried the code that you recommended and:
    1>   Creating library ..inproject_d.lib and object ..inproject_d.exp
    1>LINK : fatal error LNK1561: entry point must be defined
    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 ==========
    

    Uhh!
    This is frustrating! xD
  • edited March 2012
    Welcome to the wonderful world of C/C++! :D
    You'll see, you'll soon get used to it! ;)

    Feels to me like you're not building a dynamic library.
    Try to right click on the project->properties->configuration properties->general ConfigurationType should be Dynamic Library (.dll) *not* Application (.exe.).

    I should really take the time to change the tutorial #1-#9 and make stand alone applications with those, I'm sure they're easier for beginners.

    Anyway, I'd really recommend following Grey's tutorials for now as he has nice step-by-step instructions, and you can come back to orx's official ones later, mostly for details about specific features.

    I really wrote them while targeting experienced C/C++ users (and it's hence all my fault) while Grey targets a more beginner public.

    The hardest part is now, you'll see that things will soon clear up, don't abandon now! :)
  • edited March 2012
    Oh believe me, I'm not going to abandon after I've gotten this far!

    Thanks so much for helping me fix it. You were right, it was set to .exe not .dll, I fixed it and it works properly now.

    Thanks again!

    --Cactus
  • edited March 2012
    Glad it worked!

    But really, using plugins + launcher doesn't bring much now that making stand alones is fairly easy. :)

    It's just that I haven't taken the time to adapt my first 9 tutorials to be stand alone executables since I simplified the stand alone creation.
Sign In or Register to comment.