The compiler error I'm getting from g++ is
./Debug_gcc_lin64_5610_ST/tom.o: In function `process_P2T_CUST(IPC*)':
/mxhome/charrison/git/libs/tom.cpp:512: undefined reference to `memorize_block(boost::unordered_map< ... >&, Block const&)'
(Ellipsis mine).
The source code snippet containing the undefined reference is:
void
process_P2T_CUST(IPC *client_ipc) {
// Get list of record types in block
Block& block = client_ipc->get_block();
block.get_record_types(input_record_set);
// Reset associative memory
memory.clear();
// Add all field=value pairs from P2T_CUST into memory
memorize_block(memory, block);
And the header definition of memorize_block is:
void memorize_block(MemoryBank&, Block&);
Now: here's how I interpret the error message - the linker (or actually the compiler) has somehow inferred that the required signature of memorize_block() must have parm1 = unordered_map&
, and parm2 = Block const&
.
But why does it think that the Block should be const?
If I haven't provided enough source code, please comment and I'll amend this question accordingly.
UPDATE 1 Here is the code for memorize_block, which is in the same compilation unit as the reference. There is no other definition anywhere.
void
memorize_block(MemoryBank& memory, Block &block) {
D_RecordType_Vector record_types;
block.get_record_types(record_types);
BOOST_FOREACH(const D_RecordType_Set::value_type& rec_type, record_types) {
block.traverse_record(rec_type, add_to_memory(memory));
}
}