Ошибка компилятора c3646

I modified my project and after compiling there pop up some weird error. #ifndef BART_RAY_TRACER_MESH_H #define BART_RAY_TRACER_MESH_H #include #include "assert.h" #include "vec3f....

I modified my project and after compiling there pop up some weird error.

#ifndef BART_RAY_TRACER_MESH_H
#define BART_RAY_TRACER_MESH_H

#include <vector>
#include "assert.h"
#include "vec3f.h"

class Triangle;

class Mesh {
public:
    uint32_t nverts;
    bool _is_static;
    vec3f *verts;
    vec3f *_verts_world;
    Material material; 
    // 2 error occurs at the line below
    Matrix4x4 _trans_local_to_world; // '_trans_local_to_world': unknown override specifier & missing type specifier - int assumed. Note: C++ does not support default-int
    Matrix4x4 _trans_local_to_world_inv;
    TransformHierarchy *_trans_hierarchy;   

    std::vector<Triangle* > triangles;
    // ...
};
#endif

When I change the order of the declaration a little bit, the error always occurs the line after Material material, but with different message:

#ifndef BART_RAY_TRACER_MESH_H
#define BART_RAY_TRACER_MESH_H

#include <vector>
#include "assert.h"
#include "vec3f.h"

class Triangle;

class Mesh {
public:
    uint32_t nverts;
    bool _is_static;
    vec3f *verts;
    vec3f *_verts_world;
    Material material; 
    // 2 error occurs at the line below
    TransformHierarchy *_trans_hierarchy; // error C2143: syntax error: missing ';' before '*' & error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
    Matrix4x4 _trans_local_to_world;
    Matrix4x4 _trans_local_to_world_inv;  

    std::vector<Triangle* > triangles;
    // ...
};
#endif

I’ve searched for similar questions on SO but none seems useful.
I’ve checked my vec3f, Triangle class definition in case there are missing semicolons but I can’t find any.

Can any one help?

asked Sep 13, 2017 at 3:18

jinglei's user avatar

jingleijinglei

3,18910 gold badges24 silver badges46 bronze badges

5

This is just another Microsoft cock-up. Here it is in essence:

class C
  {
  x y ;
  } ;

If you submit this to a sensible compiler like g++, it gives you a helpful error message:

3:2: error: ‘x’ does not name a type

MSVC, on the other hand, comes up with this gibberish:

(3): error C3646: ‘y’: unknown override specifier
(3): error C4430: missing type specifier — int assumed. Note: C++ does not
support default-int

With this key, you can decrypt Microsoft’s error message into:

error: ‘Matrix4x4’ does not name a type

answered Oct 26, 2019 at 14:19

TonyK's user avatar

TonyKTonyK

16.5k4 gold badges36 silver badges71 bronze badges

The error is most likely because that TransformHierarchy and Matrix4x4 are not defined.

If they are not defined in "assert.h" and "vec3f.h", this should be the case.

Forward declaration is enough only when you use the reference types and/or pointer types only. Therefore, to forward declare Triangle is OK. But forward declare Triangle does not mean your shape.h is processed. Neither does your material.h which is included in shape.h.

Therefore, all names in material.h is not visible from this code.
TransformHierarchy and Matrix4x4 are not recognized by the compiler.
Many of the compliers will complain with words similar to "missing type specifier - int assumed"

answered Sep 13, 2017 at 4:17

doraemon's user avatar

doraemondoraemon

2,2081 gold badge16 silver badges33 bronze badges

In my case, it was found that a header file had the following directives for a class [ie, myComboBoxData]

#ifndef __COMBOBOXDATA__
#define __COMBOBOXDATA__
// ... 
class myComboBoxData
{
    // ...
}
#endif

As another class below tried to use myComboBoxData class

class TypeDlg : public CDialog
{
    myComboBoxData cbRow,cbCol;
    // ...
}

the error message popped up as above:

«error C3646: ‘cbRow’: unknown override specifier».

Solution:

