csnippets-bugs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Csnippets-bugs] Errors when trying to compile


From: Ron Spain
Subject: [Csnippets-bugs] Errors when trying to compile
Date: Sun, 13 Jan 2013 12:07:07 -0800 (PST)

CSnippets seems to have a lot of useful functions, and I see that it's still growing.

However, I'm having some difficulties getting it to compile. I installed cmake, but the build.sh script is still seemingly not fully working for me, even when compiling the latest code that I downloaded from github this morning. This is what happens:

address@hidden:~$ cd Desktop/
address@hidden:~/Desktop$ cd csnippets-master/
address@hidden:~/Desktop/csnippets-master$ ./build.sh 
Generating Makefile with -DCMAKE_BUILD_TYPE=RelWithDebInfo
-- The C compiler identification is GNU
-- The CXX compiler identification is GNU
-- Check for working C compiler: /usr/bin/gcc
-- Check for working C compiler: /usr/bin/gcc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Build type: RelWithDebInfo
-- Build commit: devel
-- Build revision: 0
-- Found libintl: /usr/lib/libgettextlib.so
-- Debug information: ON
-- Using interface: Epoll
-- Link to static libraries: ON
-- Configuring done
CMake Error in CMakeLists.txt:
  Cannot find source file "client.c".  Tried extensions .c .C .c++ .cc .cpp
  .cxx .m .M .mm .h .hh .h++ .hm .hpp .hxx .in .txx


-- Build files have been written to: /home/ron/Desktop/csnippets-master/build
address@hidden:~/Desktop/csnippets-master$ 

It produces some files, but I don't have much experience with Linux shell scripts and have not yet deciphered the problem with that other than it can't find client.c even though it's in it's folder in examples/client.

When I cd to examples/client and try to compile client.c manually, I get more problems, even after I copied the csnippets headers folder to my /usr/include folder:

The bool type is not defined in traditional C, only in newer standards or C++, so I add -Dbool=int to my compile options on GCC. But shouldn't there be a better solution for users? I'm not sure what that should be - maybe something similar to this near the top of a header:

#ifndef __cplusplus
typedef int bool;
#endif

Or use stdbool.h? That should additionally have definitions for true and false, which are also used but are undefined and cause errors when I try to compile.

The type size_t is used in socket.h, but it is apparently defined in string.h, yet string.h is not included in socket.h so that size_t may be available.

Also, the example file client.c doesn't include stdlib.h header, which is needed. There are some more little problems like that. I've used compilers that automatically include files, and my compiler seems kind of strict about everything, but I'm just using normal settings for GCC over here. I'm concerned that other users will have difficulty trying to figure out these problems in order to successfully use the CSnippets code.

The file socket.c tries to include internal/socket_compat.h, but this file was not in my computer (running a recent Debian, compiling CSnippets with GCC). I found a version of a file with the same name online, but I can't be sure it's the correct file or that it will work. Should the intended file perhaps be included in CSnippets, or shouldn't users at least be told where they can find the file in a text file? Or am I missing something?

I'm a noob to Savannah and collaborative programming, so I wasn't sure if I should report some of these issues as bugs, "fork the repository" and start making the changes that I feel are needed as time permits, or what.

Have a nice day,
Ron

reply via email to

[Prev in Thread] Current Thread [Next in Thread]