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

ObjectARX 2014 - Unresolved external symbol error

3 REPLIES 3
Reply
Message 1 of 4
bakerrl2
1583 Views, 3 Replies

ObjectARX 2014 - Unresolved external symbol error

We are preparing to migrate our ObjectARX code from 2010 to 2014.  As a test I installed Visual Studio 2010 (SP1) on my PC.  I then loaded one of our main ARX programs, changed the compiler and linker settings to the appropriate directories and files for ObjectARX 2014.  When I compile the code no warnings or errors are generated; however, when it links it reports a lot of "unresolved external symbols" for various ObjectARX AcDb & AcEd global functions.  I have made sure the appropriate libraries (rxapi.lib, acad.lib & acdb19.lib) are included based on the ObjectARX 2014 documentation; however, it does seem to make a difference.  Any suggestions?  Is there a particular libray that provides the global functions?

 

Here is an example of the output from the linker.

 

1>BVDxfList.obj : error LNK2019: unresolved external symbol acdbEntGet referenced in function "public: short __cdecl BVAC::BVDxfList::entget(void)" (?entget@BVDxfList@BVAC@@QEAAFXZ)
1>BVDxfList.obj : error LNK2019: unresolved external symbol acdbTblSearch referenced in function "public: short __cdecl BVAC::BVDxfList::tblsearch(wchar_t const *,wchar_t const *,int)" (?tblsearch@BVDxfList@BVAC@@QEAAFPEB_W0H@Z)
1>BVDxfList.obj : error LNK2019: unresolved external symbol acdbEntLast referenced in function "public: short __cdecl BVAC::BVDxfList::entlast(void)" (?entlast@BVDxfList@BVAC@@QEAAFXZ)
1>BVDxfList.obj : error LNK2019: unresolved external symbol acdbEntNext referenced in function "public: short __cdecl BVAC::BVDxfList::entnext(void)" (?entnext@BVDxfList@BVAC@@QEAAFXZ)
1>BVDxfList.obj : error LNK2019: unresolved external symbol acdbEntDel referenced in function "public: short __cdecl BVAC::BVDxfList::entdel(void)" (?entdel@BVDxfList@BVAC@@QEAAFXZ)
1>BVDxfList.obj : error LNK2019: unresolved external symbol acdbEntMod referenced in function "public: short __cdecl BVAC::BVDxfList::entmod(void)" (?entmod@BVDxfList@BVAC@@QEAAFXZ)
1>BVDxfList.obj : error LNK2019: unresolved external symbol acdbEntUpd referenced in function "public: short __cdecl BVAC::BVDxfList::entupd(void)" (?entupd@BVDxfList@BVAC@@QEAAFXZ)
1>BVExtVar.obj : error LNK2019: unresolved external symbol acedPutSym referenced in function "public: int __cdecl BVAC::BVExtVar::putsym(wchar_t const *,double)" (?putsym@BVExtVar@BVAC@@QEAAHPEB_WN@Z)
1>BVGetInput.obj : error LNK2019: unresolved external symbol acedGetInput referenced in function "public: int __cdecl BVAC::BVGetInput::getangle(double *)" (?getangle@BVGetInput@BVAC@@QEAAHPEAN@Z)
1>BVGetInput.obj : error LNK2019: unresolved external symbol acedGetAngle referenced in function "public: int __cdecl BVAC::BVGetInput::getangle(double *)" (?getangle@BVGetInput@BVAC@@QEAAHPEAN@Z)
1>BVGetInput.obj : error LNK2019: unresolved external symbol acdbAngToS referenced in function "public: int __cdecl BVAC::BVGetInput::getangle(double *)" (?getangle@BVGetInput@BVAC@@QEAAHPEAN@Z)
1

3 REPLIES 3
Message 2 of 4
bakerrl2
in reply to: bakerrl2

Never mind.  I found by compiling the ArxDbg sample program that I needed to add accore.lib file to my Additional Dependencies list in order to eliminate the linker errors.  Unfortunately, the ObjectARX 2014 help files do not mention this library.

Message 3 of 4
LE3
Advocate
in reply to: bakerrl2

You can add a system evironment variable, and that can be much simpler.

 

For example:

Variable name: ARX2014

Value: The objectARX 2014 path

 

Then, just add depending on the system.

 

C/C++/General

Additional Include Directories: $(ARX2014)\inc;$(ARX2014)\inc-x64

 

Linker/General

Additional Library Directories: $(ARX2014)\lib-x64

 

Have a look at tips from Owen's site: http://www.manusoft.com/resources/arxtips/msvcenvironment.html

 

HTH

 

Message 4 of 4
bakerrl2
in reply to: bakerrl2

After doing some additional research and comparison against some of the other ARX programs I have worked on I discovered that you can include most if not all the necessary ObjectARX library files just by including the following information in the StdAfx.h header file.

 

//-----------------------------------------------------------------------------

//- Include ObjectDBX/ObjectARX headers

//- Uncomment one of the following lines to bring a given library in your project.

//#define _BREP_SUPPORT_ //- Support for the BRep API

//#define _HLR_SUPPORT_ //- Support for the Hidden Line Removal API

//#define _AMODELER_SUPPORT_ //- Support for the AModeler API

//#define _ASE_SUPPORT_ //- Support for the ASI/ASE API

//#define _RENDER_SUPPORT_ //- Support for the AutoCAD Render API

//#define _ARX_CUSTOM_DRAG_N_DROP_ //- Support for the ObjectARX Drag'n Drop API

//#define _INC_LEAGACY_HEADERS_ //- Include legacy headers in this project

#include "arxHeaders.h"

 

If you open the arxHeaders.h file you will see various pragma statements like:

 

#pragma comment(lib, "accore.lib")

 

These pragma statements make Visual Studio link in those libraries.  As a result, the Additional Dependencies setting in your project only needs to list non-ObjectARX libraries because the ObjectARX libraries are loaded by the header files.

 

In my case the project had never been updated to use the arxHeaders.h file so it did not automatically link in the required library files.

 

Note: You still have to specify the location of the ObjectARX directories in your project settings in order for Visual Studion to find the header and library files.

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

Post to forums  

Autodesk Design & Make Report

”Boost