ObjectARX

Reply
Valued Contributor
Shinigami_black
Posts: 58
Registered: ‎06-21-2012
Message 1 of 12 (848 Views)
Accepted Solution

error LNK2038: mismatch detected

848 Views, 11 Replies
08-15-2013 12:48 AM

Hi,

I decided to try and learn how to program on AutoCAD using C++. I use linux (Ubuntu) at home so I have used VirtualBox and installed Windows 8 Enterprise Evalution 64bit, AutoCAD Civil 3D 2014, Autodesk ObjectARX 2014 win 64 and its documentation, Microsoft Visual Studio Express 2012 (Visual C++ 2012).

 

Using ObjectARX dokumenttion set settings for project and copy - past first minimal example. And it worked. But trying to build next example (command registration "acedRegCmds") I get 5 errors. And it happens only after including "aced.h".

 

1 error LNK2038: mismatch detected for '_MSC_VER': value '1600' doesn't match value '1700' in test01.obj (File: rxapi.lib(libinit.obj))

 

and other errors are

 

LNK2019: unresoled external symbol...

 

And I can't find a fix for it.

 

#include "stdafx.h"
#include "tchar.h"
#include "rxregsvc.h"
#include "acutads.h"
#include "aced.h"

void initApp();
void unloadApp();
void helloWorld();

void initApp() {
	acedRegCmds->addCommand(_T("HELLOWORLD_COMMANDS"), _T("Hello"), _T("Labas"), ACRX_CMD_TRANSPARENT, helloWorld);
}

void unloadApp() {
	acedRegCmds->removeGroup(_T("HELLOWORLD_COMMANDS"));
}

void helloWorld() {
	acutPrintf(_T("\n Labas pasauli!"));
}

extern "C" AcRx::AppRetCode acrxEntryPoint(AcRx::AppMsgCode msg, void* appId) {
    switch(msg) {
		case AcRx::kInitAppMsg:
			acrxUnlockApplication(appId);
			acrxRegisterAppMDIAware(appId);
			initApp();
			acutPrintf(_T("\nExample Application Loaded"));
			break;
		case AcRx::kUnloadAppMsg:
			unloadApp();
			acutPrintf(_T("\nExample Application Unloaded"));
			break;
    }
    return AcRx::kRetOK;
}

 

Distinguished Mentor
owenwengerd
Posts: 593
Registered: ‎08-06-2002
Message 2 of 12 (828 Views)

Re: error LNK2038: mismatch detected

08-15-2013 07:52 AM in reply to: Shinigami_black

Can you build the SDK sample projects successfully? If so, you can compare settings to find where you've gone wrong. Keep in mind that VS Express has some limitations, so not all sample projects may build successfully in Express.

--
Owen Wengerd
ManuSoft
Valued Contributor
Shinigami_black
Posts: 58
Registered: ‎06-21-2012
Message 3 of 12 (822 Views)

Re: error LNK2038: mismatch detected

08-15-2013 12:18 PM in reply to: owenwengerd

If sample have

#include "aced.h"

 I can't build it. If sample do not have it I can build. But only one sample did not had it. As I have read on internet it is because after compile of my file functions in aced.h is named differently from same functions in rxapi.lib.

Distinguished Mentor
owenwengerd
Posts: 593
Registered: ‎08-06-2002
Message 4 of 12 (819 Views)

Re: error LNK2038: mismatch detected

08-15-2013 12:55 PM in reply to: Shinigami_black

Can you still download Visual Studio Express 2010? I'm not sure if VS 2012 Express supports the v100 Platform Toolset.

--
Owen Wengerd
ManuSoft
Valued Contributor
Shinigami_black
Posts: 58
Registered: ‎06-21-2012
Message 5 of 12 (817 Views)

Re: error LNK2038: mismatch detected

08-15-2013 01:04 PM in reply to: owenwengerd

Right now I am trying to download VS2010Express. Will see if can install. And VS2012 do not have Platform Toolset v100, here are only v110.

Valued Contributor
Shinigami_black
Posts: 58
Registered: ‎06-21-2012
Message 6 of 12 (806 Views)

Re: error LNK2038: mismatch detected

08-16-2013 07:40 AM in reply to: owenwengerd

I have installed Visual C++ 2010 Express. After long configuration and error fixing I got to 3 errors.

 

