cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Dixioldie
Level 2

Need C and C++ example

Hello,
I'm an absolute newbe working with FlexnetPublisher. So, my question is probably silly. Please answer it anyway (if possible).

After successfull compilation of the toolkit, I looked around for an example, how to code (C and C++) the license request.
I only want to send a string with the feature name and get back the license=OK (if available)
Where are the subroutine calls described?
Which libraries from the toolkit will be needed?

Thanks for any help
Labels (1)
0 Kudos
(6) Replies
RobertDickau
Flexera Alumni

The machind directory of the FlexNet Publisher toolkit contains lmflex.c, probably the simplest example of performing a license checkout. The examples directory contains additional examples, and the C/C++ function reference begins with typical sequences of function calls.
0 Kudos
bpremus
Level 3

Hello,
I am just getting started with flexera, and reading trough documentation
when i want to compile lmflex.c example i got the fallowing errors
Thank you for any info or hints


c:\flexlm>cl lmFlex.c
Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 15.00.30729.01 for 80x86
Copyright (C) Microsoft Corporation. All rights reserved.

lmFlex.c
Microsoft (R) Incremental Linker Version 9.00.30729.01
Copyright (C) Microsoft Corporation. All rights reserved.

/out:lmFlex.exe
lmFlex.obj
lmFlex.obj : error LNK2019: unresolved external symbol _lc_free_job referenced i
n function _main
lmFlex.obj : error LNK2019: unresolved external symbol _lc_checkin referenced in
function _main
lmFlex.obj : error LNK2019: unresolved external symbol _lc_checkout referenced i
n function _main
lmFlex.obj : error LNK2019: unresolved external symbol _lc_set_attr referenced i
n function _main
lmFlex.obj : error LNK2019: unresolved external symbol _lc_get_errno referenced
in function _main
lmFlex.obj : error LNK2019: unresolved external symbol _lc_perror referenced in
function _main
lmFlex.obj : error LNK2019: unresolved external symbol _lc_new_job referenced in
function _main
lmFlex.obj : error LNK2019: unresolved external symbol _l_n36_buf referenced in
function _main
lmFlex.obj : error LNK2019: unresolved external symbol _lc_flexinit referenced i
n function _init
lmFlex.obj : error LNK2019: unresolved external symbol _lc_flexinit_property_han
dle_set referenced in function _init
lmFlex.obj : error LNK2019: unresolved external symbol _lc_flexinit_property_han
dle_create referenced in function _init
lmFlex.obj : error LNK2019: unresolved external symbol _lc_flexinit_property_han
dle_free referenced in function _cleanup
lmFlex.obj : error LNK2019: unresolved external symbol _lc_flexinit_cleanup refe
renced in function _cleanup
lmFlex.exe : fatal error LNK1120: 13 unresolved externals
0 Kudos
RobertDickau
Flexera Alumni

Please see makefile or makefile.act in the platform directory (such as i86_n3) of your FNP toolkit. The lmflex.exe target shows the .lib and other files that need to be linked in. The FNP Development Environment Guide fnp_devenv.pdf also shows a list of required libraries.
0 Kudos
bpremus
Level 3

Hi,
in my case i can see only x64_n6 platform directory in file 11.11.0.2 FlexNet Publisher Windows x86-64 file (that actually need to be x64), while in fnp_devenv.pdf under Setting Up Microsoft Visual Studio
for a FlexEnabled Application only setup for i86_n3. Is there an additional documentation covering x64 platform?

if i set x64_n6 instead i86_n3

C:/flexlm/x64_n6
C:/flexlm/x64_n6/activation/lib

i got errors like, unresolved external symbol l_n36_buf

EDIT:
i got the correct set of libs from from output of command line example
lm_new.obj lmgr.lib libsb.lib libcrvs.lib oldnames.lib kernel32.lib user32.lib netapi32.lib advapi32.lib gdi32.lib comdlg32.lib comctl32.lib wsock32.lib Rpcrt4.lib oleaut32.lib Ole32.lib Wbemuuid.lib wintrust.lib crypt32.lib libcmt.lib lmgr_dongle_stub.lib .\activation\lib\libnoact.lib
0 Kudos
bpremus
Level 3

Hello,
i am searching for a way to convert string to LM_A_VAL_TYPE, can anyone assist me with an example?

what i want to accomplish is to set TST_LICPATH from a string.
(void)lc_set_attr(lm_job, LM_A_LICENSE_DEFAULT, (LM_A_VAL_TYPE) TST_LICPATH);

Thank you
0 Kudos
RobertDickau
Flexera Alumni

Casting the string to LM_A_VAL_TYPE as you've done, and as done in the lmflex.c example, should do what you want.
0 Kudos