[CDRIVER-2157] Linking to libmongoc with MinGW-64 fails to find crypt32.lib Created: 09/May/17 Updated: 28/Oct/23 Resolved: 20/Jun/17 |
|
| Status: | Closed |
| Project: | C Driver |
| Component/s: | Build, libmongoc, mingw |
| Affects Version/s: | 1.7.0 |
| Fix Version/s: | 1.7.0 |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Gustavo Brondani Schenkel | Assignee: | A. Jesse Jiryu Davis |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Environment: |
Environment x86_64 |
||
| Attachments: |
|
||||||||||||||||
| Issue Links: |
|
||||||||||||||||
| Description |
|
When mongo-c-driver is built against openssl+cyrus, the pkg-config files get broken. Appears pkg-config file is trying to find files from WINDOWS + SSPI build info. Using the following command to build from inside 'build' folder: |
| Comments |
| Comment by Githook User [ 20/Jun/17 ] | |||||||||||||||
|
Author: {u'username': u'ajdavis', u'name': u'A. Jesse Jiryu Davis', u'email': u'jesse@mongodb.com'}Message: | |||||||||||||||
| Comment by Gustavo Brondani Schenkel [ 19/May/17 ] | |||||||||||||||
|
Sorry about the delay, I didn't see the e-mail notification until afternoon. | |||||||||||||||
| Comment by A. Jesse Jiryu Davis [ 18/May/17 ] | |||||||||||||||
|
I have a script in progress that will test this path in Evergreen. | |||||||||||||||
| Comment by A. Jesse Jiryu Davis [ 18/May/17 ] | |||||||||||||||
|
With the current code, I can't actually build with "-DENABLE_SASL=CYRUS", I get errors compiling mongoc-cluster-sasl.c:
This is easily fixed by including bson.h before sasl.h, to ensure that size_t is defined. Now, the CMake-generated libmongoc-1.0.pc has:
| |||||||||||||||
| Comment by A. Jesse Jiryu Davis [ 17/May/17 ] | |||||||||||||||
|
Assigning to myself for now. I'm going to add a test for this path in Evergreen: build the driver with CMake and MinGW-64, link an example program to it using pkg-config. | |||||||||||||||
| Comment by David Golden [ 17/May/17 ] | |||||||||||||||
|
Hello, gbschenkel. Could you please attach all the .pc and .cmake files that were installed when you build the C driver? | |||||||||||||||
| Comment by Gustavo Brondani Schenkel [ 11/May/17 ] | |||||||||||||||
|
I really don't know if I am missing something or not but, I got one more error with GCC + pkg-config, I saved the report in gcc log.txt | |||||||||||||||
| Comment by David Golden [ 10/May/17 ] | |||||||||||||||
|
OK. Thanks for that extra information. I'm away from the office this week, but when I'm back, I'm going to try to reproduce this and see exactly when we do and don't need that library in the .pc/.cmake files for MSVC and MinGW. Even with MinGW and OpenSSL, we use that on Windows to access the system CA store so I want to make sure that's working. | |||||||||||||||
| Comment by Gustavo Brondani Schenkel [ 10/May/17 ] | |||||||||||||||
|
I built again but before install the driver, I edited the libmongoc-1.0.pc and libmongoc-static-1.0.pc and removed the crypt32.lib reference and it stopped of ask the lib. I think the reference it been inserted from CMakeLists.txt at lines 462 and 463. Since MSYS2 use a Unix-like environment but run as native WIN32, I think the condition is been accepted as true, and the lib is been inserted inside the .cp files. | |||||||||||||||
| Comment by Gustavo Brondani Schenkel [ 10/May/17 ] | |||||||||||||||
|
Hi, I used the script from examples/cmake, for both shared and static, and the compile works as expected. PS: sorry about the crap issue's title, forgot to complete it before inserting. | |||||||||||||||
| Comment by David Golden [ 10/May/17 ] | |||||||||||||||
|
Hi. If you compile your own code with CMake, does it work? | |||||||||||||||
| Comment by Gustavo Brondani Schenkel [ 10/May/17 ] | |||||||||||||||
|
Hi, I compile against version 1.6.2 and pkg-config worked just fine. Appears is something on master. I noticed this issue because I was getting the same error trying to compile a code with mongo-cxx-driver static lib. | |||||||||||||||
| Comment by Hannes Magnusson [ 09/May/17 ] | |||||||||||||||
|
Is this only an issue in current master? Or have you reproduced this in our last release (1.6.2?) |