cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Learn all about the Community Ranking System, a fun gamification element of the PTC Community. X

Translate the entire conversation x

Pro/Toolkit link error: “unresolved external symbol ProDimensionBaselineDirectionGet”

AS_13847166
5-Regular Member

Pro/Toolkit link error: “unresolved external symbol ProDimensionBaselineDirectionGet”

Pro/Toolkit link error: “unresolved external symbol ProDimensionBaselineDirectionGet” — which library to link, and how to map APIs to libs?

I’m building a Creo Parametric Pro/Toolkit application and I’m hitting a linker error when calling ProDimensionBaselineDirectionGet().

Error : unresolved external symbol ProDimensionBaselineDirectionGet referenced in DIMVisitAction(...) — LNK1120: 1 unresolved externals.

Already added libraries : 
protoolkit_NU.lib, pt_asynchronous.lib, ucore.lib, udata.lib, kernel32.lib, user32.lib, wsock32.lib, advapi32.lib, mpr.lib, winspool.lib, netapi32.lib, psapi.lib, gdi32.lib, shell32.lib, comdlg32.lib, ole32.lib, ws2_32.lib.

Questions:

  1. Which specific Toolkit library contains ProDimensionBaselineDirectionGet()?
  2. What’s the recommended way to determine the required library for any given Pro/Toolkit API (e.g., doc index, API Wizard mapping, or dumpbin on .lib files)?

    Thanks in advance for your support!!





8 REPLIES 8
msteffke
15-Moonstone
(To:AS_13847166)

I think your issue is lack of an include statement.   To determine what to include, search the function in the TKWizard,   The Synopsis portion tells you which .h file that you need to include.   In this case   #include <ProDimension.h>

Function ProDimensionBaselinedirectionGet

 

Description
 Get the direction of an ordinate baseline dimension in the case where this is not implied by the attachment reference as retrieved by ProDimensionAttachmentsGet.
Synopsis
#include <ProDimension.h>
ProErrorProDimensionBaselinedirectionGet(
 ProVector dir_vec 
 /* (Out)
 the direction vector for this baseline.
 */
)
AS_13847166
5-Regular Member
(To:msteffke)

Thanks for your reply @msteffke 
I already have that 

#include <ProDimension.h>
ProError

in my header

Headers included in my code : 
#include "CREO TOOLKIT CHECK.h"
#include <iostream>
#include <vector>
#include <string>
#include <utility> 
#include <algorithm>
#include <cctype>
#include <ProMdl.h>
#include <ProSolid.h>
#include <ProToolkit.h>
#include "ProMenu.h"
#include <ProDrawing.h>
#include <ProDimension.h>
#include <ProUtil.h>
#include "ProArray.h"
#include "ProFeatType.h"
#include <ProMessage.h>
#include "ProFeature.h"
#include <ProCore.h>
#include <ProModelitem.h>
#include <ProSelection.h>
#include <tuple>


RPN
17-Peridot
17-Peridot
(To:AS_13847166)

 Try to rename, for me you should call ProDimensionBaselinedirectionGet with a lower ‘d’ 😎

AS_13847166
5-Regular Member
(To:RPN)

Thank you for your reply!!
Sorry i wrote with 'd' in my code and mistakenly used 'D' in the above question,
So getting the same error even after using 'd'.

RPN
17-Peridot
17-Peridot
(To:AS_13847166)

What about protk_dll_NU.lib ?

# Libraries
PTCLIBS = $(PROTOOL_SYS)/obj/protoolkit_NU.lib \
$(ICU_PATH)/ucore.lib \
$(ICU_PATH)/udata.lib
PTCLIBS_DLL = $(PROTOOL_SYS)/obj/protk_dll_NU.lib \
$(ICU_PATH)/ucore.lib \
$(ICU_PATH)/udata.lib
LIBS = libcmt.lib kernel32.lib user32.lib wsock32.lib advapi32.lib mpr.lib winspool.lib netapi32.lib psapi.lib gdi32.lib shell32.lib comdlg32.lib ole32.lib ws2_32.lib

AS_13847166
5-Regular Member
(To:RPN)

Thanks for your reply!!
Adding protk_dll_NU.lib can resolve the issue, as protk_dll_NU.lib is the dll library that contains ProDimensionBaselinedirectionGet api
but Adding both protk_dll_NU.lib and protoolkit_NU.lib causing LINK "already defined" issue as both libraries contains definitions for many APIs
Adding both libraries is not possible in standalone EXE model application
If the model is going to be an DLL means this will work.

Is there any ways to tackle this or should i use the program as DLL only?

RPN
17-Peridot
17-Peridot
(To:AS_13847166)

In the early days spawn mode was the only mode to develop your own extension,  But now , a DLL is what you should have. A DLL runs like other DLLs and share as much as possible to have a better performance. 
I don’t use an IDE, but check to add a flag to nmake, then a DLL creation is an option. 
Don,t forget, a DLL can be loaded on the fly in other executables, just in case you need it in asynchrone modes. 

Announcements

Top Tags