1

I am testing a c++ program using Cucumber framework. Documentation for Cucumber-cpp. Basically, I needed to include some of the library files such as boost, gtest etc. Also, build Ruby Cucumber gem. I have finished all of them.

I am currently using visual studio 2017 community version. From the documentation of cucumber-cpp, I downloaded the file and started trying one of the examples they provided (Calc). I added the header file (Calculator.h), source file (Calculator.cpp), test file (GtestCalculatorSteps.cpp) and finally addition.feature.

After debugging, I get some link errors. I have attached a screenshot of the errors.

Screenshot here

Can anyone help me by telling how do I fix this?

Shereif SRF
  • 58
  • 1
  • 12
  • It looks like you have not built the libraries properly, you also look like you've mixed the runtimes up, and you are missing `main`. – Niall Jul 14 '17 at 09:27
  • I have built boost library perfectly. But, for the cucumber and gtest, I don't have anything to build. – Shereif SRF Jul 14 '17 at 09:35
  • Cucumber cpp has a bunch of cpp files (https://github.com/cucumber/cucumber-cpp/tree/master/src), have these been built? And are they being linked? Built with the same options as the rest of the code? Built to the same target (x86 vs. x64)? Built to the same runtime (/MD vs /MT vs /MDd vs /MTd)? – Niall Jul 14 '17 at 09:43
  • 1
    I am sorry, I didn't know that I need to build those files. What I did was just included the 'include' folder to the solution. But thanks for the information. Would you mind to tell me how to build it? Because I don't have much knowledge in it. – Shereif SRF Jul 14 '17 at 09:56
  • I don't know how to build cucumber-cpp off hand, it looks like it has a CMakelist.txt, so using CMake to run the build should do it. The readme has a section in it "Building Cucumber-Cpp with tests and samples". – Niall Jul 14 '17 at 10:04

0 Answers0