The problem was the directive name (__COMBOBOXDATA__) was already used by OTHER header.

Thus, make sure to use some other name like (__myCOMBOBOXDATA__).

answered May 31, 2020 at 5:56

Meung Kim's user avatar

I use Visual Studio 2015 and I have a C# Application-Project that defines a COM-Interface and generates a .tlb file on compilation. Now I want to import that Csharp.tlb into an idl.

MyLibrary.idl:

import "oaidl.idl";
import "ocidl.idl";
import "Cplusplus.idl";

library MyLibrary
{
  importlib("stdole32.tlb");
  importlib("stdole2.tlb");
  importlib("Csharp.tlb");

  interface IMyCOM : IDispatch
  {
    [propget, id(1)]
    HRESULT CpluplusObject
    (
      [out,retval] ICplusplusObject** cplusplusObject
    );

    [propget, id(2)]
    HRESULT CsharpObject
    (
      [out, retval] ICsharpObject** csharpObject
    );
  }

  coclass MyCOM
  {
    [default] interface IMyCOM;
  };
}

During compilation I get an error

C3646 ‘csharpObject’: unknown override specifier in MyLibrary.tlh

MyLibrary.tlh was auto generated by the compilation and looks as the following

MyLibrary.tlh:

#pragma once
#pragma pack(push, 8)

#include <comdef.h>

namespace MyLibrary {

  struct __declspec(uuid("8e664998-bc93-48e7-adcc-84fc8598cd5d"))
  /* dual interface */ ICplusplusObject;

  _COM_SMARTPTR_TYPEDEF(ICplusplusObject, __uuidof(ICplusplusObject));

  struct __declspec(uuid("388ebf11-05c8-4b86-b2bd-60f0ef38695e"))
  IMyLibrary : IDispatch
  {
    __declspec(property(get=GetCplusplusObject))
    ICplusplusObjectPtr cplusplusObject;
    __declspec(property(get=GetCsharpObject))
    ICsharpObjectPtr csharpObject;

    ICplusplusObjectPtr GetCplusplusObject ( );
    ICsharpObjectPtr GetCsharpObject ( );

    virtual HRESULT __stdcall get_CplusplusObject (
      /*[out,retval]*/ struct ICplusplusObject * * cplusplusObject ) = 0;
    virtual HRESULT __stdcall get_CsharpObject (
      /*[out,retval]*/ struct ICsharpObject * * csharpObject ) = 0;
  }

  __declspec(implementation_key(1)) ICplusplusObjectPtr IMyLibrary::GetcplusplusObject ( );
  __declspec(implementation_key(2)) ICsharpObjectPtr IMyLibrary::GetcsharpObject ( );
}

The error means that ICsharpObjectPtr or ICsharpObject respectively is not known which I understand so far. ICplusplusObjectPtr is known because import «ICplusplus.idl» added the definitions into the .tlh and importlib(«ICsharp.tlb»); did not obviously.

For Test reasons I generated the ICsharp.idl out of the .tlb by using OLE/COM Object Viewer and made an import of that idl. The error was gone after that.

But why does the importlib of the .tlb not work directly? I do not want to generate an idl file every time out of the .tlb.

I think that there is an #include «ICsharp.tlh» missing or something to make the type known for the .tlh. But how to tell the idl or the compiler to properly reference the ICsharpObject?

Thank you so much in advance for your help.

I use Visual Studio 2015 and I have a C# Application-Project that defines a COM-Interface and generates a .tlb file on compilation. Now I want to import that Csharp.tlb into an idl.

MyLibrary.idl:

import "oaidl.idl";
import "ocidl.idl";
import "Cplusplus.idl";

library MyLibrary
{
  importlib("stdole32.tlb");
  importlib("stdole2.tlb");
  importlib("Csharp.tlb");

  interface IMyCOM : IDispatch
  {
    [propget, id(1)]
    HRESULT CpluplusObject
    (
      [out,retval] ICplusplusObject** cplusplusObject
    );

    [propget, id(2)]
    HRESULT CsharpObject
    (
      [out, retval] ICsharpObject** csharpObject
    );
  }

  coclass MyCOM
  {
    [default] interface IMyCOM;
  };
}

