Forum: Building VoltDB Clients

Post: Compiling C++ client in MacOS: Implicit instantiation of undefined template

Compiling C++ client in MacOS: Implicit instantiation of undefined template
skk
Jun 19, 2013
I was trying to compile the C++ client of VoltDb in my Mac. The client works fine with gcc. But when used with Apple LLVM compiler or LLVM-GCC compiler, I get error in the libraries of VoltDb.

The lines where is get the Implicit instantiation of undefined template errors are:

Table.h boost::shared_ptr<std::vector<voltdb::Column> > m_columns;
ClientConfig.h boost::shared_ptr<StatusListener> m_listener;
Client.h boost::shared_ptr<ClientImpl> m_impl;

Row.hpp boost::shared_ptr<std::vector<voltdb::Column> > m_columns;
boost::shared_ptr<std::vector<voltdb::Column> > columns

TableIterator.h boost::shared_ptr<std::vector<voltdb::Column> > m_columns;
boost::shared_ptr<std::vector<voltdb::Column> > columns

Can anyone please tell me where i need to make the modification in the compiler. I am using Xcode.

Also the compilers I have used are LLVMGCC4.2 and Apple LLVM Compiler 4.2.

Thanks
SK
jhugg
Jun 19, 2013
Clang seems to be a bit stricter about letting some things through than GCC, and it seems to get more strict with every release. I patched up the server yesterday to build with Clang 5.0 / LLVM 3.3, but I haven't poked the client in a while.

We're probably just missing a header or declaration that gcc is less strict about. We'll take a look. Thanks for letting us know.
nshi
Jun 19, 2013
Hi SK,

I tried it on my Mac by typing 'make' in the client lib directory and it worked. The makefile uses g++ to compile. Did you change it to clang and had the errors?

Thanks
skk
Jun 20, 2013
@jhugg: Can you please let me know when you have solved the issue. It would be of great help.

@ning: You are right. I was also able to compile with make. In my case also g++ was used. Trouble started with lllvm and the same continued when I tried using Apple LLVM and LLVM-GCC in Xcode4.
jhugg
Jun 21, 2013
Can you send me your modified makefile and/or XCode 4.2 project?
jhugg
Jun 21, 2013
In XCode, I needed to add "include" to The "Search Paths" -> "Header Search Paths" field to make it compile. This is because the parts of Boost that we use are just sitting in the "include" directory and aren't real system headers, yet we use angle-brackets to include them. But the makefile takes care of this, so maybe I'm just being hopeful.
skk
Jun 24, 2013
In XCode, I needed to add "include" to The "Search Paths" -> "Header Search Paths" field to make it compile. This is because the parts of Boost that we use are just sitting in the "include" directory and aren't real system headers, yet we use angle-brackets to include them. But the makefile takes care of this, so maybe I'm just being hopeful.


I have tried to do the same. But I am still getting errors. I have attached the code for your reference.
Please let me know the error.

Thanks
SK
skk
Jun 25, 2013
Could it be improper linking of the library files lib*.a