1

I started writing a small project on C++. I just wanted to develop using TDD because in Java I always do that. I faced a problem that using any libraries and so on is a bit easier in Java IDEs and tools (like maven and so on). But it's not exactly topic I'm talking about.

I found cxxtest framework and decided to add one into my project. I added the latest version of sources exactly into my test package in project, then I write simple test, and then I ran preprocessor (using python) by "python cxxtestgen --error-printer -o ../runner.cpp ../../testSample.h" from cxxtest-4.4/bin folder.

After that I got the runner.cpp file into cxxtest-4.4 folder. I tried to run that using command "g++ -o runner runner.cpp" in suitable place...and got the following message:

bash-3.2$ g++ -o runner runner.cpp
runner.cpp:8:10: error: 'cxxtest/TestListener.h' file not found with <angled> include; use "quotes" instead
#include <cxxtest/TestListener.h>
         ^~~~~~~~~~~~~~~~~~~~~~~~
         "cxxtest/TestListener.h"
In file included from runner.cpp:8:
./cxxtest/TestListener.h:24:10: fatal error: 'cxxtest/Descriptions.h' file not found
#include <cxxtest/Descriptions.h>
         ^~~~~~~~~~~~~~~~~~~~~~~~

Here I put my project structure: The project structure

It seems very strange because I've never seen the same troubles before. And it's not able to find same issues.

So, would be great if somebody told my even right direction to fix this problem. Let me know If you need something else to make more clear understanding of this problem (code, any technical info, etc)

Some info: I'm using CLion on macOS, it means I have CMake (version 3.6 at least), I have both perl and python on my mac. Project with C++14 language version.

  • _use "quotes" instead_ have you tried what the error message suggests? –  Sep 22 '17 at 18:19
  • I think I should write some properties where I can add some kind of path to find headers or something like that... But where should do that? – Evgeny Ignatik Sep 22 '17 at 18:21
  • @manni66, yes, I tried. Doesn't work – Evgeny Ignatik Sep 22 '17 at 18:22
  • _Doesn't work_ - meaning? –  Sep 22 '17 at 18:24
  • @manni66, I got messages that unable to find files too – Evgeny Ignatik Sep 22 '17 at 18:25
  • Where are the messages? –  Sep 22 '17 at 18:28
  • @manni66, here a message after I change <> on "" for first include: bash-3.2$ g++ -o runner runner.cpp In file included from runner.cpp:8: ./cxxtest/TestListener.h:24:10: fatal error: 'cxxtest/Descriptions.h' file not found #include – Evgeny Ignatik Sep 22 '17 at 18:30
  • @manni66, it seems like I should change all <> to "quotes" in this library to fix a trouble... But I'm not pretty sure that library author wanted us implement this way – Evgeny Ignatik Sep 22 '17 at 18:31
  • I don't think that you should copy your file into the folder. For your actual problem: add -I. to the compiler command. Maybe the README tells you you should use this lib. –  Sep 22 '17 at 18:48
  • @manni66, I tried use command "g++ -I/cxxtest -o ../runner.cpp ../../testSample.h", doesn't work. The same messages. And I did all instructions from readme and got the messages. I think it's all about my c++ unknowledge, I don't really know how to exactly include libraries. So, Im gonna develop without tests. – Evgeny Ignatik Sep 22 '17 at 18:53
  • @manni66, thank you for your help and your time :) – Evgeny Ignatik Sep 22 '17 at 18:54

0 Answers0