During compilation I get an error

C3646 ‘csharpObject’: unknown override specifier in MyLibrary.tlh

MyLibrary.tlh was auto generated by the compilation and looks as the following

MyLibrary.tlh:

#pragma once
#pragma pack(push, 8)

#include <comdef.h>

namespace MyLibrary {

  struct __declspec(uuid("8e664998-bc93-48e7-adcc-84fc8598cd5d"))
  /* dual interface */ ICplusplusObject;

  _COM_SMARTPTR_TYPEDEF(ICplusplusObject, __uuidof(ICplusplusObject));

  struct __declspec(uuid("388ebf11-05c8-4b86-b2bd-60f0ef38695e"))
  IMyLibrary : IDispatch
  {
    __declspec(property(get=GetCplusplusObject))
    ICplusplusObjectPtr cplusplusObject;
    __declspec(property(get=GetCsharpObject))
    ICsharpObjectPtr csharpObject;

    ICplusplusObjectPtr GetCplusplusObject ( );
    ICsharpObjectPtr GetCsharpObject ( );

    virtual HRESULT __stdcall get_CplusplusObject (
      /*[out,retval]*/ struct ICplusplusObject * * cplusplusObject ) = 0;
    virtual HRESULT __stdcall get_CsharpObject (
      /*[out,retval]*/ struct ICsharpObject * * csharpObject ) = 0;
  }

  __declspec(implementation_key(1)) ICplusplusObjectPtr IMyLibrary::GetcplusplusObject ( );
  __declspec(implementation_key(2)) ICsharpObjectPtr IMyLibrary::GetcsharpObject ( );
}

The error means that ICsharpObjectPtr or ICsharpObject respectively is not known which I understand so far. ICplusplusObjectPtr is known because import «ICplusplus.idl» added the definitions into the .tlh and importlib(«ICsharp.tlb»); did not obviously.

For Test reasons I generated the ICsharp.idl out of the .tlb by using OLE/COM Object Viewer and made an import of that idl. The error was gone after that.

But why does the importlib of the .tlb not work directly? I do not want to generate an idl file every time out of the .tlb.

I think that there is an #include «ICsharp.tlh» missing or something to make the type known for the .tlh. But how to tell the idl or the compiler to properly reference the ICsharpObject?

Thank you so much in advance for your help.

I have been migrating the VC6 project into VS2010 compiler. Project compiles good with VC6 version but not VS2010. Here is the code snippet. Any help or guidance would be really appreciated.

grdictrl.h

