arxHeaders.h causing problems

arxHeaders.h causing problems

Anonymous
Not applicable
2,948 Views
9 Replies
Message 1 of 10

arxHeaders.h causing problems

Anonymous
Not applicable

Dear colleagues,

 

So far I have made simple ObjectARX code with #include of every necessary header file separately, and it was all fine, the birds were singing etc.

 

However, after some time it became boring and I saw arxHeaders.h, and I thought it would include all available ObjectARX headers at once. So I left only #include "stdafx.h" and #include <arxHeaders.h>.

 

And it seemed fine at first, IntelliSense was showing nicely, but compiling produced a lot of errors, all of them for acprofile.h and acpublishuireactors.h.

 

This is ObjectARX 2016, I marked all necessary libraries and inc folders from SDK in Visual Studio properties (and it worked nicely when I included header files one by one)

 

Is this "I will include only one header file and enjoy life" even possible?

0 Likes
Accepted solutions (2)
2,949 Views
9 Replies
Replies (9)
Message 2 of 10

Alexander.Rivilis
Mentor
Mentor

@Anonymous wrote:

 

 

...And it seemed fine at first, IntelliSense was showing nicely, but compiling produced a lot of errors, all of them for acprofile.h and acpublishuireactors.h...


Hope you can provide such errors?

Відповідь корисна? Клікніть на "ВПОДОБАЙКУ" цім повідомленням! | Do you find the posts helpful? "LIKE" these posts!
Находите сообщения полезными? Поставьте "НРАВИТСЯ" этим сообщениям!
На ваше запитання відповіли? Натисніть кнопку "ПРИЙНЯТИ РІШЕННЯ" | Have your question been answered successfully? Click "ACCEPT SOLUTION" button.
На ваш вопрос успешно ответили? Нажмите кнопку "УТВЕРДИТЬ РЕШЕНИЕ"


Alexander Rivilis / Александр Ривилис / Олександр Рівіліс
Programmer & Teacher & Helper / Программист - Учитель - Помощник / Програміст - вчитель - помічник
Facebook | Twitter | LinkedIn
Expert Elite Member

0 Likes
Message 3 of 10

Anonymous
Not applicable

Of course, I didn't want to make long post at first. Here they are:

 

1>c:\objectarx\inc\acprofile.h(91): error C2061: syntax error : identifier 'IUnknown'
1>c:\objectarx\inc\acprofile.h(93): error C2061: syntax error : identifier 'IUnknown'
1>c:\objectarx\inc\acprofile.h(95): error C2061: syntax error : identifier 'IUnknown'
1>c:\objectarx\inc\acpublishuireactors.h(143): error C2061: syntax error : identifier 'IUnknown'
1>c:\objectarx\inc\acpublishuireactors.h(170): error C2061: syntax error : identifier 'IUnknown'
1>c:\objectarx\inc\acpublishuireactors.h(214): error C2061: syntax error : identifier 'IUnknown'
1>c:\objectarx\inc\acpublishuireactors.h(252): error C2065: 'IUnknown' : undeclared identifier
1>c:\objectarx\inc\acpublishuireactors.h(252): error C2065: 'pUnk' : undeclared identifier
1>c:\objectarx\inc\acpublishuireactors.h(253): error C2065: 'pInfo' : undeclared identifier
1>c:\objectarx\inc\acpublishuireactors.h(253): error C2275: 'AcPublishUIReactorInfo' : illegal use of this type as an expression
1>          c:\objectarx\inc\acpublishuireactors.h(34) : see declaration of 'AcPublishUIReactorInfo'
1>c:\objectarx\inc\acpublishuireactors.h(254): error C2448: 'AcPublishUIReactor::OnInitPublishOptionsDialog' : function-style initializer appears to be a function definition
1>c:\objectarx\inc\acpublishuireactors.h(258): error C2065: 'IUnknown' : undeclared identifier
1>c:\objectarx\inc\acpublishuireactors.h(258): error C2065: 'pUnk' : undeclared identifier
1>c:\objectarx\inc\acpublishuireactors.h(259): error C2065: 'pInfo' : undeclared identifier
1>c:\objectarx\inc\acpublishuireactors.h(259): error C2275: 'AcPublishUIReactorInfo' : illegal use of this type as an expression
1>          c:\objectarx\inc\acpublishuireactors.h(34) : see declaration of 'AcPublishUIReactorInfo'
1>c:\objectarx\inc\acpublishuireactors.h(260): error C2448: 'AcPublishUIReactor::OnInitExportOptionsDialog' : function-style initializer appears to be a function definition
1>c:\objectarx\inc\acpublishuireactors.h(270): error C2065: 'IUnknown' : undeclared identifier
1>c:\objectarx\inc\acpublishuireactors.h(270): error C2065: 'pUnk' : undeclared identifier
1>c:\objectarx\inc\acpublishuireactors.h(271): error C2065: 'pInfo' : undeclared identifier
1>c:\objectarx\inc\acpublishuireactors.h(271): error C2275: 'AcPublishUIReactorInfo' : illegal use of this type as an expression
1>          c:\objectarx\inc\acpublishuireactors.h(34) : see declaration of 'AcPublishUIReactorInfo'
1>c:\objectarx\inc\acpublishuireactors.h(272): error C2448: 'AcPublishUIReactor::OnInitAutoPublishSettingsDialog' : function-style initializer appears to be a function definition

So, for "acprofile.h" it is the problem of declaration of class AcApProfileStorage. The rest I am not even sure where to start. I haven't used these two headers before.

 

I just installed the whole 2016 SDK and haven't touched anything (as far as I remember). Isn't it strange that these type of errors occur in this way, so to say "partly"?

