How to compile Selenium on Debian Jessie, failing on ibus - c++

When I compile Selenium on Debian Jessie, it gives me the output below. I have ibus lib installed. I think the version I use is different.
How can I solve it?
If you need to provide any environment configuration, write me what cmd output should I post here.
...
Compiling: //cpp:imehandler64 as build/cpp/amd64/libimehandler64.so
cpp/imehandler/linux/src/ibushandler.cpp: In member function ‘virtual std::string IBusHandler::GetActiveEngine() const’:
cpp/imehandler/linux/src/ibushandler.cpp:70:37: error: ‘IBusEngineDesc’ has no member named ‘name’
engine_name = std::string(desc->name);
^
cpp/imehandler/linux/src/ibushandler.cpp: In member function ‘IBusInputContext* IBusHandler::GetCurrentInputContext() const’:
cpp/imehandler/linux/src/ibushandler.cpp:88:3: error: ‘IBusConnection’ was not declared in this scope
IBusConnection* conn = ibus_bus_get_connection(bus_);
^
cpp/imehandler/linux/src/ibushandler.cpp:88:19: error: ‘conn’ was not declared in this scope
IBusConnection* conn = ibus_bus_get_connection(bus_);
^
cpp/imehandler/linux/src/ibushandler.cpp: In member function ‘virtual bool IBusHandler::IsActivated() const’:
cpp/imehandler/linux/src/ibushandler.cpp:110:47: error: ‘ibus_input_context_is_enabled’ was not declared in this scope
return ibus_input_context_is_enabled(context);
^
cpp/imehandler/linux/src/ibushandler.cpp: In member function ‘virtual void IBusHandler::Deactivate()’:
cpp/imehandler/linux/src/ibushandler.cpp:127:37: error: ‘ibus_input_context_disable’ was not declared in this scope
ibus_input_context_disable(context);
...

Related

Not able to build Raft implementation of LogCabin using scons and Protobuf 3

I am not able to build RAFT implementation of LogCabin (C++) using scons and protobuf3 in Ubuntu.
Errors be like
usr/local/include/google/protobuf/repeated_field.h: In member function ‘int google::protobuf::RepeatedPtrField<Element>::SpaceUsedExcludingSelf() const’:
/usr/local/include/google/protobuf/repeated_field.h:888:12: error: ‘ToIntSize’ is not a member of ‘google::protobuf::internal’
return internal::ToIntSize(SpaceUsedExcludingSelfLong());
^
In file included from /usr/local/include/google/protobuf/map.h:48:0,from /usr/local/include/google/protobuf/generated_message_table_driven.h:34, from ./build/Protocol/ServerStats.pb.h:25, from build/Tree/Tree.cc:19:
/usr/local/include/google/protobuf/map_type_handler.h: In static member function ‘static void google::protobuf::internal::MapTypeHandler<(google::protobuf::internal::WireFormatLite::FieldType)9u, Type>::Clear(google::protobuf::internal::MapTypeHandler<(google::protobuf::internal::WireFormatLite::FieldType)9u, Type>::TypeOnMemory*, google::protobuf::Arena*)’:
/usr/local/include/google/protobuf/map_type_handler.h:638:1: error: ‘GetEmptyStringAlreadyInited’ is not a member of ‘google::protobuf::internal’
STRING_OR_BYTES_HANDLER_FUNCTIONS(STRING)
Please suggest how do I proceed.!

C++ program compilation fails in Ubuntu, but works in MacOSX

