Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.c++ > #79450 > unrolled thread

how to compile the bulk copy program

Started byBoris Dorestand <bdorestand@example.com>
First post2021-05-07 19:07 -0300
Last post2021-05-08 07:46 -0300
Articles 4 — 3 participants

Back to article view | Back to comp.lang.c++


Contents

  how to compile the bulk copy program Boris Dorestand <bdorestand@example.com> - 2021-05-07 19:07 -0300
    Re: how to compile the bulk copy program red floyd <no.spam.here@its.invalid> - 2021-05-07 18:02 -0700
    [OT] Re: how to compile the bulk copy program Paavo Helde <myfirstname@osa.pri.ee> - 2021-05-08 09:48 +0300
      Re: [OT] Re: how to compile the bulk copy program Boris Dorestand <bdorestand@example.com> - 2021-05-08 07:46 -0300

#79450 — how to compile the bulk copy program

FromBoris Dorestand <bdorestand@example.com>
Date2021-05-07 19:07 -0300
Subjecthow to compile the bulk copy program
Message-ID<86sg2y42pz.fsf@example.com>
I'm trying to compile Pavel's bulk copy program 

   https://github.com/zodiacon/Win10SysProgBookSamples/tree/master/Chapter11/BulkCopy

Not a C++ programmer, nor a Windows person.  I wonder if the context is
on-topic.  I also don't know which group would be more appropriate.

With the WTL latest version obtained from

   https://wtl.sourceforge.io/

I get some compiler errors.  I then tried to use the previous version of
WTL, which dates back to 2015.  I get other error messages.

I suppose my problem is having either the wrong compiler or the wrong
headers.  Any directions you point me to will be useful.  Thank you.

(/) WTL 10, year 2020

``c:\sys\emacs\usr\win\tmp\Win10SysProgBookSamples\Chapter11\BulkCopy>cl MainDlg.cpp
Microsoft (R) C/C++ Optimizing Compiler Version 19.28.29914 for x86
Copyright (C) Microsoft Corporation.  All rights reserved.

MainDlg.cpp
MainDlg.cpp(33): error C2664: 'int WTL::CListViewCtrlT<ATL::CWindow>::InsertColumn(int,LPCTSTR,int,int,int,int,int)': cannot convert argument 2 from 'const wchar_t [7]' to 'LPCTSTR'
MainDlg.cpp(33): note: Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast``
[...]

(/) WTL 9.1, year 2015

``c:\sys\emacs\usr\win\tmp\Win10SysProgBookSamples\Chapter11\BulkCopy>cl MainDlg.cpp
Microsoft (R) C/C++ Optimizing Compiler Version 19.28.29914 for x86
Copyright (C) Microsoft Corporation.  All rights reserved.

MainDlg.cpp
\sys\ms\WTL91_5321_Final\include\atlctrls.h(5101): error C2039: 'CString': is not a member of 'WTL'
\sys\ms\WTL91_5321_Final\include\atlctrls.h(83): note: see declaration of 'WTL'
[...]

[toc] | [next] | [standalone]


#79453

Fromred floyd <no.spam.here@its.invalid>
Date2021-05-07 18:02 -0700
Message-ID<s74nug$7gu$2@redfloyd.dont-email.me>
In reply to#79450
On 5/7/2021 3:07 PM, Boris Dorestand wrote:
> [question on ATL and VC redacted]
> 

You need to ask in a Windows programming group.

MS Specific libraries and tools are off topic here,
we (in theory) discuss the actual language as defined
by ISO/IEC 14882:<insert-year-here>

[toc] | [prev] | [next] | [standalone]


#79454 — [OT] Re: how to compile the bulk copy program

FromPaavo Helde <myfirstname@osa.pri.ee>
Date2021-05-08 09:48 +0300
Subject[OT] Re: how to compile the bulk copy program
Message-ID<s75c89$e6s$1@dont-email.me>
In reply to#79450
08.05.2021 01:07 Boris Dorestand kirjutas:
> I'm trying to compile Pavel's bulk copy program
> 
>     https://github.com/zodiacon/Win10SysProgBookSamples/tree/master/Chapter11/BulkCopy
> 
> Not a C++ programmer, nor a Windows person.  I wonder if the context is
> on-topic.  I also don't know which group would be more appropriate.
> 
> With the WTL latest version obtained from
> 
>     https://wtl.sourceforge.io/
> 
> I get some compiler errors.  I then tried to use the previous version of
> WTL, which dates back to 2015.  I get other error messages.
> 
> I suppose my problem is having either the wrong compiler or the wrong
> headers.  Any directions you point me to will be useful.  Thank you.
> 
> (/) WTL 10, year 2020
> 
> ``c:\sys\emacs\usr\win\tmp\Win10SysProgBookSamples\Chapter11\BulkCopy>cl MainDlg.cpp
> Microsoft (R) C/C++ Optimizing Compiler Version 19.28.29914 for x86
> Copyright (C) Microsoft Corporation.  All rights reserved.
> 
> MainDlg.cpp
> MainDlg.cpp(33): error C2664: 'int WTL::CListViewCtrlT<ATL::CWindow>::InsertColumn(int,LPCTSTR,int,int,int,int,int)': cannot convert argument 2 from 'const wchar_t [7]' to 'LPCTSTR'
> MainDlg.cpp(33): note: Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast``
> [...]