class CTndGXDICtrl : public CGXEditControl
{
int DECLARE_CONTROL(CTndGXDICtrl);

// Construction
public:
CTndGXDICtrl(CGXGridCore* pGrid, UINT nID, DWORD dwContext);
DECLARE_DYNAMIC(CTndGXDICtrl)

// Attributes
public:
CDataItemRef*
GetDataItemRef(int nRow, int nCol);
CDataEntity::deType GetTargetType(int nRow, int nCol);
DWORD GetContext(int nRow, int nCol);
void SetContext(int nRow, int nCol, CProject* pProj, DWORD dwContext);
CProject*
GetProject(int nRow, int nCol);
void SetTargetType(int nRow, int nCol, CDataEntity::deType eType);
void EmptyDataItemRef(int nRow, int nCol);
void Empty(int nRow, int nCol);
BOOL IsDataModified(int nRow, int nCol);
void SetDataModified(int nRow, int nCol, BOOL b);
// Operations
public:
//
// Returns true if the edit control is in the state to find an array index
//
BOOL CTndGXDICtrl::CanFindArrayIndex();

//
// Update a local/param entry — a CLocal/CParam
//
BOOL UpdateLocalParamEntry(CDataEntity* pDE);

//
// right mouse menu for Find and Instant XRef
//
void LoadRightMouseMenu(CPoint point, BOOL bEnableLocal);

BOOL ParseAndAssignDataItemRef(ROWCOL row, ROWCOL col, const CString& cs);
BOOL ParseAndAssignDataItemRef(const CString& cs);

// Overrides

// CGXControl interface
virtual BOOL OnValidate(ROWCOL row, ROWCOL col, const CString& s);
virtual BOOL OnValidate();
virtual BOOL OnLeftCell(ROWCOL nNewRow, ROWCOL nNewCol);
virtual BOOL OnGridChar(UINT nChar, UINT nRepCnt, UINT nFlags);
virtual BOOL LButtonDblClk(UINT nFlags, CPoint point);

virtual BOOL ValidatePaste(const CString& sPaste);
virtual BOOL SetControlText(ROWCOL nRow, ROWCOL nCol, const CString& str, UINT nFlags, const CGXStyle* pOldStyle);

// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CTndGXDICtrl)
public:
virtual BOOL PreTranslateMessage(MSG* pMsg);
protected:
virtual BOOL OnCommand(WPARAM wParam, LPARAM lParam);
//}}AFX_VIRTUAL

// Implementation
public:
virtual ~CTndGXDICtrl();

private:
void GetAllOidsForXref(CDWordArray& arrOids);

// Generated message map functions
protected:
//{{AFX_MSG(CTndGXDICtrl)
afx_msg void OnChar(UINT nChar, UINT nRepCnt, UINT flags);
afx_msg void OnLButtonDblClk(UINT nFlags, CPoint point);
afx_msg void OnRmouseFindGlobalDi();
afx_msg void OnRmouseFindLocalDi();
afx_msg void OnRmouseInstantXref();
//}}AFX_MSG
LRESULT OnPostedReturnDataItem(WPARAM, LPARAM);

DECLARE_MESSAGE_MAP()

BOOL m_bInOnChange;
BOOL m_bAutoComplete;
BOOL m_bIgnoreKillFocusForFind;

BOOL DoAutoComplete();
CDIControlInfo* GetDIC(int nRow, int nCol);

};

gridctrl.cpp

#include «stdafx.h»

#include «dbg.h»
#include «dbifexp.h»
#include «gridctrl.h»
#include «launch.h»
#include «tagparse.h»
#include «tndmsgs.h»
#include «resource.h»

#ifdef _DEBUG
#define new DEBUG_NEW
#endif
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;

#import «..binpb.tlb» named_guids //raw_interfaces_only

IMPLEMENT_CONTROL(CTndGXDICtrl, CGXEditControl)
IMPLEMENT_DYNAMIC(CTndGXDICtrl, CGXEditControl)

#define GRID_WARNING(IDP)
{
CString cs;

VERIFY(cs.LoadString(IDP));

Grid()->SetWarningText(cs);

}

/////////////////////////////////////////////////////////////////////////////
// CTndGXDICtrl

CTndGXDICtrl::CTndGXDICtrl(CGXGridCore* pGrid, UINT nID, DWORD dwContext)
: CGXEditControl(pGrid, nID)
{
m_bInOnChange = FALSE;
m_bAutoComplete = TRUE;
m_bIgnoreKillFocusForFind = FALSE;
}

CTndGXDICtrl::~CTndGXDICtrl()
{
}

BEGIN_MESSAGE_MAP(CTndGXDICtrl, CGXEditControl)
//{{AFX_MSG_MAP(CTndGXDICtrl)
ON_WM_CHAR()
ON_WM_LBUTTONDBLCLK()
ON_COMMAND(ID_RMOUSE_FIND_GLOBAL_DI, OnRmouseFindGlobalDi)
ON_COMMAND(ID_RMOUSE_FIND_LOCAL_DI, OnRmouseFindLocalDi)
ON_COMMAND(ID_RMOUSE_INSTANT_XREF, OnRmouseInstantXref)
//}}AFX_MSG_MAP
ON_MESSAGE(TND_RETURNED_DATAITEM, OnPostedReturnDataItem)
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CTndGXDICtrl message handlers
void CTndGXDICtrl::EmptyDataItemRef(int nRow, int nCol)
{
CDIControlInfo* pDIC = GetDIC(nRow, nCol);
if (NULL != pDIC)
{
CDataItemRef* pDIR = NULL;
pDIR = &(pDIC ->m_cDataItemRef);
pDIR ->Empty();
}
}

