Comments (8)
from cxxopts.
I thought putting it in an anonymous namespace would fix it, and I also thought that I tested this.
Can you show me a snippet of code that breaks?
from cxxopts.
OK, I can put one together tomorrow. This came up in a rather large project.
Basically, we are working on a C++ kernel for the Jupyter notebook, backed by the cling C++ interpreter:
We have a notion of "cell magic" that allows user to enter non-c++ commands to perform some operations (fetching help on a certain module etc).
We use cxxopts to parse options for these commands. So basically, our usecase is quite difference from the usual argument parsing for a command-line application but cxxopts does the job, hence the multiple compilation units.
from cxxopts.
This really sounds like a bug in the compiler if anything. I'm pretty sure that according to the standard, something declared in an anonymous namespace has internal linkage in the translation unit, so it shouldn't result in multiple references.
If you can give me some code that reproduces the problem then I can have a look at it.
from cxxopts.
The code that breaks is the compilation of xeus-cling.
Building it locally is a bit cumbersome because it has a lot of dependencies which need to be built or for which you will need to get a binary package. (For this reason, I use the conda package manager for which I have built all the dependency tree).
I do get multiple versions of gcc (4.9, 5.x anx 6.x) to complain cxxopts::values::integer_pattern
. However, I don't get why this should not work.
FYI, the version with a singleton does work and also prevents recompiling the regex.
from cxxopts.
In fact I'm not sure why you get an error with integer_pattern
and not option_matcher
, option_specifier
.
from cxxopts.
I'm trying to build xeus-cling
, to reproduce this. I followed the instructions on that repo to install conda
, and cloned the xeus-cling
source, but I'm stuck here:
cmake -DCMAKE_INSTALL_PATH=$HOME/miniconda3 -DCMAKE_INSTALL_LIBDIR=$HOME/miniconda3 .
-- The C compiler identification is GNU 7.1.1
-- The CXX compiler identification is GNU 7.1.1
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found LLVM_CONFIG as /home/jbeck/miniconda3/bin/llvm-config
CMake Error at /usr/lib/cmake/clang/ClangTargets.cmake:419 (message):
The imported target "clangApplyReplacements" references the file
"/usr/lib/libclangApplyReplacements.a"
What am I missing here?
from cxxopts.
I was never able to reproduce this, but it will be fixed when I address #281
from cxxopts.
Related Issues (20)
- feature request/question: support the one dash as argument HOT 2
- Feature request: value pairs or tuples HOT 1
- Renaming of OptionException should be mentioned in changelog HOT 1
- Allow "G", "M" and 'k' when parsing arguments HOT 2
- Getting a sign-conversion warning/error with clang 14 and CXXOPTS_USE_UNICODE_HELP ON HOT 2
- A proposition to implement any complex rule on the arguments
- unannotated fall-through between switch labels HOT 3
- Are unrecognized options supported? HOT 1
- std::bad_alloc during dlopen on integer_pattern initialization HOT 4
- In Linux systems, the tilde symbol (~) cannot be automatically expanded to "/home/user1," HOT 4
- -option Error message. I think we should not just report command āpā error. HOT 5
- Report a typo in README.md doc(in master branch) HOT 1
- What is the use of constructor parameters in options("MyProgram", "One line description of MyProgram")? HOT 3
- Filtered argc/argv HOT 3
- cxxopts-3.2.0 breaks in c++20 mode: invalid operands to binary expression ('std::stringstream' (aka 'basic_stringstream<char>') and 'std::optional<bool>' HOT 8
- Add + as an argument indicator
- short arg unable to accept argument.
- Sub-options support
- options test fails with SIGTRAP on macOS / arm64 HOT 6
- What cmake targets are defined?
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 cxxopts.