Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

how to compile the bulk copy program

27 views
Skip to first unread message

Boris Dorestand

unread,
May 7, 2021, 6:08:13 PM5/7/21
to
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'
[...]

red floyd

unread,
May 7, 2021, 9:02:24 PM5/7/21
to
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>


Paavo Helde

unread,
May 8, 2021, 2:48:56 AM5/8/21
to
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.

Boris Dorestand

unread,
May 8, 2021, 6:46:50 AM5/8/21
to
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.
0 new messages