void CTndGXDICtrl::Empty(int nRow, int nCol)
{
CDIControlInfo* pDIC = GetDIC(nRow, nCol);
if (NULL != pDIC)
{
CDataItemRef* pDIR = NULL;
pDIR = &(pDIC ->m_cDataItemRef);
pDIR ->Empty();
SetTargetType(nRow, nCol, CDataEntity::deNull);
}
}
CDIControlInfo* CTndGXDICtrl::GetDIC(int nRow, int nCol)
{
if ((nRow == -1) || (nCol == -1))
return NULL;
CDIControlInfo* pDIC = NULL;
CGXGridWnd* pGrid = (CGXGridWnd*) GridWnd();
if (NULL != pGrid)
{
CGXStyle s;
pGrid ->GetStyleRowCol(nRow, nCol, s);
pDIC = (CDIControlInfo*) s.GetItemDataPtr();
}
return pDIC;
}

CDataItemRef* CTndGXDICtrl::GetDataItemRef(int nRow, int nCol)
{
CDataItemRef* pDIR = NULL;
CDIControlInfo* pDIC = GetDIC(nRow, nCol);
if (NULL != pDIC)
{
pDIR = &(pDIC ->m_cDataItemRef);
}
return pDIR;
}

CDataEntity::deType CTndGXDICtrl::GetTargetType(int nRow, int nCol)
{
CDataEntity::deType eType = CDataEntity::deNull;
CDIControlInfo* pDIC = GetDIC(nRow, nCol);
if (NULL != pDIC)
{
eType = pDIC ->m_eTargetType;
}
return eType;
}

DWORD CTndGXDICtrl::GetContext(int nRow, int nCol)
{
DWORD dw = 0;
CDIControlInfo* pDIC = GetDIC(nRow, nCol);
if (NULL != pDIC)
{
dw = pDIC ->m_dwContext;
}
return dw;
}

CProject* CTndGXDICtrl::GetProject(int nRow, int nCol)
{
CProject* p = NULL;
CDIControlInfo* pDIC = GetDIC(nRow, nCol);
if (NULL != pDIC)
{
p = pDIC ->m_pProject;
}
return p;
}

void CTndGXDICtrl::SetContext(int nRow, int nCol, CProject* pProj, DWORD dwContext)
{
CDIControlInfo* pDIC = GetDIC(nRow, nCol);
if (NULL != pDIC)
{
pDIC ->m_dwContext = dwContext;
}
}

void CTndGXDICtrl::SetTargetType(int nRow, int nCol, CDataEntity::deType eType)
{
CDIControlInfo* pDIC = GetDIC(nRow, nCol);
if (NULL != pDIC)
{
pDIC ->m_eTargetType = eType;
}
}

Here is the complete error list:

c:2010fv32gridctrl.cpp(41): error C3646: ‘CRuntimeClass’ : unknown override specifier
c:2010fv32gridctrl.cpp(41): error C2143: syntax error : missing ‘;’ before ‘*’
c:2010fv32gridctrl.cpp(41): error C4430: missing type specifier — int assumed. Note: C++ does not support default-int
c:2010fv32gridctrl.cpp(41): error C2509: ‘_GetBaseClass’ : member function not declared in ‘CTndGXDICtrl’
          c:2010fv32gridctrl.h(58) : see declaration of ‘CTndGXDICtrl’

Error C3646 shows up with the following line:

IMPLEMENT_DYNAMIC(CTndGXDICtrl, CGXEditControl)

I may be missing something here, any guidance will be useful.

Regards.

