cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 
Archicad C++ API
About Archicad add-on development using the C++ API.

Help : Unable to compile archiCAD API's examples

Anonymous
Not applicable
Hello everyone !

I'm currently trying to develop an add-on for ArchiCAD that would suit the needs of the society I work for.

To do so, I've downloaded the API Devkit matching my version of ArchiCAD (v15).
According to the documentation provided by the Devkit, the example projects are supposed to compile/build just fine using MS Visual C++ 2005 Express.

Unfortunately, none of the examples builds without having some linker tools errors which I'm not able to identify properly and resolve.

For instance, when I'm trying to build the DG_Test example project, I get the following errors :
1>Linking...
1>   Creating library Win32\Debug\DG_Test.lib and object Win32\Debug\DG_Test.exp
1>DG_Test.obj : error LNK2019: unresolved external symbol __imp__DeleteObject@4 referenced in function "short __cdecl Browser_CB(short,short,short,long,long)" (?Browser_CB@@YAFFFFJJ@Z)
1>DG_Test.obj : error LNK2019: unresolved external symbol __imp__SetCursor@4 referenced in function "short __cdecl Progress_Handler(short,short,short,long,long)" (?Progress_Handler@@YAFFFFJJ@Z)
1>DG_Test.obj : error LNK2019: unresolved external symbol __imp__LoadCursorA@8 referenced in function "short __cdecl Progress_Handler(short,short,short,long,long)" (?Progress_Handler@@YAFFFFJJ@Z)
1>ACAP_STAT.lib(ACAPlib.obj) : error LNK2019: unresolved external symbol __imp__RegisterWindowMessageA@4 referenced in function "bool __fastcall DllInit(struct DllMainImp_InitContext const *)" (?DllInit@@YI_NPBUDllMainImp_InitContext@@@Z)
1>Win32\Debug\DG_Test.apx : fatal error LNK1120: 4 unresolved externals
I've read in some of the topics related to mine that the most recommended IDE (as for Windows) is MS Visual Studio 2005, though MS Visual C++ 2005 Express is told to work equally well.

Am I missing something ? Is there anything I'm supposed to modify or add in the example project's properties in order to make it build ?

Any help would be greatly appreciated and I thank you in advance for your answers. Feel free to ask for more precision concerning the linker tools errors I get during the build process, depending on the corresponding example project.

Kindly,

Siwar

PS : Here's some details about my configuration :
- Windows XP SP3 (32-bits)
- ArchiCAD API Devkit v15.2702 / ArchiCAD v15
- MS Visual C++ 2005 Express Edition
2 REPLIES 2
Akos Somorjai
Graphisoft
Graphisoft
Mansour wrote:
Hello everyone !

I'm currently trying to develop an add-on for ArchiCAD that would suit the needs of the society I work for.

To do so, I've downloaded the API Devkit matching my version of ArchiCAD (v15).
According to the documentation provided by the Devkit, the example projects are supposed to compile/build just fine using MS Visual C++ 2005 Express.

Unfortunately, none of the examples builds without having some linker tools errors which I'm not able to identify properly and resolve.

For instance, when I'm trying to build the DG_Test example project, I get the following errors :
1>Linking...
1>   Creating library Win32\Debug\DG_Test.lib and object Win32\Debug\DG_Test.exp
1>DG_Test.obj : error LNK2019: unresolved external symbol __imp__DeleteObject@4 referenced in function "short __cdecl Browser_CB(short,short,short,long,long)" (?Browser_CB@@YAFFFFJJ@Z)
1>DG_Test.obj : error LNK2019: unresolved external symbol __imp__SetCursor@4 referenced in function "short __cdecl Progress_Handler(short,short,short,long,long)" (?Progress_Handler@@YAFFFFJJ@Z)
1>DG_Test.obj : error LNK2019: unresolved external symbol __imp__LoadCursorA@8 referenced in function "short __cdecl Progress_Handler(short,short,short,long,long)" (?Progress_Handler@@YAFFFFJJ@Z)
1>ACAP_STAT.lib(ACAPlib.obj) : error LNK2019: unresolved external symbol __imp__RegisterWindowMessageA@4 referenced in function "bool __fastcall DllInit(struct DllMainImp_InitContext const *)" (?DllInit@@YI_NPBUDllMainImp_InitContext@@@Z)
1>Win32\Debug\DG_Test.apx : fatal error LNK1120: 4 unresolved externals
I've read in some of the topics related to mine that the most recommended IDE (as for Windows) is MS Visual Studio 2005, though MS Visual C++ 2005 Express is told to work equally well.

Am I missing something ? Is there anything I'm supposed to modify or add in the example project's properties in order to make it build ?

Any help would be greatly appreciated and I thank you in advance for your answers. Feel free to ask for more precision concerning the linker tools errors I get during the build process, depending on the corresponding example project.

Kindly,

Siwar

PS : Here's some details about my configuration :
- Windows XP SP3 (32-bits)
- ArchiCAD API Devkit v15.2702 / ArchiCAD v15
- MS Visual C++ 2005 Express Edition

Siwar,

Have also downloaded and configured the Windows SDK? That is not part of the normal VS Express installation. Also, you can only compile 32-bit versions; 64-bit tools are not part of the Express edition.

Best, Akos
Anonymous
Not applicable
Akos,

First of all, thank you for your answer.

After some research regarding additionnal dependencies within the example projects, I've come to the conclusion that I had to add several libraries as :
kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib ACAP_STAT.lib
This time everything compiled properly and was smoothly integrated in the ArchiCAD Add-on Manager.

I want to thank you again for your kind help.

Regards,

Siwar