Skip to content
This repository has been archived by the owner on Nov 4, 2023. It is now read-only.

Issue with installing the Capn C library #11

Open
easwaraa opened this issue Dec 16, 2015 · 0 comments
Open

Issue with installing the Capn C library #11

easwaraa opened this issue Dec 16, 2015 · 0 comments

Comments

@easwaraa
Copy link

Hello,

I am new to the world of installing C libraries and I am having the task of installing capnp C libraries using g++ v4.8 in our RHEL6 environment.

I downloaded the source from https://github.com/jmckaskill/c-capnproto and ran make which gave me the below error.

~/tmp/c-capnproto-master $ env CC=/opt/rh/devtoolset-2/root/usr/bin/gcc CXX=/opt/rh/devtoolset-2/root/usr/bin/g++ make
/opt/rh/devtoolset-2/root/usr/bin/gcc -O2 -Wall -Werror -fPIC -I. -Wno-unused-function -c capn.c -o capn.o
capn.c: In function \u2018lookup_segment\u2019:
capn.c:221:19: error: \u2018y\u2019 may be used uninitialized in this function [-Werror=maybe-uninitialized]
s->hdr.parent = &y->hdr;
^
capn.c:222:6: error: \u2018x\u2019 may be used uninitialized in this function [-Werror=maybe-uninitialized]
x = &s->hdr;
^
cc1: all warnings being treated as errors
make: *
* [capn.o] Error 1

From #4, I understood that this fixed now and hence I downloaded the new code from flashforward branch and ran make.

Then, it was failing as gtest library wasn't available. I followed the steps in http://stackoverflow.com/questions/13513905/how-to-setup-googletest-as-a-shared-library-on-linux to install the gtest library and now it's failing with the below error.