Hi I've a program written in C++. When I compile it in Mac terminal with g++ compiler, it compiles and runs. But when I compile the same C++ program in Ubuntu terminal with g++ compiler, it Fails. I don't know why it happens.
g++ compiler version in Ubuntu is 4.7.3.
Here is my code sample
#include <iostream>
using namespace std;
#define IXSIZE 400
#define IYSIZE 400
#define IZSIZE 3
void putbyte(FILE *outf, unsigned char val)
{
unsigned char buf[1];
buf[0] = val;
fwrite(buf,1,1,outf);
}
void putshort(FILE *outf, unsigned short val)
{
unsigned char buf[2];
buf[0] = (val>>8);
buf[1] = (val>>0);
fwrite(buf,2,1,outf);
}
I get following error
seperate.cpp: In function ‘void putbyte(FILE*, unsigned char)’:
seperate.cpp:23:21: error: ‘fwrite’ was not declared in this scope
seperate.cpp: In function ‘void putshort(FILE*, short unsigned int)’:
seperate.cpp:32:21: error: ‘fwrite’ was not declared in this scope
seperate.cpp: In function ‘int putlong(FILE*, long unsigned int)’:
seperate.cpp:43:28: error: ‘fwrite’ was not declared in this scope
seperate.cpp: In function ‘short unsigned int getshort(FILE*)’:
seperate.cpp:49:22: error: ‘fread’ was not declared in this scope
seperate.cpp: In function ‘long int getlong(FILE*)’:
seperate.cpp:56:22: error: ‘fread’ was not declared in this scope
seperate.cpp: In function ‘int main(int, char**)’:
seperate.cpp:88:11: error: ‘stderr’ was not declared in this scope
seperate.cpp:88:69: error: ‘fprintf’ was not declared in this scope
seperate.cpp:89:9: error: ‘exit’ was not declared in this scope
seperate.cpp:93:30: error: ‘fopen’ was not declared in this scope
seperate.cpp:95:11: error: ‘stderr’ was not declared in this scope
seperate.cpp:95:61: error: ‘fprintf’ was not declared in this scope
seperate.cpp:96:9: error: ‘exit’ was not declared in this scope
seperate.cpp:101:22: error: ‘fgetc’ was not declared in this scope
seperate.cpp:114:18: error: ‘SEEK_CUR’ was not declared in this scope
seperate.cpp:114:26: error: ‘fseek’ was not declared in this scope
seperate.cpp:126:38: error: ‘fread’ was not declared in this scope
seperate.cpp:131:12: error: ‘fclose’ was not declared in this scope
seperate.cpp:138:25: error: ‘fopen’ was not declared in this scope
seperate.cpp:141:11: error: ‘stderr’ was not declared in this scope
seperate.cpp:141:54: error: ‘fprintf’ was not declared in this scope
seperate.cpp:142:9: error: ‘exit’ was not declared in this scope
seperate.cpp:153:36: error: ‘fwrite’ was not declared in this scope
seperate.cpp:162:11: error: ‘stderr’ was not declared in this scope
seperate.cpp:162:54: error: ‘fprintf’ was not declared in this scope
seperate.cpp:163:9: error: ‘exit’ was not declared in this scope
seperate.cpp:174:36: error: ‘fwrite’ was not declared in this scope
seperate.cpp:183:11: error: ‘stderr’ was not declared in this scope
seperate.cpp:183:54: error: ‘fprintf’ was not declared in this scope
seperate.cpp:184:9: error: ‘exit’ was not declared in this scope
seperate.cpp:195:36: error: ‘fwrite’ was not declared in this scope
dfo#ubuntu:~/Desktop/abc-master$ g++ -v
You need to include stdio.h for fwrite and FILE.
#include <stdio.h>
The standard allows headers to include other headers, but you cannot rely on these indirect includes. You need to explicitly include every header you intend to use.

Gobby 0.4.12 install error

