4

I found some examples from Microsoft, but I'm not sure how to get started.

I have what appears to be a VS project and a file with Registry entries. There are no makefiles included and not really any instructions on how to build.

I am trying to use the G++ compiler with MinGW. The use case is simple http authentication. I have this working on Linux with my pam-http project.

  • How do I go about compiling a simple Credential Provider?
  • Are there any tutorials that give build scripts/makefiles?

I would very much prefer to use FOSS where possible, hence MinGW and g++, and I have little experience with compiling on Windows (I used VS at a job several years ago). Ultimately I'd like to link in cURL, but I can figure that out once I get something built.

Note:

I found these, but I'm looking for build scripts using g++:

I share kberson's sentiments.

EDIT:

I found this on MinGW's website that says linking against MS VC created DLLs is possible.

I do not want to use Visual Studio. I'd prefer a command-line compile tool that isn't tied down to a specific build tool (like ANT or make).

Community
  • 1
  • 1
beatgammit
  • 19,817
  • 19
  • 86
  • 129
  • If the API/DLLs you'll be coding against is C++, you most likely won't ever get it to work with G++. G++ and VC don't have a common ABI. – Mat Jun 19 '11 at 10:18
  • @Mat I'm not 100% required to use MinGW/G++, but I'd much rather use it than VC. If I absolutely have to use VC, then I can. AFAIK, I can compile against whatever DLLs I need. Do you know if DLLs compiled with g++ can be linked in by VC? – beatgammit Jun 19 '11 at 16:45
  • I've noticed this isn't getting much attention. Is there anything I can do to clarify the question? Or is the question too uncommon that nobody knows how to do it? – beatgammit Aug 11 '11 at 20:44

1 Answers1

4

To compile the example credential providers will be considerably easier if you use Visual Studio Express C++ (and then port to G++). You may also need to install the Windowns SDK

MSVC++ comes with command line building tools. So to build the custom credential provider for Windows 7 firstly extract the files into a directory. Then Install MSVC - use the shortcut on the start menu Visual Studio Command Prompt (2010) to open a command prompt and type

cd CredentialProviders\SampleCredentialProvider
msbuild

or to build the release configuration Win32

msbuild /p:Configuration=Release /p:Platform=Win32

Refer to MSBuild (Visual C++) Overview, MSBuild Command Line Reference and Building on the Command Line

These credential providers are built using COM - part of OLE2 - which is the Microsoft Component Object Model. It is possible to build interoperable components without using MSVC but more work. So to get started I'd develop using MSVC simply because all of the examples will work out of the box and then I'd port across to G++ as there will be issues and it is usually easier to start from a working system as it rules out problems in the COM bindings.

To understand COM it helps to read the Technical foundation of COM.

Community
  • 1
  • 1
Richard Harrison
  • 19,247
  • 4
  • 40
  • 67
  • This is actually really helpful. It doesn't directly answer the question, but it definitely gives me somewhere to start. I'll make sure to award the bounty to this if there isn't anything better in the next couple days. – beatgammit Aug 13 '11 at 17:39
  • As nobody else had provided any help since you asked the question I figured that even though it wasn't directly answering it was a path that would help you to the solution. Also it's pretty tricky to build a interopable COM component without using the MSVC support; I'm a great believer in FOSS but in this case the extra work is significant. – Richard Harrison Aug 13 '11 at 20:05
  • The Credential Provider is the only platform-dependent part of the software package I'm building, so I'd like to stick with the same compiler (g++) if possible. Windows support is only for compatibility anyway... – beatgammit Aug 13 '11 at 22:50
  • I've been trying to build the sample using g++ (mingw) and simply cannot get it to compile without errors. Had to add the SDK - which was hard - but still getting problems. I'll post an update if I manage to get anything working. – Richard Harrison Aug 18 '11 at 22:34