Я пытаюсь написать простой движок DirectX11, но продолжаю получать эту странную ошибку и не могу найти проблему: я определяю класс Terrain и класс Mesh и #include класс Mesh в классе Terrain:

определение класса Terrain:

// Terrain.h
#pragma once

#include "Noise.h"#include "Mesh.h"
class Terrain
{
public:
Terrain(float width, float depth, int numVerticesW, int numVerticesD);
~Terrain();
float GetHeight(float x, float z);
void Draw();
private:
Mesh mMesh;                     // I get the error on this line
Noise mNoiseGenerator;
std::vector<float> mHeights;
void CreateTerrain(float width, float depth, int numVerticesW, int numVerticesD);
float ComputeHeight(float x, float z, float startFrequency, float startAmplitude, float persistence, int octaves);
};

и определение класса Mesh:

// Mesh.h
#pragma once

#include <d3d11.h>
#include <vector>
#include "Game.h"
class Mesh
{
public:
Mesh();
~Mesh();
template <typename T, unsigned int N>
void LoadVertexBuffer(T data[][N], unsigned int size, bool dynamic = false);
void LoadIndexBuffer(std::vector<unsigned int> indices);
void SetVertexCount(unsigned int vertexCount);
void Bind();
void Draw();
private:
std::vector<ID3D11Buffer*> mVertexBuffers;
std::vector<unsigned int> mStrides;
ID3D11Buffer *mIndexBuffer;
unsigned int mVertexCount;
};template <typename T, unsigned int N>
void Mesh::LoadVertexBuffer(T data[][N], unsigned int size, bool dynamic)
{
D3D11_BUFFER_DESC bufferDesc = {};
bufferDesc.Usage = dynamic ? D3D11_USAGE_DYNAMIC : D3D11_USAGE_IMMUTABLE;
bufferDesc.BindFlags = D3D11_BIND_VERTEX_BUFFER;
bufferDesc.ByteWidth = sizeof(T[N]) * size;
bufferDesc.CPUAccessFlags = dynamic ? D3D11_CPU_ACCESS_WRITE : 0;
bufferDesc.MiscFlags = 0;
bufferDesc.StructureByteStride = 0;

D3D11_SUBRESOURCE_DATA bufferData = {};
bufferData.pSysMem = data;

ID3D11Buffer *buffer;
Game::GetInstance()->GetDevice()->CreateBuffer(&bufferDesc, &bufferData, &buffer);
mVertexBuffers.push_back(buffer);
mStrides.push_back(sizeof(T[N]));
}

Когда я компилирую код, я получаю:

Severity    Code    Description Project File    Line    Suppression State
Error   C3646   'mMesh': unknown override specifier DirectX11 engine 0.3    c:userslucadesktopprogrammingcodec++sourcevisual studiodirectx11 engine 0.3terrain.h  14
Severity    Code    Description Project File    Line    Suppression State
Error   C4430   missing type specifier - int assumed. Note: C++ does not support default-int    DirectX11 engine 0.3    c:userslucadesktopprogrammingcodec++sourcevisual studiodirectx11 engine 0.3terrain.h  14

Я искал в Интернете, но большинство результатов показывают пропущенные точки с запятой или циклические проблемы с включением, но я не могу их найти.

РЕДАКТИРОВАТЬ
Я обнаружил проблему, но не могу объяснить, почему мое решение работает:
следуя дереву включения:
Terrain.h -> Mesh.h -> Game.h -> Renderer.h -> Terrain.h

устранение #include «Terrain.h» (поскольку я просто объявляю указатели Terrain * внутри класса) и добавление его в Terrain.cpp, похоже, решает проблему.
Так что, должно быть, речь идет о круговом включении, но разве я не должен быть защищен от этого с помощью защиты заголовка / включения?

1

Решение

Ваша проблема в том, что #pragma once предотвращает только двойное включение. То есть это делает следующее безопасным (упрощенным, чтобы сделать это очевидным):

// Terrain.cpp
#include "Terrain.h"#include "Terrain.h"

