ObjectARX
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

ObjectArx 2012 compilation errors + loading error

4 REPLIES 4
Reply
Message 1 of 5
Anonymous
666 Views, 4 Replies

ObjectArx 2012 compilation errors + loading error

Hello everyone,    

I want to make a C++ ObjectARX 2012 project for AutoCAD 2012 SP2, using MS Visual Studio 2010 (on Windows 7 64-bits).
I was following the ObjectARX training documentation and set the "Platform Toolset" (located in the project properties under "Configuration Properties" in the "General" node) to v90 which refers to Visual Studio 2008.
I had an error telling me that Visual Studio 2008 wasn't installed on my computer. After installing it (along with the SP1), compilation failed.   
127 errors were flagged, all in standard headers like stdlib.h, 
ymath.h and float.h, to name a few. 
One example :
- error C2059: syntax error : ')'    c:\objectarx 2012\inc\stdlib.h
 
I've tried setting the "Platform Toolset" to v100 (Visual Studio 2010),  then I was able to compile properly and produce an .arx file. Unfortunately, AutoCAD 2012 wasn't able to
load the ARX (named Step01.arx):

"step01.arx is incompatible with this version of AutoCAD.
AcRxDynamicLinker failed to load 'c:\objectarx 
2012\projects\step01\debug\step01.arx'
C:\Program Files\Autodesk\AutoCAD 2012 - English\acad.exeUnable to load 
Step01.arx file."

I was wondering if the "Platform Toolset" was the main cause of the problem, or if I might have another "hidden" 
project property to modify.
I'd like to know if any of you had similar problems or have any sort of idea on how to resolve this.
Thank you in advance for your responses.

Regards,


Siwar_M

4 REPLIES 4
Message 2 of 5
maisoui
in reply to: Anonymous

Hi,

 

For Object ARX 2012, you need to set Platform Toolset to v90. Check all you preprocessor definitions (especially WINVER). An idea is to try to create and build your project/solution with Visual Studio 2008. Once everything goes ok, open the project/solution with VS2010 to migrate and ensure Platform Toolset is v90.

 

Hope it will help you.

Regards,

Jonathan

 

--
Jonathan
Message 3 of 5
Anonymous
in reply to: maisoui

Hello,

 

Thank you for your answer.

 

I've checked my preprocessor definitions :

 

WINVER                   0x0600  (Vista)

_WIN32_WINNT       0x0600  (Vista)

_WIN32_WINDOWS 0x0410  (Windows 98)

_WIN32_IE               0x0700  (IE 7.0)

 

Anything wrong about them, you think ?

 

I've tried creating the project on Visual Studio 2008, but I've run into the same problems described in the first post (involving stdlib.h, float.h, math.h).

 

Kindly,

 

Siwar_M

 

 

Message 4 of 5
maisoui
in reply to: Anonymous

Seems ok. Where "goes" Visual Studio when you right click on #include "stdlib.h" and choose Open Document "stdlib.h"? Mine is in C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\include folder. 

 

Maybe a conflict of the Windows SDK due that you installed VS 2010 first?

 

--
Jonathan
Message 5 of 5
Anonymous
in reply to: maisoui

Actually, the path taken by VS to search for stdlib.h and all other standard headers was wrong. I uninstalled and reinstalled both Visual Studio 2008 and ObjectARX 2012 and eventually got the project to compile correctly.

 

AutoCAD still wouldn't load the .arx file, because it said the version was inappropriate. So I figured It could be because AutoCAD was 64-bits and the project was targeting 32-bits. Setting the project to target 64-bits instead finally ended in pleasing AutoCAD and loading the .arx without a single error.

 

Thank you for your patience and your kindness.

Best regards,

 

Siwar_M

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost