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

error building c++ project

Hi there,

I'm trying to include Flexible API calls in a dll project in visual c 2005 sp1.
I've included these files
#include "lmclient.h"
#include "lm_attr.h"

and try to statically link with flex api libraries this way

#pragma comment(lib, "libcrvs.lib")
#pragma comment(lib, "libsb.lib")
#pragma comment(lib, "lmgr_trl.lib")
#pragma comment(lib, "libnoact.lib")
#pragma comment(lib, "lmgr_dongle_stub.lib")

in additional dependencies I've added "lm_new.obj"

When I try to build my project I'm getting this error

lmgr_trl.lib(l_getenv.obj) : error LNK2019: unresolved external symbol __environ referenced in function _reXLbIFghN5QQCVhglc5m

can anyone help me with that?
Thank you.

Alberto.
Labels (1)
0 Kudos
(1) Reply
xprt4y
Level 4

Turning off default libraries is a pain in the 😮 ...I got this to finally work using this order.

	Name="VCLibrarianTool"
AdditionalDependencies="libFNPload.lib libact_md.lib lm_new_md.obj libsb_md.lib libcrvs_md.lib lmgr_md_trl.lib lmgr_md.lib FNP_Act_Installer.lib lmgrs_md.lib lmgras_md.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 msvcrt.lib lmgr_dongle_stub.lib"
OutputFile="$(OutDir)/MYLIBRARY.lib"
AdditionalLibraryDirectories=""../../FLEXLM/$(PlatformName)";"../../FLEXLM/$(PlatformName)/activation/lib""
IgnoreAllDefaultLibraries="true"
IgnoreDefaultLibraryNames=""


However, it throws 2149 warnings about second definitions and duplicate symbols during link. Seems to work ok, tho.

P.S. I'm using the MD libs for now because I couldn't get it to link with the static ones in my application without massive amounts of linker errors.

***
EDIT: This is the link order I got 0 errors/0 warnings with. Again, with md libs, unfortunately.

libFNPload.lib libact_md.lib lm_new_md.obj libsb_md.lib libcrvs_md.lib lmgr_md_trl.lib FNP_Act_Installer.lib oldnames.lib Wbemuuid.lib lmgr_dongle_stub.lib
0 Kudos