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

error LNK2038: mismatch detected

11 REPLIES 11
SOLVED
Reply
Message 1 of 12
Shinigami_black
3956 Views, 11 Replies

error LNK2038: mismatch detected

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;
}

 

11 REPLIES 11
Message 2 of 12

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
Message 3 of 12

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.

Message 4 of 12

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

--
Owen Wengerd
ManuSoft
Message 5 of 12

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.

Message 6 of 12

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 ==========

 

Message 7 of 12

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
Message 8 of 12

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.

Message 9 of 12


@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.

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

Message 10 of 12

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

Message 11 of 12


@Shinigami_black wrote:

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


It's not quite a fair statement. You can use AutoCAD .NET API with full free IDE SharpDevelop

Also I've read but not tested that link: How to compile a 64-bit application using Visual C++ 2010 Express?

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

Message 12 of 12

As I know .NET isn't C++, but C#

Programming is more a hoby for me. But if here are a need I use it for work too. Now I have made several commands using AutoLISP, but as I am more interested in C++ I have decided to translate them to C++. But all my experence in C++ are on Linux.

 

I had found a web page where was writen how to compile a 64bit applications on Visual C++ 2010 too, But it used hacks to do it.

 

Thanks for help.

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

Post to forums  

Autodesk Design & Make Report

”Boost