0 Likes
Message 4 of 10

Alexander.Rivilis
Mentor
Mentor
Accepted solution

If you create new project with help of ObjectARX Wizard - then there is no such errors.

It is look like you create project without MFC/ATL support.

Try to add line:

#undef _AFXEXT

or next three lines:

#include <afxwin.h>				//- MFC core and standard components
#include <afxext.h>				//- MFC extensions
#include <afxcmn.h>				//- MFC support for Windows Common Controls

before line:

#include "arxHeaders.h"  

 

Відповідь корисна? Клікніть на "ВПОДОБАЙКУ" цім повідомленням! | Do you find the posts helpful? "LIKE" these posts!
Находите сообщения полезными? Поставьте "НРАВИТСЯ" этим сообщениям!
На ваше запитання відповіли? Натисніть кнопку "ПРИЙНЯТИ РІШЕННЯ" | Have your question been answered successfully? Click "ACCEPT SOLUTION" button.
На ваш вопрос успешно ответили? Нажмите кнопку "УТВЕРДИТЬ РЕШЕНИЕ"


Alexander Rivilis / Александр Ривилис / Олександр Рівіліс
Programmer & Teacher & Helper / Программист - Учитель - Помощник / Програміст - вчитель - помічник
Facebook | Twitter | LinkedIn
Expert Elite Member

0 Likes
Message 5 of 10

Anonymous
Not applicable

Dear Alex,

 

Yes, I have created project without using Wizard and it is was without MFC support.

 

Thank you for help, I will try your instructions this evening.

0 Likes
Message 6 of 10

Anonymous
Not applicable

Ok. So, step by step I keep discovering new problems.

 

Unfortunately, those #include lines which you mentioned didn't help.

 

So I tried installing from beginning Visual studio 2012 SP4, Object ARX 2016 and Object ARX 2016 wizard, to create a proper new project as recommended and to avoid any possible troubles because of wrong installations.

 

I installed ARX to c:/ObjectARX 2016 and Wizard with administrator rights and it was OK to create new project. When I finished setup of new project, I set configuration to Release and platform to x64.

 

I haven't written any code, I just tried to build a blank project, as created by wizard. I got this one error:

 

 

C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\atlmfc\include\atlwinverapi.h(29): fatal error C1189: #error :  This file requires _WIN32_WINNT to be #defined at least to 0x0403. Value 0x0501 or higher is recommended.

I have no idea what this is. I hope I'm on the right track, at least. Any idea what to do now?

0 Likes
Message 7 of 10

Anonymous
Not applicable

one more info:

 

I just noticed that wizard created a project that is somewhat strange. In properties there was "platform toolset" set to v100 and in "c/c++ general" there were additional #using directories set to c:\Program Files\AutoCAD 2011\;%(AdditionalUsingDirectories) which is completely wrong.

 

I have set Autocad 2016 directory properly during installation of wizard. And platform should be V110 (right?)

0 Likes
Message 8 of 10

Alexander.Rivilis
Mentor
Mentor

@Anonymous wrote:

one more info:

 

I just noticed that wizard created a project that is somewhat strange. In properties there was "platform toolset" set to v100 and in "c/c++ general" there were additional #using directories set to c:\Program Files\AutoCAD 2011\;%(AdditionalUsingDirectories) which is completely wrong.

 

I have set Autocad 2016 directory properly during installation of wizard. And platform should be V110 (right?)


2017-02-15_22-08-28.png

 

It is look like you have installed previous version of ObjectARX Wizard.

Відповідь корисна? Клікніть на "ВПОДОБАЙКУ" цім повідомленням! | Do you find the posts helpful? "LIKE" these posts!
Находите сообщения полезными? Поставьте "НРАВИТСЯ" этим сообщениям!
На ваше запитання відповіли? Натисніть кнопку "ПРИЙНЯТИ РІШЕННЯ" | Have your question been answered successfully? Click "ACCEPT SOLUTION" button.
На ваш вопрос успешно ответили? Нажмите кнопку "УТВЕРДИТЬ РЕШЕНИЕ"


Alexander Rivilis / Александр Ривилис / Олександр Рівіліс
Programmer & Teacher & Helper / Программист - Учитель - Помощник / Програміст - вчитель - помічник
Facebook | Twitter | LinkedIn
Expert Elite Member

0 Likes
Message 9 of 10

BerndCuder8196
Advocate
Advocate
Accepted solution

In your StdAfx.h change to this:

 

#ifndef WINVER
#define WINVER 0x501
#endif

#ifndef _WIN32_WINNT
#define _WIN32_WINNT 0x0501
#endif    

#ifndef _WIN32_WINDOWS
#define _WIN32_WINDOWS 0x0501
#endif

#ifndef _WIN32_IE
#define _WIN32_IE 0x0501
#endif

Message 10 of 10

Anonymous
Not applicable

Dear colleagues,

 

So, in the end it all worked well. Thank you for assistance. I would like to point out two things:

 

1. In my humble opinion, this topic of proper installation and settings of Object ARX, ARX Wizard and Visual Studio deserves a sticky thread at the beginning, because there are many questions in the forum regarding this.

 

2. Problematic ARX Wizard 2016 was downloaded from Autodesk official site (developer part, at the bottom of the page under "tools" section). It is attached. This Wizard makes project so that when I use x64 platform, both Release and Debug, there is mentioned problem of wrong platform v100 and old Autocad path. I have created new project with Extension DLL using MFC shared DLL and checked Autocad support.

 

This is no problem to me any more (I hope), but it should be corrected for future users.

0 Likes