[CXX-1818] Undefined reference when compiling with cmake on windows target bsoncxx_testing Created: 14/Sep/19  Updated: 27/Oct/23  Resolved: 28/Oct/19

Status: Closed
Project: C++ Driver
Component/s: Build
Affects Version/s: 3.4.0
Fix Version/s: None

Type: Bug Priority: Blocker - P1
Reporter: Ivan Fosse Assignee: Kevin Albertson
Resolution: Gone away Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Windows Mingw gcc 8.x



 Description   

When compiling mongoc and mongocxx, I encountered an issue with the target bsoncxx_testing. I'm using de 3.4.0 release with CXX-1689 and CXX-1688 otherwise it cannot compile since I'm using gcc 8.1

Here's the console message

// code 
[  4%] Built target bsoncxx
[ 10%] Built target bsoncxx_testing
[ 10%] Linking CXX executable test_bson.exe
CMakeFiles\test_bson.dir/objects.a(bson_builder.cpp.obj):bson_builder.cpp:(.text+0x12b9): undefined reference to `__imp__ZN7bsoncxx7v_noabi5types10b_document7type_idE'
CMakeFiles\test_bson.dir/objects.a(bson_builder.cpp.obj):bson_builder.cpp:(.text+0x1474): undefined reference to `__imp__ZN7bsoncxx7v_noabi5types7b_int327type_idE'
CMakeFiles\test_bson.dir/objects.a(bson_builder.cpp.obj):bson_builder.cpp:(.text+0x1a96): undefined reference to `__imp__ZN7bsoncxx7v_noabi5types7b_array7type_idE'
CMakeFiles\test_bson.dir/objects.a(bson_builder.cpp.obj):bson_builder.cpp:(.text+0x1c3f): undefined reference to `__imp__ZN7bsoncxx7v_noabi5types7b_int327type_idE'
CMakeFiles\test_bson.dir/objects.a(bson_builder.cpp.obj):bson_builder.cpp:(.text+0x21e4): undefined reference to `__imp__ZN7bsoncxx7v_noabi5types7b_int327type_idE'
CMakeFiles\test_bson.dir/objects.a(bson_builder.cpp.obj):bson_builder.cpp:(.text+0x24f3): undefined reference to `__imp__ZN7bsoncxx7v_noabi5types6b_bool7type_idE'
CMakeFiles\test_bson.dir/objects.a(bson_builder.cpp.obj):bson_builder.cpp:(.text+0x2a69): undefined reference to `__imp__ZN7bsoncxx7v_noabi5types7b_int327type_idE'
CMakeFiles\test_bson.dir/objects.a(bson_builder.cpp.obj):bson_builder.cpp:(.text+0x2d74): undefined reference to `__imp__ZN7bsoncxx7v_noabi5types6b_bool7type_idE'
collect2.exe: error: ld returned 1 exit status
make[2]: *** [src\bsoncxx\test\CMakeFiles\test_bson.dir\build.make:216: src/bsoncxx/test/test_bson.exe] Error 1
make[1]: *** [CMakeFiles\Makefile2:519: src/bsoncxx/test/CMakeFiles/test_bson.dir/all] Error 2
make: *** [Makefile:140: all] Error 2

I couldn't find a way to fix it but all the other targets worked fine.



 Comments   
Comment by Kevin Albertson [ 30/Sep/19 ]

Hi Ivan, could you include the cmake and build commands you are using to help us reproduce?

Thanks,
Kevin

Comment by Kevin Albertson [ 23/Sep/19 ]

Hi Ivan, thanks for the report. What version of libmongoc are you using? And can you include the cmake and build commands you are using?

Thanks,
Kevin

Generated at Wed Feb 07 22:04:01 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.