1>     Creating library c:\users\donatas\documents\visual studio 2010\Projects\test02\Debug\test02.lib and object c:\users\donatas\documents\visual studio 2010\Projects\test02\Debug\test02.exp
1>test02.obj : error LNK2019: unresolved external symbol __imp__acrxSysRegistry referenced in function "void __cdecl initApp(void)" (?initApp@@YAXXZ)
1>test02.obj : error LNK2019: unresolved external symbol "public: static class AcRxClass * __cdecl AcEdCommandStack::desc(void)" (?desc@AcEdCommandStack@@SAPAVAcRxClass@@XZ) referenced in function "public: static class AcEdCommandStack * __cdecl AcEdCommandStack::cast(class AcRxObject const *)" (?cast@AcEdCommandStack@@SAPAV1@PBVAcRxObject@@@Z)
1>test02.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: bool __thiscall AcRxClass::isDerivedFrom(class AcRxClass const *)const " (__imp_?isDerivedFrom@AcRxClass@@QBE_NPBV1@@Z) referenced in function "public: bool __thiscall AcRxObject::isKindOf(class AcRxClass const *)const " (?isKindOf@AcRxObject@@QBE_NPBVAcRxClass@@@Z)
1>c:\users\donatas\documents\visual studio 2010\Projects\test02\Debug\test02.arx : fatal error LNK1120: 3 unresolved externals
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

 

Distinguished Mentor
owenwengerd
Posts: 593
Registered: ‎08-06-2002
Message 7 of 12 (803 Views)

Re: error LNK2038: mismatch detected

08-16-2013 09:01 AM in reply to: Shinigami_black

Can you now open a sample project and build without errors? There is no point trying to fix errors on your own project until the system is correctly configured. If the samples build, then you can compare settings and know with some confidence that it's just a matter of fixing the project settings. In this case, it looks like you're not linking to the needed ObjectARX libraries. This could be because you have not specified their location in the linker settings (Additional Library Directories).

--
Owen Wengerd
ManuSoft
Valued Contributor
Shinigami_black
Posts: 58
Registered: ‎06-21-2012
Message 8 of 12 (783 Views)

Re: error LNK2038: mismatch detected

08-16-2013 11:14 PM in reply to: owenwengerd

Thanks,

I was able to build samples and copy-past my code into one of samples, I was able to build it. But did not found yet how to set right setings manually. But trying to load (appload) in to AutoCAD I get an error (test02.arx is incompatible with this version of AutoCAD. AcRxDynamicLinker failed to load )

I guess it was build as 32bit file, but I have 64bit AutoCAD.

 

P.S. yestedey I was trying to write this message but could not. Got an error.

Moderator
Alexander.Rivilis
Posts: 1,388
Registered: ‎04-09-2008
Message 9 of 12 (767 Views)

Re: error LNK2038: mismatch detected

08-17-2013 12:17 PM in reply to: Shinigami_black

Shinigami_black wrote:

...I guess it was build as 32bit file, but I have 64bit AutoCAD...

 

P.S. yestedey I was trying to write this message but could not. Got an error.


Visual Studio 2010 Express edition can build only 32-bit exe/dll/arx/db-files. So in order to build valid 64-bit arx-file you have to use (at least) Visual Studio 2010 Professional edition.


Пожалуйста не забывайте про Утвердить в качестве решения! Утвердить в качестве решения и Give Kudos!Баллы
Please remember to Accept Solution! Accept as Solution and Give Kudos!Kudos

Valued Contributor
Shinigami_black
Posts: 58
Registered: ‎06-21-2012
Message 10 of 12 (754 Views)

Re: error LNK2038: mismatch detected

08-18-2013 08:07 AM in reply to: Alexander.Rivilis

hmmmm, so a bad news. Only paid software can build 64bit programs for windows. And AutoCAD is only 64bit from now on.

You are not logged in.

Log into access your profile, ask and answer questions, share ideas and more. Haven't signed up yet? Register

Announcements
Are you familiar with the Autodesk Expert Elites? The Expert Elite program is made up of customers that help other customers by sharing knowledge and exemplifying an engaging style of collaboration. To learn more, please visit our Expert Elite website.

Need installation help?

Start with some of our most frequented solutions to get help installing your software.

Ask the Community