Это не решает круговое включение, которое гораздо сложнее решить автоматически. С двойным включением понятно, кто из них первый. Но у круга нет начала.

2

Другие решения

Других решений пока нет …


Включить подсказки

С помощью автоматической подсказки можно сузить результаты поиска до возможных соответствий при вводе текста.


Отображаются результаты для 


Вместо этого искать 

Вы имели в виду: 


  • Назад к форумам


  • Назад

  • Далее

_rhenley

2297 просмотров, 17 ответов

‎03-30-2014

02:17 PM

dbapserv.h(451): error C3646: ‘final’ : unknown override specifier


I am compiling a 2014 x64 ARX with the 2015 SDK, and receive the following error:

1>—— Build started: Project: FrameUpx64 (Visual Studio 2010), Configuration: Debug x64 ——
1>  StdAfx.cpp
1>c:autodesk2015objectarx 2015incdbapserv.h(451): error C3646: ‘final’ : unknown override specifier

Does anyone know where I should be looking to solve this issue ?


  • Назад к форумам


  • Назад

  • Далее

17 ОТВЕТ 17

owenwengerd

‎03-30-2014

02:54 PM

You have to build with VS 2012 Update 4.


Owen Wengerd
ManuSoft

_rhenley

‎03-30-2014

03:08 PM

That was applied before I started:

Microsoft Visual Studio Professional 2012
Version 11.0.61030.00 Update 4
Microsoft .NET Framework
Version 4.5.50938

_rhenley

‎03-30-2014

03:12 PM

And I have no direct calls to: getSubstituteFont

owenwengerd

‎03-30-2014

04:02 PM

It’s not enough to use the VS 2012 IDE, you also have to set the correct Platform Toolset in the project properties.


Owen Wengerd
ManuSoft

_rhenley

‎03-30-2014

05:08 PM

Doesn’t matter, either one:

Platform Toolset: Visual Studio 2010 (v100)
Platform Toolset: Visual Studio 2012 (v110)

Returns the error. Is there some specific setup documentation for VS 2012 ? I didn’t notice it in the SDK.

owenwengerd

‎03-30-2014

05:51 PM

Can you reproduce the problem in a new project created from scratch? If so, attach it here so I can have a look. I’m not sure I understand your question about documentation. As far as I know, all the SDK documentation is in the docs subdirectory.


Owen Wengerd
ManuSoft

_rhenley

‎03-30-2014

06:18 PM

I have this happening in 3 older working MFC Extension Arx projects; so I find it is easy to reproduce in a fresh 2014 Wizard generated project’s code:

1>—— Build started: Project: TestArxProject1, Configuration: Debug Win32 ——
1>  StdAfx.cpp
1>c:autodesk2015objectarx 2015incdbapserv.h(451): error C3646: ‘final’ : unknown override specifier
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

Why exactly it does, is not clear yet.

owenwengerd

‎03-30-2014

08:08 PM

I haven’t tried to build your project, just looked through it. I see that it imports Autodesk.arx-2014.props. Where does that file come from? Did you edit it?


Owen Wengerd
ManuSoft

_rhenley

‎03-30-2014

08:23 PM

The 2014 Wizard creates it, it appears to be irrelevant to the compiler issue with the .h file.

owenwengerd

‎03-30-2014

09:14 PM

I can confirm the error when I build your project. I don’t see any obvious reason, but I’ll have a closer look when time permits.


Owen Wengerd
ManuSoft

owenwengerd

‎03-30-2014

09:24 PM

Ah, I see the problem. In your project file around line 53, you are overriding the PlatformToolset property. I deleted those property overrides, saved the file, then reloaded it in the IDE and reset the platform toolset — now it builds without error.


Owen Wengerd
ManuSoft

_rhenley

‎03-30-2014

11:15 PM

I’m not following your comments.

I didn’t override the PlatformToolset. But even when I remove from the TestArxProject1.vcxproj file those lines, so it looks like this:

  <PropertyGroup Label=»Configuration»>
  </PropertyGroup>

