basic project build errors

basic project build errors

Anonymous
Not applicable
848 Views
2 Replies
Message 1 of 3

basic project build errors

Anonymous
Not applicable

I'm trying to set up a project that will use the example code in the SDK to create a line and a circle.

 

First I tried to use the ObjectARX wizard to set up, but the entrypoint doesn't even resemble anything like the documentation, so I am attempting this without it until I learn a little more about classes.

 

Anyway, I follow the instructions for setting up in VS in the "Getting Started" section in the developers guide:

 

Create Win32 project, set to DLL.

Add the lib and inc directories to the environment settings.

Choose All Configurations in project properties and set runtime library to Multi-threaded DLL (/MD)

Set output name to *.arx

Add rxapi.lib and acdb17.lib to the additional dependencies part of linker input settings

(how do you know what libraries and headers you need? Is there one that contains them all?)

 

I create a acrxEntryPoint.cpp file and add the following to it:

 

(lb sign) include "rxregsvc.h" // the post window doesn't seem to like the lb signs

(lb sign) include "acutads.h"

 

extern "C" AcRx::AppRetCode

 

acrxEntryPoint(AcRx::AppMsgCode msg, void* appId)

 

{

  switch(msg)

  {

     case AcRx::kInitAppMsg:

          acrxUnlockApplication(appId);

          acrxRegisterAppMDIAware(appId);

          acutPrintf("\nExample Application Loaded");

          break;

     case AcRx::kUnloadAppMsg:

          acutPrintf("\nExample Application Unloaded");

          break;

  }

  return AcRx::kRetOK;

}

 

I tried to compile it before I attempted any changes, and got the following:

"Did you forget to add '#include "stdafx.h"' to your source?"

 

So I added #include "stdafx.h" and that error went away, but now I have (among others below it):

"error C2653: 'AcRx' : is not a class or namespace name" pointing to the extern "C" line.

 

Am I missing a library or include statement? The intellisense seems to know it is there; whenever I type AcRx:: I get all of the choices. This is proving to be difficult to learn, any help with this would be greatly appreciated.

 

 

0 Likes
849 Views
2 Replies
Replies (2)
Message 2 of 3

Anonymous
Not applicable

OK, I got it to build w/o errors, but I don't know exactly why. I moved include "stdafx" to the top of the file, and that seemed to cure the problem. What does this header do? I found online that it precompiles everything below it for faster building, but apparently there is more to it than just speed. Also, does the header need to be included in every file where the code is trying to use something in it? I thought I read something somewhere about a pragma once statement to keep things from loading more than once if they were included in multiple locations.

0 Likes
Message 3 of 3

racsoapres
Contributor
Contributor

It is sad that nobody answers basic questions like yours here. I tried a couple but nobody answered. I suggest you to follow the tutorials made by Fernando Malar: http://arxdummies.blogspot.com

He explains how to set up minimum application with and without ARX wizard step by step. Even if you already fixed your problem, you should follow those tutorials in order to understand things related to libraries in C++. I did it and then I could many problems I faced when I started with ObjectARX.

 

There is another website: http://objectarxtutorials.com

This guy, Iosif Murariu, is open to listening suggestions to make new code samples. I tried and he made some for me and they worked very well.

 

Have a good day......Smiley Happy

0 Likes