These are chat archives for symengine/symengine

4th
Jun 2017
Shikhar Jaiswal
@ShikharJ
Jun 04 2017 09:36

@isuruf Changing std::size_t count_ to static std::size_t count_ gives out this error:

../../libsymengine.a(symbol.cpp.o): In function `SymEngine::Dummy::Dummy()':
symbol.cpp:(.text+0x61c): undefined reference to `SymEngine::Dummy::count_'
../../libsymengine.a(symbol.cpp.o): In function `SymEngine::Dummy::Dummy(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)':
symbol.cpp:(.text+0x783): undefined reference to `SymEngine::Dummy::count_'
../../libsymengine.a(symbol.cpp.o): In function `SymEngine::Dummy::__hash__() const':
symbol.cpp:(.text+0xa3c): undefined reference to `SymEngine::Dummy::count_'
../../libsymengine.a(symbol.cpp.o): In function `SymEngine::Dummy::__eq__(SymEngine::Basic const&) const':
symbol.cpp:(.text+0xac7): undefined reference to `SymEngine::Dummy::count_'
symbol.cpp:(.text+0xadd): undefined reference to `SymEngine::Dummy::count_'
../../libsymengine.a(symbol.cpp.o):symbol.cpp:(.text+0xbac): more undefined references to `SymEngine::Dummy::count_' follow
collect2: error: ld returned 1 exit status
symengine/tests/basic/CMakeFiles/test_subs.dir/build.make:98: recipe for target 'symengine/tests/basic/test_subs' failed
make[2]: *** [symengine/tests/basic/test_subs] Error 1
CMakeFiles/Makefile2:502: recipe for target 'symengine/tests/basic/CMakeFiles/test_subs.dir/all' failed
make[1]: *** [symengine/tests/basic/CMakeFiles/test_subs.dir/all] Error 2
Makefile:138: recipe for target 'all' failed
make: *** [all] Error 2

Using get_count()in place of count_ also leads to the same.

Isuru Fernando
@isuruf
Jun 04 2017 09:37
Is that the only change you did from the PR?
Can you push the code?
Shikhar Jaiswal
@ShikharJ
Jun 04 2017 09:38
Yes
Pushed in the code. Also, can you enable auto-cancellation of builds for SymEngine and SymEngine.py?
Isuru Fernando
@isuruf
Jun 04 2017 09:43
It's already enabled
Isuru Fernando
@isuruf
Jun 04 2017 09:49
You need to initialize the variable
Shikhar Jaiswal
@ShikharJ
Jun 04 2017 09:55
But that won't be possible right in the class as static std::size_t count_ = 0 is forbidden. And initializing within the constructor would lead to the same issue.
Isuru Fernando
@isuruf
Jun 04 2017 09:56
You have to initialize it out of class. See http://en.cppreference.com/w/cpp/language/static