~/tmp/c-capnproto-flashforward $ env CC=/opt/rh/devtoolset-2/root/usr/bin/gcc CXX=/opt/rh/devtoolset-2/root/usr/bin/g++ make
/opt/rh/devtoolset-2/root/usr/bin/g++ -g -Wall -Werror -I. -I../gtest/include -o capn-test.o -c capn-test.cpp
In file included from capn-test.cpp:7:0:
capn-malloc.c: In function \u2018int init_fp(capn_, FILE_, capn_stream_, int)\u2019:
capn-malloc.c:114:28: error: \u2018UINT32_MAX\u2019 was not declared in this scope
if (n > INT_MAX/8 || n > UINT32_MAX/8 || UINT32_MAX - total < n_8)
^
In file included from /usr/include/gtest/gtest.h:1929:0,
from capn-test.cpp:1:
capn-test.cpp: In member function \u2018virtual void WireFormat_SimpleRawDataStruct_Test::TestBody()\u2019:
capn-test.cpp:54:40: error: \u2018UINT64_C\u2019 was not declared in this scope
EXPECT_EQ(UINT64_C(0xefcdab8967452301), capn_read64(ptr, 0));
^
capn-test.cpp:54:3: error: template argument 1 is invalid
EXPECT_EQ(UINT64_C(0xefcdab8967452301), capn_read64(ptr, 0));
^
capn-test.cpp:55:23: error: \u2018UINT64_C\u2019 was not declared in this scope
EXPECT_EQ(UINT64_C(0), capn_read64(ptr, 8));
^
capn-test.cpp:55:3: error: template argument 1 is invalid
EXPECT_EQ(UINT64_C(0), capn_read64(ptr, 8));
^
capn-test.cpp:56:32: error: \u2018UINT32_C\u2019 was not declared in this scope
EXPECT_EQ(UINT32_C(0x67452301), capn_read32(ptr, 0));
^
capn-test.cpp:56:3: error: template argument 1 is invalid
EXPECT_EQ(UINT32_C(0x67452301), capn_read32(ptr, 0));
^
capn-test.cpp:57:32: error: \u2018UINT32_C\u2019 was not declared in this scope
EXPECT_EQ(UINT32_C(0xefcdab89), capn_read32(ptr, 4));
^
capn-test.cpp:57:3: error: template argument 1 is invalid
EXPECT_EQ(UINT32_C(0xefcdab89), capn_read32(ptr, 4));
^
capn-test.cpp:58:23: error: \u2018UINT32_C\u2019 was not declared in this scope
EXPECT_EQ(UINT32_C(0), capn_read32(ptr, 8));
^
capn-test.cpp:58:3: error: template argument 1 is invalid
EXPECT_EQ(UINT32_C(0), capn_read32(ptr, 8));
^
capn-test.cpp:59:28: error: \u2018UINT16_C\u2019 was not declared in this scope
EXPECT_EQ(UINT16_C(0x2301), capn_read16(ptr, 0));
^
capn-test.cpp:59:3: error: template argument 1 is invalid
EXPECT_EQ(UINT16_C(0x2301), capn_read16(ptr, 0));
^
capn-test.cpp:60:28: error: \u2018UINT16_C\u2019 was not declared in this scope
EXPECT_EQ(UINT16_C(0x6745), capn_read16(ptr, 2));
^
capn-test.cpp:60:3: error: template argument 1 is invalid
EXPECT_EQ(UINT16_C(0x6745), capn_read16(ptr, 2));
^
capn-test.cpp:61:28: error: \u2018UINT16_C\u2019 was not declared in this scope
EXPECT_EQ(UINT16_C(0xab89), capn_read16(ptr, 4));
^
capn-test.cpp:61:3: error: template argument 1 is invalid
EXPECT_EQ(UINT16_C(0xab89), capn_read16(ptr, 4));
^
capn-test.cpp:62:28: error: \u2018UINT16_C\u2019 was not declared in this scope
EXPECT_EQ(UINT16_C(0xefcd), capn_read16(ptr, 6));
^
capn-test.cpp:62:3: error: template argument 1 is invalid
EXPECT_EQ(UINT16_C(0xefcd), capn_read16(ptr, 6));
^
capn-test.cpp:63:23: error: \u2018UINT16_C\u2019 was not declared in this scope
EXPECT_EQ(UINT16_C(0), capn_read16(ptr, 8));
^
capn-test.cpp:63:3: error: template argument 1 is invalid
EXPECT_EQ(UINT16_C(0), capn_read16(ptr, 8));
^
capn-test.cpp: In function \u2018void setupStruct(capn_)\u2019:
capn-test.cpp:77:64: error: \u2018UINT64_C\u2019 was not declared in this scope
EXPECT_EQ(0, capn_write64(ptr, 0, UINT64_C(0x1011121314151617)));
^
capn-test.cpp:78:56: error: \u2018UINT32_C\u2019 was not declared in this scope
EXPECT_EQ(0, capn_write32(ptr, 8, UINT32_C(0x20212223)));
^
capn-test.cpp:79:53: error: \u2018UINT16_C\u2019 was not declared in this scope
EXPECT_EQ(0, capn_write16(ptr, 12, UINT16_C(0x3031)));
^
capn-test.cpp: In function \u2018void checkStruct(capn_)\u2019:
capn-test.cpp:156:40: error: \u2018UINT64_C\u2019 was not declared in this scope
EXPECT_EQ(UINT64_C(0x1011121314151617), capn_read64(ptr, 0));
^
capn-test.cpp:156:3: error: template argument 1 is invalid
EXPECT_EQ(UINT64_C(0x1011121314151617), capn_read64(ptr, 0));
^
capn-test.cpp:157:32: error: \u2018UINT32_C\u2019 was not declared in this scope
EXPECT_EQ(UINT32_C(0x20212223), capn_read32(ptr, 8));
^
capn-test.cpp:157:3: error: template argument 1 is invalid
EXPECT_EQ(UINT32_C(0x20212223), capn_read32(ptr, 8));
^
make: *** [capn-test.o] Error 1

Any thoughts on this? Please let me know if I am missing something here.

-Ram

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

No branches or pull requests

1 participant