And reset the PlatformToolset correctly I still end up with an error. It also does not help when I edit the Autodesk.arx-2014.props file from:

        <ArxSDKVersion>19.1</ArxSDKVersion>
        <ArxSDKPlatform>v100</ArxSDKPlatform>

to this:

        <ArxSDKVersion>20.0</ArxSDKVersion>
        <ArxSDKPlatform>v110</ArxSDKPlatform>

Alexander.Rivilis

‎03-31-2014

03:55 AM


@_rhenley wrote:

I am compiling a 2014 x64 ARX with the 2015 SDK, and receive the following error:

1>—— Build started: Project: FrameUpx64 (Visual Studio 2010), Configuration: Debug x64 ——
1>  StdAfx.cpp
1>c:autodesk2015objectarx 2015incdbapserv.h(451): error C3646: ‘final’ : unknown override specifier

Does anyone know where I should be looking to solve this issue ?


You have to use ObjectARX SDK 2014 (not 2015) in order to create arx-application for AutoCAD 2014

Відповідь корисна? Клікніть на «ВПОДОБАЙКУ» цім повідомленням! | 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

owenwengerd

‎03-31-2014

06:58 AM

I’ve attached the project file that builds without error for me. I also removed the /WX compiler option while messing around with it, so maybe something else I changed also affects the outcome.


Owen Wengerd
ManuSoft

_rhenley

‎03-31-2014

09:45 AM

Sorry I wasn’t clearer, but I am not interested in compiling for 2014.

I am compiling for 2015. As the test example shows.

I didn’t expect to have so much trouble doing that with code which works and compiles for 2014.

The error appears to be with the 2015 SDK and the 2012 compiler settings as setup using the 2014 Wizard.

_rhenley

‎03-31-2014

09:47 AM

Yes that works. I’ll need to look at this more closely. I thought I had those setting changed per your project, but apparently not all of them.

_rhenley

‎03-31-2014

10:46 AM

Actually — in addition to the corrected Platform settings, they have to be placed in the .vcxproj in the right location. When I moved the PlatformToolset lines to the location yours were right below the PropertyGroup Condition :

  <PropertyGroup Condition=»‘$(Configuration)’==’Release'» Label=»Configuration»>
    <UseDebugLibraries>false</UseDebugLibraries>
    <WholeProgramOptimization>true</WholeProgramOptimization>
  </PropertyGroup>
  <PropertyGroup Condition=»‘$(Configuration)’==’Debug'» Label=»Configuration»>
    <UseDebugLibraries>true</UseDebugLibraries>
    <WholeProgramOptimization>false</WholeProgramOptimization>
  </PropertyGroup>

  <PropertyGroup Label=»Configuration» Condition=»‘$(Configuration)|$(Platform)’==’Debug|Win32′»>
    <PlatformToolset>v110</PlatformToolset>
  </PropertyGroup>
  <PropertyGroup Label=»Configuration» Condition=»‘$(Configuration)|$(Platform)’==’Release|Win32′»>
    <PlatformToolset>v110</PlatformToolset>
  </PropertyGroup>
  <PropertyGroup Label=»Configuration» Condition=»‘$(Configuration)|$(Platform)’==’Debug|x64′»>
    <PlatformToolset>v110</PlatformToolset>
  </PropertyGroup>
  <PropertyGroup Label=»Configuration» Condition=»‘$(Configuration)|$(Platform)’==’Release|x64′»>
    <PlatformToolset>v110</PlatformToolset>
  </PropertyGroup>

Then my project file worked to compile, otherwise it doesn’t properly configured.


  • Назад к форумам


  • Назад

  • Далее

Понравилась статья? Поделить с друзьями:
  • Ошибка компилятора c2679
  • Ошибка компиляции при вычислении выражения или выполнении фрагмента кода 1с
  • Ошибка компилятора c2676
  • Ошибка компилятора c2664
  • Ошибка компилятора c2064