Comments (7)
This is due to the fact that the compiler you are using does not support the __COUNTER__
macro. Take a look at include/cukebins/internal/RegistrationMacros.hpp
:
#ifdef __COUNTER__
#define CUKE_GEN_OBJECT_NAME_ BOOST_JOIN(CukeObject, __COUNTER__)
#else
// Use a counter to be incremented every time cukebins is included
// in case this does not suffice (possible with multiple files only)
#define CUKE_GEN_OBJECT_NAME_ BOOST_JOIN(CukeObject, __LINE__)
#endif
from cucumber-cpp.
I use the gcc 4.2.1 from MacOS. It doesn't support the COUNTER macro.
It also doesn't work if you compile all source files serperately into .o files before linking.
Is it possible to include the file name into the object name?
from cucumber-cpp.
Legal characters for identifiers are letters, numbers, and _. The file name always includes at least one illegal character: the dot.
A workaround would be to include all your cpp files into a "global" one, but having to compile everything from scratch every time you change one file.
We might solve this issue by allowing the definition of a suffix in every file, by a define directive or a corresponding compiler parameter. A generated counter (followed by a legal character as the underscore) should not be difficult to add with cmake or scons.
from cucumber-cpp.
The suffix solution works. I did it exactly that way (but as prefix)*.
I added the following code to RegistrationMacros.hpp
#ifdef GEN_OBJECT_PREFIX
#define CUKE_GEN_OBJECT_NAME_ BOOST_JOIN(GEN_OBJECT_PREFIX,LINE)
#else
Then I used SCons to add the file name (without the suffix):
def buildObject(sourceFile):
return env.Object(
unicode('target/'+sourceFile.name[0:-4]+'.o'),
sourceFile,
CXXFLAGS='-DGEN_OBJECT_PREFIX=Object'+sourceFile.name[0:-4]
)
It would be great if you could add this solution to the official code base.
from cucumber-cpp.
Yes, that's exactly what I meant. I used CUKE_OBJECT_PREFIX instead of GEN_OBJECT_PREFIX because it's unlikely that anyone would want to name a macro in their code starting with CUKE :-) If not defined, it defaults to CukeObject as before.
from cucumber-cpp.
Great! Thanks
from cucumber-cpp.
can just add a anonymous namespace for each cpp file
from cucumber-cpp.
Related Issues (20)
- error: cannot allocate an object of abstract type ‘cucumber::internal::CukeBoostLogInterceptor’ HOT 1
- Boost 1.7x build incompatibility due to invalid method signature HOT 2
- New release tag?
- WANTED: A new maintainer 🔧🙋♀️🙋🏾♂️🙋🏼 HOT 24
- Embedded c++ support HOT 9
- Rename master branch to main HOT 1
- Add Conan support for cucumber-cpp HOT 1
- [FEATURE] comparing result of performances (upload data in the report) HOT 2
- sudo cmake --build /home/yizhu/cucumber-cpp/ --target features, this command get errors HOT 1
- Is there a working example of cucumber (c cmake, boost) for c++? HOT 5
- Failed tests when checking implementation against common cucumber test suite HOT 2
- README.md has dead link HOT 1
- request a new release HOT 2
- nlohmann-json I think breaks the installation HOT 2
- cucumber.wire ignored (older versions don't) HOT 2
- Update Conformance / Use u2d versions HOT 4
- Minimal CI for Windows
- Full fledged CI for Windows
- Confusing script name run-all.sh HOT 1
- Getting rid of ruby dependency HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cucumber-cpp.