Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CANNOT INHERIT FROM MERGE OPERATOR #3811

Closed
CaveNeCadas opened this issue May 6, 2018 · 3 comments
Closed

CANNOT INHERIT FROM MERGE OPERATOR #3811

CaveNeCadas opened this issue May 6, 2018 · 3 comments

Comments

@CaveNeCadas
Copy link

I am using rocksdb compile wilt
GCC-7.3

the following code copied from an example in the source tree

class DpxValueMerger : public rocksdb::AssociativeMergeOperator
{
public:	

      virtual bool Merge(const rocksdb::Slice& key,
                         const rocksdb::Slice* existing_value,
                         const rocksdb::Slice& value,
                         std::string* new_value,
                         rocksdb::Logger* logger) const override	
		{

			// The key associated with the merge operation.
			if ( existing_value == nullptr)
			{
			}
			else // this is where things happens
			{
				//merge the two jason values...
			}	

		return false;
	}

	const char* Name() const override 
	{ 
		return "MY MERGE";
	}

...
//later in the code (same cpp file though...)

m_Options.merge_operator.reset( new  DpxValueMerger );

returns the following error :

 undefined reference to `typeinfo for rocksdb::AssociativeMergeOperator'

Is there anything I did not understand as to how to use merge operators?

Thank you

@CaveNeCadas
Copy link
Author

Please close this thread... I found the solution.
I forgot to define USE_RTTI before invoking make static_lib

@leaout
Copy link

leaout commented Dec 13, 2019

Please close this thread... I found the solution.
I forgot to define USE_RTTI before invoking make static_lib

hi bro,I meet the same problem ,would you please show solution in detail?

@CaveNeCadas
Copy link
Author

Please close this thread... I found the solution.
I forgot to define USE_RTTI before invoking make static_lib

hi bro,I meet the same problem ,would you please show solution in detail?

Dude

This is how I compile

make  static_lib  EXTRA_CXXFLAGS=-fPIC EXTRA_CFLAGS=-fPIC USE_RTTI=1 DEBUG_LEVEL=0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants