Message 1 of 4
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I‘m a begginer of objectarx development learner,and I built a new project want to create a simple box ,here is my code
#include "stdafx.h"
#include "CreateSolids.h"
void CreateSolids::Init() {
acedRegCmds->addCommand(_T("CreateSolidsCommands"), _T("CreateBox"), _T("CreateBox"), ACRX_CMD_MODAL, CreateBoxFunction);
}
void CreateSolids::Unload() {
acedRegCmds->removeGroup(_T("CreateSolidsCommands"));
}
void CreateSolids::CreateBoxCommnad() {
CreateBoxFunction();
}
void CreateSolids::CreateBoxFunction() {
// box
AcDbDatabase* pDb = acdbHostApplicationServices()->workingDatabase();
AcDbBlockTable* pBlockTable;
if (pDb->getBlockTable(pBlockTable, AcDb::kForWrite) != Acad::eOk) {
acutPrintf(_T("Failed to get Block Table.\n"));
return;
}
AcDbBlockTableRecord* pModelSpace = nullptr;
if (pBlockTable->getAt(ACDB_MODEL_SPACE, pModelSpace, AcDb::kForWrite) != Acad::eOk) {
acutPrintf(_T("Failed to get Model Space.\n"));
pBlockTable->close();
return;
}
AcDb3dSolid* pBox = new AcDb3dSolid();
if (pBox->createBox(10.0, 10.0, 10.0) != Acad::eOk) {
acutPrintf(_T("Failed to create box.\n"));
pBox->close();
pModelSpace->close();
pBlockTable->close();
return;
}
pModelSpace->appendAcDbEntity(pBox);
pModelSpace->close();
pBlockTable->close();
}errors like this :
1>------ Build started: Project: ArxProject1, Configuration: Release x64 ------
1>CreateSolids.cpp
1> Creating library x64\Release\JOKERArxProject1.lib and object x64\Release\JOKERArxProject1.exp
1>CreateSolids.obj : error LNK2001: unresolved external symbol "public: static void * __cdecl AcDb3dSolid::operator new(unsigned __int64)" (??2AcDb3dSolid@@SAPEAX_K@Z)
1>CreateSolids.obj : error LNK2001: unresolved external symbol "public: static void __cdecl AcDb3dSolid::operator delete(void *)" (??3AcDb3dSolid@@SAXPEAX@Z)
1>CreateSolids.obj : error LNK2001: unresolved external symbol "public: __cdecl AcDb3dSolid::AcDb3dSolid(void)" (??0AcDb3dSolid@@QEAA@XZ)
1>E:\2_else\TempDocuments\VS\projects\ArxProject1\x64\Release\JOKERArxProject1.arx : fatal error LNK1120: 3 unresolved externals
1>Done building project "ArxProject1.vcxproj" -- FAILED.
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
========== Build completed at 9:37 and took 03.858 seconds ==========environment settings:
AutoCad Version: 2026
SDK Version: Latest
editor Version:VS 2022
project settings:
How should I solve this.
Solved! Go to Solution.