I ran across the following error when attempting to install Gobby 0.4.12 from source on Ubuntu 13.10. Any ideas?
I'm fairly confident it's a version error, but I'm curious if anyone else has run across this same problem and found a fix.
src/gselector.cpp: In member function ‘void Gobby::GSelector::add_socket(const net6::socket&, net6::io_condition)’:
src/gselector.cpp:87:17: error: ‘signal_io’ is not a member of ‘Glib’
sel.io_conn = Glib::signal_io().connect(
^
src/gselector.cpp: In member function ‘void Gobby::GSelector::modify_socket(std::map<const net6::socket*, Gobby::GSelector::SelectedSocket>::iterator, net6::io_condition)’:
src/gselector.cpp:109:27: error: ‘signal_io’ is not a member of ‘Glib’
iter->second.io_conn = Glib::signal_io().connect(
^
src/gselector.cpp: In member function ‘void Gobby::GSelector::set_timeout(const net6::socket&, long unsigned int)’:
src/gselector.cpp:226:24: error: ‘signal_timeout’ is not a member of ‘Glib’
sel_sock->time_conn = Glib::signal_timeout().connect(
This A Known Bug And It Has Been Fixed In sobby - 0.4.8-1
Check Here:
https://bugs.launchpad.net/ubuntu/+source/sobby/+bug/935447

CppCMS build constructor & declaration

From http://cppcms.com/wikipp/en/page/cppcms_1x_forms,
According to this,
A declaration introduces one or more names into a program.....
Therefore, classes, structures, enumerated types, and other
user-defined types can be declared for each compilation unit
AFAIK, constructor should be in myapp.cpp, while declaration should be in content.h. So I put
There are 5 fields on the form. In CppCMS, the form built using 3 codes (the 4th codes are restriction for the fields)
1st codes:
name.message("Your Name");
sex.message("Sex");
marital.message("Marital Status");
age.message("Your Age");
submit.value("Send");
2nd codes:
add(name);
add(sex);
add(marital);
add(age);
add(submit);
3rd codes:
sex.add("Male","male");
sex.add("Female","female");
marital.add("Single","single");
marital.add("Married","married");
marital.add("Divorced","divorced");
4th codes, are restriction for the fields:
name.non_empty();
age.range(0,120);
I'm quite confused which one should be declaration
------------------added
I've tried add all above codes in myapp.cpp like below:
class myapp : public cppcms::application {
public:
myapp(cppcms::service &srv) : cppcms::application(srv)
{
dispatcher().assign("",&myapp::info_form,this);
mapper().assign("");
}
void info_form()
{
name.message("Your Name");
sex.message("Sex");
marital.message("Marital Status");
age.message("Your Age");
submit.value("Send");
add(name);
add(sex);
add(marital);
add(age);
add(submit);
sex.add("Male","male");
sex.add("Female","female");
marital.add("Single","single");
marital.add("Married","married");
marital.add("Divorced","divorced");
name.non_empty();
age.range(0,120);
}
};
But it still giving error:
myapp.cpp: In member function ‘void myapp::info_form()’:
myapp.cpp:20:9: error: ‘name’ was not declared in this scope
myapp.cpp:21:9: error: ‘sex’ was not declared in this scope
myapp.cpp:22:9: error: ‘marital’ was not declared in this scope
myapp.cpp:23:9: error: ‘age’ was not declared in this scope
myapp.cpp:24:9: error: ‘submit’ was not declared in this scope
myapp.cpp:24:9: note: suggested alternative:
/usr/local/include/cppcms/form.h:1574:20: note: ‘cppcms::widgets::submit’
myapp.cpp: At global scope:
myapp.cpp:43:37: error: no ‘void myapp::main(std::string)’ member function declared in class ‘myapp’
my_skin.tmpl:4:2: error: expected unqualified-id before ‘if’
my_skin.tmpl:8:3: error: expected unqualified-id before ‘else’
my_skin.tmpl:12:8: error: expected constructor, destructor, or type conversion before ‘<<’ token
my_skin.tmpl:13:2: error: expected unqualified-id before ‘{’ token

Compiling C++ for Python using Swig

I have successfully generated the .py and .cpp files needed using:
swig -c++ -python sf_c_api.i
but now I'm trying to make the shared object (.so) and I'm getting swamped with errors.
g++ -Wall -g -fPIC -I/usr/include/python2.6 -c atob.c fish.c maby_swap.c pwd_file.c pwd.c setup_fish.c shs.c sf_c_api.cpp sha1.cpp sf_c_api_wrap.cpp
Can anyone make heads or tails of this g++ output?
In file included from /usr/include/python2.6/Python.h:8,
from sf_c_api_wrap.cpp:149:
/usr/include/python2.6/pyconfig.h:1038:1: warning: "_XOPEN_SOURCE" redefined
<built-in>: warning: this is the location of the previous definition
In file included from /usr/gcc/4.4/lib/gcc/i386-pc-solaris2.11/4.4.4/../../../../include/c++/4.4.4/bits/postypes.h:42,
from /usr/gcc/4.4/lib/gcc/i386-pc-solaris2.11/4.4.4/../../../../include/c++/4.4.4/bits/char_traits.h:42,
from /usr/gcc/4.4/lib/gcc/i386-pc-solaris2.11/4.4.4/../../../../include/c++/4.4.4/string:42,
from /usr/gcc/4.4/lib/gcc/i386-pc-solaris2.11/4.4.4/../../../../include/c++/4.4.4/stdexcept:39,
from sf_c_api_wrap.cpp:3024:
/usr/gcc/4.4/lib/gcc/i386-pc-solaris2.11/4.4.4/../../../../include/c++/4.4.4/cwchar:143: error: ‘::btowc’ has not been declared
/usr/gcc/4.4/lib/gcc/i386-pc-solaris2.11/4.4.4/../../../../include/c++/4.4.4/cwchar:148: error: ‘::fwide’ has not been declared
/usr/gcc/4.4/lib/gcc/i386-pc-solaris2.11/4.4.4/../../../../include/c++/4.4.4/cwchar:149: error: ‘::fwprintf’ has not been declared
/usr/gcc/4.4/lib/gcc/i386-pc-solaris2.11/4.4.4/../../../../include/c++/4.4.4/cwchar:150: error: ‘::fwscanf’ has not been declared
/usr/gcc/4.4/lib/gcc/i386-pc-solaris2.11/4.4.4/../../../../include/c++/4.4.4/cwchar:153: error: ‘::mbrlen’ has not been declared
/usr/gcc/4.4/lib/gcc/i386-pc-solaris2.11/4.4.4/../../../../include/c++/4.4.4/cwchar:154: error: ‘::mbrtowc’ has not been declared
/usr/gcc/4.4/lib/gcc/i386-pc-solaris2.11/4.4.4/../../../../include/c++/4.4.4/cwchar:155: error: ‘::mbsinit’ has not been declared
/usr/gcc/4.4/lib/gcc/i386-pc-solaris2.11/4.4.4/../../../../include/c++/4.4.4/cwchar:156: error: ‘::mbsrtowcs’ has not been declared
/usr/gcc/4.4/lib/gcc/i386-pc-solaris2.11/4.4.4/../../../../include/c++/4.4.4/cwchar:159: error: ‘::swprintf’ has not been declared
/usr/gcc/4.4/lib/gcc/i386-pc-solaris2.11/4.4.4/../../../../include/c++/4.4.4/cwchar:160: error: ‘::swscanf’ has not been declared
/usr/gcc/4.4/lib/gcc/i386-pc-solaris2.11/4.4.4/../../../../include/c++/4.4.4/cwchar:162: error: ‘::vfwprintf’ has not been declared
/usr/gcc/4.4/lib/gcc/i386-pc-solaris2.11/4.4.4/../../../../include/c++/4.4.4/cwchar:166: error: ‘::vswprintf’ has not been declared
/usr/gcc/4.4/lib/gcc/i386-pc-solaris2.11/4.4.4/../../../../include/c++/4.4.4/cwchar:170: error: ‘::vwprintf’ has not been declared
/usr/gcc/4.4/lib/gcc/i386-pc-solaris2.11/4.4.4/../../../../include/c++/4.4.4/cwchar:174: error: ‘::wcrtomb’ has not been declared
/usr/gcc/4.4/lib/gcc/i386-pc-solaris2.11/4.4.4/../../../../include/c++/4.4.4/cwchar:185: error: ‘::wcsrtombs’ has not been declared
/usr/gcc/4.4/lib/gcc/i386-pc-solaris2.11/4.4.4/../../../../include/c++/4.4.4/cwchar:195: error: ‘::wctob’ has not been declared
/usr/gcc/4.4/lib/gcc/i386-pc-solaris2.11/4.4.4/../../../../include/c++/4.4.4/cwchar:196: error: ‘::wmemcmp’ has not been declared
/usr/gcc/4.4/lib/gcc/i386-pc-solaris2.11/4.4.4/../../../../include/c++/4.4.4/cwchar:197: error: ‘::wmemcpy’ has not been declared
/usr/gcc/4.4/lib/gcc/i386-pc-solaris2.11/4.4.4/../../../../include/c++/4.4.4/cwchar:198: error: ‘::wmemmove’ has not been declared
/usr/gcc/4.4/lib/gcc/i386-pc-solaris2.11/4.4.4/../../../../include/c++/4.4.4/cwchar:199: error: ‘::wmemset’ has not been declared
/usr/gcc/4.4/lib/gcc/i386-pc-solaris2.11/4.4.4/../../../../include/c++/4.4.4/cwchar:200: error: ‘::wprintf’ has not been declared
/usr/gcc/4.4/lib/gcc/i386-pc-solaris2.11/4.4.4/../../../../include/c++/4.4.4/cwchar:201: error: ‘::wscanf’ has not been declared
/usr/gcc/4.4/lib/gcc/i386-pc-solaris2.11/4.4.4/../../../../include/c++/4.4.4/cwchar:205: error: ‘::wcsstr’ has not been declared
/usr/gcc/4.4/lib/gcc/i386-pc-solaris2.11/4.4.4/../../../../include/c++/4.4.4/cwchar:206: error: ‘::wmemchr’ has not been declared
/usr/gcc/4.4/lib/gcc/i386-pc-solaris2.11/4.4.4/../../../../include/c++/4.4.4/cwchar: In function ‘wchar_t* std::wcsstr(wchar_t*, const wchar_t*)’:
/usr/gcc/4.4/lib/gcc/i386-pc-solaris2.11/4.4.4/../../../../include/c++/4.4.4/cwchar:223: error: invalid conversion from ‘const wchar_t*’ to ‘wchar_t*’
/usr/gcc/4.4/lib/gcc/i386-pc-solaris2.11/4.4.4/../../../../include/c++/4.4.4/cwchar:223: error: initializing argument 1 of ‘wchar_t* std::wcsstr(wchar_t*, const wchar_t*)’
/usr/gcc/4.4/lib/gcc/i386-pc-solaris2.11/4.4.4/../../../../include/c++/4.4.4/cwchar: In function ‘wchar_t* std::wmemchr(wchar_t*, wchar_t, size_t)’:
/usr/gcc/4.4/lib/gcc/i386-pc-solaris2.11/4.4.4/../../../../include/c++/4.4.4/cwchar:227: error: invalid conversion from ‘const wchar_t*’ to ‘wchar_t*’
/usr/gcc/4.4/lib/gcc/i386-pc-solaris2.11/4.4.4/../../../../include/c++/4.4.4/cwchar:227: error: initializing argument 1 of ‘wchar_t* std::wmemchr(wchar_t*, wchar_t, size_t)’
In file included from /usr/gcc/4.4/lib/gcc/i386-pc-solaris2.11/4.4.4/../../../../include/c++/4.4.4/string:42,
from /usr/gcc/4.4/lib/gcc/i386-pc-solaris2.11/4.4.4/../../../../include/c++/4.4.4/stdexcept:39,
from sf_c_api_wrap.cpp:3024:
/usr/gcc/4.4/lib/gcc/i386-pc-solaris2.11/4.4.4/../../../../include/c++/4.4.4/bits/char_traits.h: In static member function ‘static int std::char_traits<wchar_t>::compare(const wchar_t*, const wchar_t*, size_t)’:
/usr/gcc/4.4/lib/gcc/i386-pc-solaris2.11/4.4.4/../../../../include/c++/4.4.4/bits/char_traits.h:330: error: ‘wmemcmp’ was not declared in this scope/usr/gcc/4.4/lib/gcc/i386-pc-solaris2.11/4.4.4/../../../../include/c++/4.4.4/bits/char_traits.h: In static member function ‘static const wchar_t* std::char_traits<wchar_t>::find(const wchar_t*, size_t, const wchar_t&)’:
/usr/gcc/4.4/lib/gcc/i386-pc-solaris2.11/4.4.4/../../../usr/gcc/4.4/lib/gcc/i386-pc-solaris2.11/4.4.4/../../../../include/c++/4.4.4/bits/char_traits.h:338: error: initializing argument 1 of ‘wchar_t* std::wmemchr(wchar_t*, wchar_t, size_t)’
/usr/gcc/4.4/lib/gcc/i386-pc-solaris2.11/4.4.4/../../../../include/c++/4.4.4/bits/char_traits.h: In static member function ‘static wchar_t* std::char_traits<wchar_t>::move(wchar_t*, const wchar_t*, size_t)’:
/usr/gcc/4.4/lib/gcc/i386-pc-solaris2.11/4.4.4/../../../../include/c++/4.4.4/bits/char_traits.h:342: error: ‘wmemmove’ was not declared in this scope
/usr/gcc/4.4/lib/gcc/i386-pc-solaris2.11/4.4.4/../../../../include/c++/4.4.4/bits/char_traits.h: In static member function ‘static wchar_t* std::char_traits<wchar_t>::copy(wchar_t*, const wchar_t*, size_t)’:
/usr/gcc/4.4/lib/gcc/i386-pc-solaris2.11/4.4.4/../../../../include/c++/4.4.4/bits/char_traits.h:346: error: ‘wmemcpy’ was not declared in this scope
/usr/gcc/4.4/lib/gcc/i386-pc-solaris2.11/4.4.4/../../../../include/c++/4.4.4/bits/char_traits.h: In static member function ‘static wchar_t* std::char_traits<wchar_t>::assign(wchar_t*, size_t, wchar_t)’:
/usr/gcc/4.4/lib/gcc/i386-pc-solaris2.11/4.4.4/../../../../include/c++/4.4.4/bits/char_traits.h:350: error: ‘wmemset’ was not declared in this scope
/../include/c++/4.4.4/bits/char_traits.h:338: error: invalid conversion from ‘const wchar_t*’ to ‘wchar_t*’
I found a solution.
The problem is that under solaris:
If -D_XOPEN_SOURCE_EXTENDED=1, g++ cannot compile even an empty body
that #includes <iostream>. If it's undefined, then gcc cannot compile
C code.
[source]
and from /usr/include/python2.6/pyconfig.h:
/* Define to activate Unix95-and-earlier features */
#define _XOPEN_SOURCE_EXTENDED 1
Removing the XOPEN definitions fixed my problem.