Author Topic: [PCL] How to configure environment variables in VS express 2010 ?  (Read 6960 times)

Offline bitli

  • PTeam Member
  • PixInsight Guru
  • ****
  • Posts: 513
Hi try to compile a PCL example following the readme in the PCL 2.0 tar file, using VS Studio express 2010 (with the SDK installed to allow 64 bits projects).
However I am supposed to set a bunch of environment variables. It seems that setting environment variables changed between each version of VS and I cannot find how to configure the project/solution/VS to have the proper environment variables.

Do somebody have a hint ?

-- bitli


Offline bitli

  • PTeam Member
  • PixInsight Guru
  • ****
  • Posts: 513
Re: [PCL] How to configure environment variables in VS express 2010 ?
« Reply #1 on: 2013 January 07 12:26:48 »
[edited]
Eventually I had to set the environment variables globally so that VS uses them, I also add to add the SDK to the library path, and switch to 64 bit.

Compilation is OK, but linking results on many errors, like (just 3 out of many)

1>PCL-pxi.lib(FileInfo.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '0' doesn't match value '2' in SandboxInstance.obj
1>     Creating library x64\Debug\Sandbox.lib and object x64\Debug\Sandbox.exp
1>LINK : warning LNK4098: defaultlib 'MSVCRT' conflicts with use of other libs; use /NODEFAULTLIB:library
1>SandboxProcess.obj : error LNK2019: unresolved external symbol __imp_CompareStringW referenced in function "public: static int __cdecl pcl::CharTraits::Compare(unsigned short const *,unsigned __int64,unsigned short const *,unsigned __int64,bool,bool)" (?Compare@CharTraits@pcl@@SAHPEBG_K01_N2@Z)

After asking Google, I tried to clean the whole project and rebuild it, making sure that I was always in 64 bits, but this did not change anything.  Did anybody succeed in building the sandbox 2.0 with VS 2010?  Or have any clue?

-- bitli
« Last Edit: 2013 January 07 13:26:35 by bitli »

Offline bitli

  • PTeam Member
  • PixInsight Guru
  • ****
  • Posts: 513
Re: [PCL] How to configure environment variables in VS express 2010 ?
« Reply #2 on: 2013 January 23 11:41:17 »
I switched to VS2012, made a clean install and tried with the PCL-02.00.01.0557-20130121.zip, after setting the environment variables and switching the configuration to x64.

Same errors on SandBox, there are probably undocumented operations required to make it compile. Maybe people using it on Unix have more luck?

-- bitli

Offline Juan Conejero

  • PTeam Member
  • PixInsight Jedi Grand Master
  • ********
  • Posts: 7111
    • http://pixinsight.com/
Re: [PCL] How to configure environment variables in VS express 2010 ?
« Reply #3 on: 2013 January 23 12:30:44 »
Hi Jean-Marc,

Sorry for not replying sooner to this post. There should be no problems if you define the required environment variables and use the provided project files.

Suppose you have the PCL distribution on a "C:\PCL" folder. The required variables are then:

PCLDIR=C:\PCL
PCLINCDIR=C:\PCL\include
PCLLIBDIR32=C:\PCL\lib\windows\vc10\x86
PCLLIBDIR64=C:\PCL\lib\windows\vc10\x86_64
PCLLIBDIR=%PCLLIBDIR64%
PCLSRCDIR=C:\PCL\src
PCLBINDIR32=C:\PCL\bin\x86
PCLBINDIR64=C:\PCL\bin
PCLBINDIR=%PCLBINDIR64%

Note that the 32-bit variables are no longer necessary, since 32-bit PCL development is deprecated, but declaring them doesn't hurt.

To define the variables: Start > Control Panel > System > Advanced system settings > Environment Variables

Then you should have no problems using the provided project files. You can also regenerate them when you want with the MakefileGenerator script on PixInsight.
Juan Conejero
PixInsight Development Team
http://pixinsight.com/

Offline bitli

  • PTeam Member
  • PixInsight Guru
  • ****
  • Posts: 513
Re: [PCL] How to configure environment variables in VS express 2010 ?
« Reply #4 on: 2013 January 23 13:26:49 »
Hi,
I did set the environment variables (originally I though that I could set them in VS20xx). I also recreated the build file with PI.  in 64 bit modes I have still tons of message like:
Code: [Select]
Error 2 error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '0' doesn't match value '2' in SandboxInstance.obj C:\XXX\PCL\src\modules\processes\Sandbox\windows\vc11\PCL-pxi.lib(StdAlloc.obj) Sandbox
Error 3 error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MD_DynamicRelease' doesn't match value 'MDd_DynamicDebug' in SandboxInstance.obj C:\XXX\PCL\src\modules\processes\Sandbox\windows\vc11\PCL-pxi.lib(StdAlloc.obj) Sandbox
In 32 bits modes it compiles but does not link (which is expected).
I also have a warning
Code: [Select]
Warning 1 warning D9030: '/Gm' is incompatible with multiprocessing; ignoring /MP switch C:\XXX\PCL\src\modules\processes\Sandbox\windows\vc11\cl Sandbox
which is probably not important.

I do not do VS development on windows usually, so maybe there are some additional libraries or stuff to install ?
-- bitli