(Only answering here because I do not participate in any Windows 
specific groups/forums).

You normally cannot really call cl.exe with a single .cpp and with no 
other arguments. In correct usage it has dozens of command line 
arguments, and you do not call cl.exe directly, but rather an IDE like 
Visual Studio does that, based on a project file which defines those 
dozens of arguments.

 From the error messages it looks like at least /D_UNICODE and/or 
/DUNICODE are missing, but fixing this won't probably help you much. You 
should rather follow the build instructions provided by the original 
program. If there is a .vcxproj or a .sln file, most probably you are 
expected to open that in Visual Studio and build it there.

[toc] | [prev] | [next] | [standalone]


#79457 — Re: [OT] Re: how to compile the bulk copy program

FromBoris Dorestand <bdorestand@example.com>
Date2021-05-08 07:46 -0300
SubjectRe: [OT] Re: how to compile the bulk copy program
Message-ID<86fsyx4i64.fsf@example.com>
In reply to#79454
Paavo Helde <myfirstname@osa.pri.ee> writes:

> 08.05.2021 01:07 Boris Dorestand kirjutas:
>> I'm trying to compile Pavel's bulk copy program
>>     https://github.com/zodiacon/Win10SysProgBookSamples/tree/master/Chapter11/BulkCopy
>> Not a C++ programmer, nor a Windows person.  I wonder if the context
>> is
>> on-topic.  I also don't know which group would be more appropriate.
>> With the WTL latest version obtained from
>>     https://wtl.sourceforge.io/
>> I get some compiler errors.  I then tried to use the previous
>> version of
>> WTL, which dates back to 2015.  I get other error messages.
>> I suppose my problem is having either the wrong compiler or the
>> wrong
>> headers.  Any directions you point me to will be useful.  Thank you.
>> (/) WTL 10, year 2020
>> ``c:\sys\emacs\usr\win\tmp\Win10SysProgBookSamples\Chapter11\BulkCopy>cl
>> MainDlg.cpp
>> Microsoft (R) C/C++ Optimizing Compiler Version 19.28.29914 for x86
>> Copyright (C) Microsoft Corporation.  All rights reserved.
>> MainDlg.cpp
>> MainDlg.cpp(33): error C2664: 'int
>> WTL::CListViewCtrlT<ATL::CWindow>::InsertColumn(int,LPCTSTR,int,int,int,int,int)':
>> cannot convert argument 2 from 'const wchar_t [7]' to 'LPCTSTR'
>> MainDlg.cpp(33): note: Types pointed to are unrelated; conversion
>> requires reinterpret_cast, C-style cast or function-style cast``
>> [...]
>
> (Only answering here because I do not participate in any Windows
> specific groups/forums).

Thank you.  I don't know any NNTP-based programming Microsoft group.  If
anyone does know, please recommend me.  I do have access to gmane.io's
NNTP server, that is, a mail list would probably work too.

> You normally cannot really call cl.exe with a single .cpp and with no
> other arguments. In correct usage it has dozens of command line 
> arguments, and you do not call cl.exe directly, but rather an IDE like
> Visual Studio does that, based on a project file which defines those 
> dozens of arguments.

Thank you.  That pointed me in the right direction.  I managed to
compile it using msbuild.exe.  The program nuget.exe downloaded the
libraries to the current directory and, inspecting BulkCopy.vcxproj, I
could see the place for them were ..\packages\:

--8<---------------cut here---------------start------------->8---
  <ImportGroup Label="ExtensionTargets">
    <Import Project="..\packages\wtl.10.0.9163\build\native\wtl.targets" Condition="Exists('..\packages\wtl.10.0.9163\build\native\wtl.targets')" />
    <Import Project="..\packages\Microsoft.Windows.ImplementationLibrary.1.0.191107.2\build\native\Microsoft.Windows.ImplementationLibrary.targets" Condition="Exists('..\packages\Microsoft.Windows.ImplementationLibrary.1.0.191107.2\build\native\Microsoft.Windows.ImplementationLibrary.targets')" />
  </ImportGroup>
--8<---------------cut here---------------end--------------->8---

> From the error messages it looks like at least /D_UNICODE and/or
> /DUNICODE are missing, but fixing this won't probably help you
> much. You should rather follow the build instructions provided by the
> original program. If there is a .vcxproj or a .sln file, most probably
> you are expected to open that in Visual Studio and build it there.

You're right.  It did use /D _UNICODE and /D UNICODE.

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.c++


csiph-web