Build for Win32

553 views
Skip to first unread message

be...@electricfriends.net

unread,
Mar 26, 2020, 9:57:33 AM3/26/20
to licensecc users
Hi,

Is it possible to build the library for Win32? 

I create the CMake configuration with: cmake .. -G "Visual Studio 16 2019" -A Win32 ....

When I try to build the project I get a lot of LNK2019 error and warning LNK4272: library machine type 'x64' conflicts with target machine type 'x86'

I need to build this for a older project which is built for Win32 in Visual Studio. If it is possible, could you provide some guidelines?

Thanks in advance!

Best regards,
Bent Martin

Gabriele Contini

unread,
Mar 26, 2020, 9:05:52 PM3/26/20
to licensecc users
Hi Martin,
It should be possible to compile for win32, indeed. Let me have a look at it this week-end.
Gabriele

Gabriele Contini

unread,
Mar 29, 2020, 12:39:27 AM3/29/20
to licensecc users
Hi Bent Martin,

I checked and it's possible.  
  1. use the 'develop' branch. It's a bit a bad time because 'master' branch is 6 months old and i don't plan to support it anymore. The version on develop is near to a close but it still need some work and clean up. It should be functional though (except VirtualMachine detection options). 
  2. This week a new problem appeared on travis.ci that doesn't let us publish the documentation. It should solve by itself (I hope).
So to summarize: see the new doc 


Best Regards
Gabriele

Bent Martin Dyrdal

unread,
Mar 30, 2020, 3:45:30 AM3/30/20
to licensecc users
Hi Gabriele,

Thank you! I managed to get it to build. Fyi, I also had to rename the Strawberry (Perl) folder as it contains an OpenSSL generator (easiest as I don't use Perl anymore)..

Best regards,
Bent Martin

H. Smith

unread,
Mar 12, 2023, 7:01:37 PM3/12/23
to licensecc users
I have spent hours trying to do a Win32 build and I do not understand what I am doing wrong.

Even when I try the default build:

cmake .. -G "Visual Studio 16 2019" -A x64 -DBOOST_ROOT="C:\local\boost"

Results in:

  Unable to find the requested Boost libraries.

  Boost version: 1.71.0

  Boost include path: C:/local/boost

  Could not find the following static Boost libraries:

          boost_date_time
          boost_filesystem
          boost_program_options
          boost_system
          boost_unit_test_framework

  No Boost libraries were found.  You may need to set BOOST_LIBRARYDIR to the
  directory containing Boost libraries or BOOST_ROOT to the location of
  Boost.

If I try a x86 build, I get:

error MSB8013: This project doesn't contain the Configuration and Platform combination of Debug|Win32.

Is this project still active? I see has been a couple years since there was activity on github.

Thanks.



H. Smith

unread,
Mar 13, 2023, 7:42:37 AM3/13/23
to licensecc users
The below pertains to  VS2019. I am not sure about any other versions of VS.

The below applies only to attempting to build licensecc for 32-Bit Win32 applications.

I finally found a couple of answers to my build problems.

First, I believe that it is necessary to open the specific native tool developer command prompt (x86 versus x64). This sets up the tool chain to be used.

Start Menu -> Programs -> Visual Studio 2019 -> Visual Studio Tools -> VC

For a 32-bit build I used the "x86 Native Tools Command Prompt for VS 2019" then did a change directory to the build folder.

Second, I found a hint here:

https://stackoverflow.com/questions/62448981/cmake-msbuild-fails-to-build-vctargetspath-vcxproj

"I was able to work around this error by using -A Win32. Not sure why -w64 doesn't work for VS2019."

When -A Win32 was used to build the project (instead of -A x86), the project built successfully.

For 32-bit Release and Debug builds I use:

cmake .. -G "Visual Studio 16 2019" -A Win32 -DBOOST_ROOT="C:\local\boost" -DCMAKE_BUILD_TYPE=Release -DSTATIC_RUNTIME=1

cmake .. -G "Visual Studio 16 2019" -A Win32 -DBOOST_ROOT="C:\local\boost" -DCMAKE_BUILD_TYPE=Debug -DSTATIC_RUNTIME=1
Reply all
Reply to author
Forward
0 new messages