"AR/config.h" Not Found - c

I am trying to compile the simpleLite.c example from the ARToolKit5 examples page. If I run the .app file, it works fine. I wanted to see if I could modify anything in the file, so I tried to make the file again but I get the errors:
./Makefile.in: line 49: ../../include: is a directory
./Makefile.in: line 50: ../../lib: is a directory
./Makefile.in: line 51: ../../bin: is a directory
./Makefile.in: line 54: LIB_DIR: command not found
./Makefile.in: line 54: LIB_DIR: command not found
./Makefile.in: line 54: -L/#SYSTEM#: No such file or directory
./Makefile.in: line 55: -lARgsub_lite: command not found
./Makefile.in: line 56: INC_DIR: command not found
./Makefile.in: line 56: #CFLAG#: command not found
./Makefile.in: line 58: OBJS: command not found
./Makefile.in: line 59: HEADERS: command not found
./Makefile.in: line 61: BIN_DIR: command not found
./Makefile.in: line 61: all:: command not found
./Makefile.in: line 63: BIN_DIR: command not found
./Makefile.in: line 63: OBJS: command not found
./Makefile.in: line 63: /simpleLite:: No such file or directory
./Makefile.in: line 64: BIN_DIR: command not found
./Makefile.in: line 64: OBJS: command not found
./Makefile.in: line 64: LDFLAG: command not found
./Makefile.in: line 64: LIBS: command not found
clang: error: no such file or directory: 'simpleLite.o'
clang: error: no input files
./Makefile.in: line 66: HEADERS: command not found
./Makefile.in: line 66: simpleLite.o:: command not found
./Makefile.in: line 67: CFLAG: command not found
simpleLite.c:68:10: fatal error: 'AR/config.h' file not found
#include <AR/config.h>
^~~~~~~~~~~~~
1 error generated.
./Makefile.in: line 69: clean:: command not found
./Makefile.in: line 71: BIN_DIR: command not found
./Makefile.in: line 73: allclean:: command not found
./Makefile.in: line 75: BIN_DIR: command not found
./Makefile.in: line 78: distclean:: command not found
The folder contains three files, a makefile.in, a .plist file and the .c source code. The AR/config.h folder exists elsewhere in the ARToolKit5 archive (ARToolKit5/include/AR).
Normally, I'd assume I need to specify the path from the source folder, but there are also include statements like # include <GLUT/glut.h>, which aren't throwing errors.
I'm fairly new/rusty to C development, so I'm not sure what even to look up to fix this issue. Can anyone point me in the right direction? Do I need to specify the header paths, or is it something less obvious?

Related

How to compile a c file with multiple words name

I'm very very new to programming and mostly self taught (using command prompt). I tried to compile a c file that has multiple words as its filename and it showed error for all the words.
Example:
C:\Users\User\Desktop\Programming\toCompile>gcc -o Even or odd.exe
Even or Odd determinator.c
gcc: error: or: No such file or directory
gcc: error: odd.exe: No such file or directory
gcc: error: Even: No such file or directory
gcc: error: or: No such file or directory
gcc: error: Odd: No such file or directory
gcc: error: determinator.c: No such file or directory
gcc: fatal error: no input files
compilation terminated.
Do I have to rename the c files to one word names or is there another way?
Surround the file names in ' or ".
gcc -o 'Even or odd.exe' 'Even or Odd determinator.c'
But in the future, I'd avoid spaces in file names. Some build systems (make) can't work with spaces.

error when compiling telegram cli with cygwin

I followed the instruction in this page, but "cd tg && ./configure" command throws the following errors:
./configure: line 14: $'\r': command not found
./configure: line 29: syntax error near unexpected token `newline'
'/configure: line 29: ` ;;
no idea where should I look for the problem.

GCC not working but G++ does

I am trying to run some programs on a BeagleBone Black on the 'out of the box' operating system but I keep getting issues when compiling with gcc. This is best illustrated when trying to compile a simple hello world program:
#include <stdio.h>
int main(void)
{
printf("Hello World\n");
return 0;
}
The output from compiling and running this is:
debian#beaglebone:~$ g++ helloworld.c -o test
debian#beaglebone:~$ ./test
Hello World
debian#beaglebone:~$ gcc helloworld.c -o test
debian#beaglebone:~$ ./test
./test: line 27: typedef: command not found
./test: line 36: typedef: command not found
./test: line 37: typedef: command not found
./test: line 38: typedef: command not found
./test: line 39: typedef: command not found
./test: line 42: typedef: command not found
./test: line 43: typedef: command not found
./test: line 44: typedef: command not found
./test: line 45: typedef: command not found
./test: line 46: typedef: command not found
./test: line 47: typedef: command not found
./test: line 52: __extension__: command not found
./test: line 53: __extension__: command not found
./test: line 61: __extension__: command not found
./test: line 62: __extension__: command not found
./test: line 68: __extension__: command not found
./test: line 69: __extension__: command not found
./test: line 70: __extension__: command not found
./test: line 71: __extension__: command not found
./test: line 72: __extension__: command not found
./test: line 73: __extension__: command not found
./test: line 74: __extension__: command not found
./test: line 75: __extension__: command not found
./test: line 76: __extension__: command not found
./test: line 77: __extension__: command not found
./test: line 78: syntax error near unexpected token `}'
./test: line 78: `__extension__ typedef struct { int __val[2]; } __fsid_t;'
debian#beaglebone:~$
My gcc and g++ versions are:
debian#beaglebone:~$ gcc --version
gcc (Debian 4.7.2-5) 4.7.2
Copyright (C) 2012 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
debian#beaglebone:~$ g++ --version
g++ (Debian 4.7.2-5) 4.7.2
Copyright (C) 2012 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Has anyone come across this problem before? I've had a look around but none of the fixes seem applicable. Thanks in Advance.
edit: output of gcc -v helloworld.c -o outputFile
debian#beaglebone:~$ gcc -v helloworld.c -o outputFile
Using built-in specs.
COLLECT_GCC=gcc
Target: arm-linux-gnueabihf
Configured with: ../src/configure -v --with-pkgversion='Debian 4.7.2-5' --with-bugurl=file:///usr/share/doc/gcc-4.7/README.Bugs --enable-languages=c,c++,go,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-4.7 --enable-shared --enable-linker-build-id --with-system-zlib --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.7 --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --enable-gnu-unique-object --disable-libitm --enable-plugin --enable-objc-gc --disable-sjlj-exceptions --with-arch=armv7-a --with-fpu=vfpv3-d16 --with-float=hard --with-mode=thumb --enable-checking=release --build=arm-linux-gnueabihf --host=arm-linux-gnueabihf --target=arm-linux-gnueabihf
Thread model: posix
gcc version 4.7.2 (Debian 4.7.2-5)
COLLECT_GCC_OPTIONS='-E' '-v' '-o' 'outputFile' '-march=armv7-a' '-mfloat-abi=hard' '-mfpu=vfpv3-d16' '-mthumb' '-mtls-dialect=gnu'
/usr/lib/gcc/arm-linux-gnueabihf/4.7/cc1 -E -quiet -v -imultilib . -imultiarch arm-linux-gnueabihf helloworld.c -o outputFile -march=armv7-a -mfloat-abi=hard -mfpu=vfpv3-d16 -mthumb -mtls-dialect=gnu
ignoring nonexistent directory "/usr/local/include/arm-linux-gnueabihf"
ignoring nonexistent directory "/usr/lib/gcc/arm-linux-gnueabihf/4.7/../../../../arm-linux-gnueabihf/include"
#include "..." search starts here:
#include <...> search starts here:
/usr/lib/gcc/arm-linux-gnueabihf/4.7/include
/usr/local/include
/usr/lib/gcc/arm-linux-gnueabihf/4.7/include-fixed
/usr/include/arm-linux-gnueabihf
/usr/include
End of search list.
COMPILER_PATH=/usr/lib/gcc/arm-linux-gnueabihf/4.7/:/usr/lib/gcc/arm-linux-gnueabihf/4.7/:/usr/lib/gcc/arm-linux-gnueabihf/:/usr/lib/gcc/arm-linux-gnueabihf/4.7/:/usr/lib/gcc/arm-linux-gnueabihf/
LIBRARY_PATH=/usr/lib/gcc/arm-linux-gnueabihf/4.7/:/usr/lib/gcc/arm-linux-gnueabihf/4.7/../../../arm-linux-gnueabihf/:/usr/lib/gcc/arm-linux-gnueabihf/4.7/../../../:/lib/arm-linux-gnueabihf/:/lib/:/usr/lib/arm-linux-gnueabihf/:/usr/lib/
COLLECT_GCC_OPTIONS='-E' '-v' '-o' 'outputFile' '-march=armv7-a' '-mfloat-abi=hard' '-mfpu=vfpv3-d16' '-mthumb' '-mtls-dialect=gnu'
The secret is revealed in the verbose compiler output:
COLLECT_GCC_OPTIONS='-E' [...]
-E provokes GCC just to preprocess the input, so the resulting 'test' file actually is the input file with the single include resolved (recursively).
Since you did not add the -E parameter explicitely, gcc obviously did so implicitely. According to this discussion on gcc.gnu.org, your version of gcc seems to have this compiled in, so I assume you would have to recompile gcc from fixed source code - or get a properly compiled gcc version from whichever source (Debian repositories?).
You can try to use \gcc instead of gcc. The leading backslash tells the shell to ignore any aliases which might shadow the executable of the same name. You can also use the full gcc path to achieve the same.
You can also check there is no aliases or functions named gcc using type gcc, whatis gcc or maybe which gcc or even using a lower level set|grep gcc.

Trying to get input from mouse pointer with SDL in C

I'm a bit of a beginner with using ubuntu/C/SDL, so i'm unsure how to do this.
I have a project where i have to simulate a bird flock with the boids algorithm. I have done the algorithm, in the respect that you could put in a target array (e.g. a 2 number array containing the X and Y position of the target point) as input, and you get the position of each member of the flock as output. Put this in an infinite loop, and the positions of the birds will be continuously updated.
I'm now supposed to use the mouse pointer to get that target array. I've been supplied with a SDL framework somebody else has programmed. The instructions to get it working where:
Change the values in the makefile for LIBS INCLUDES and CXXFLAGS, with the values found by typing sdl-config --libs, and sdl-config --cflags into the command window.
If i type sdl-config --libs into the command window, i get:
-L/usr/lib/i386-linux-gnu -lSDL
Typing sdl-config --cflags yields:
-I/usr/include/SDL -D_GNU_SOURCE=1 -D_REENTRANT
I typed those in as posted below, but i cant compile the main program. Compiling with "gcc main.c -o exe" gives the error message:
main.c:4:17: fatal error: SDL.h: No such file or directory
compilation terminated.
I also tried to execute the makefile with ./Makefile, and get a list of errors starting with:
./Makefile: line 1: CXX: command not found
./Makefile: line 4: LIBS: command not found
./Makefile: line 5: INCLUDES: command not found
./Makefile: line 6: CXXFLAGS: command not found
./Makefile: line 8: GETSCANS: command not found
./Makefile: line 9: GETSCANS_OBJS: command not found
How do i get it working?
main.c:
Ok, apparently you have to type "make" into the command window aswell.

Automatically reference header files in different directories

I am attempting to run a tool known as crest on existing applications. My first target application is Apache. The output (as shown below) indicates that some header files are not being found. These are located in other directories in the source folder. One of these being \httpd-2.2.14\srclib\apr\include. I'd rather not change the source code of apache since I will want to run this command against numerous files in Apache and then apply the same technique to several other applications.
My question is:
1) How can I make it so whenever these referenced include files are being looked for, it locates the proper directory they are located in and will use that. I can define the directories. A friend mentioned something about altering the command line input, or building environment variables?
Other thoughts/suggestions would be appreciated.
Thanks all.
The command to run crest is:
../bin/crestc ../../httpd-2.2.14/server/request.c -dfs
I get the following output:
[root#localhost src]# ../bin/crestc ../../httpd-2.2.14/server/request.c -dfs
cp libcrest/libcrest.a ../lib
cp run_crest/run_crest ../bin
cp process_cfg/process_cfg ../bin
cp tools/print_execution ../bin
cp libcrest/crest.h ../include
cp libcrest/libcrest.a ../lib
cp run_crest/run_crest ../bin
cp process_cfg/process_cfg ../bin
cp tools/print_execution ../bin
cp libcrest/crest.h ../include
gcc -D_GNUCC -E -I../bin/../include -DCIL=1 ../../httpd-2.2.14/server/request.c -o ./request.i
../../httpd-2.2.14/server/request.c:28:25: error: apr_strings.h: No such file or directory
../../httpd-2.2.14/server/request.c:29:25: error: apr_file_io.h: No such file or directory
../../httpd-2.2.14/server/request.c:30:25: error: apr_fnmatch.h: No such file or directory
../../httpd-2.2.14/server/request.c:33:22: error: apr_want.h: No such file or directory
../../httpd-2.2.14/server/request.c:36:23: error: ap_config.h: No such file or directory
../../httpd-2.2.14/server/request.c:37:19: error: httpd.h: No such file or directory
../../httpd-2.2.14/server/request.c:38:25: error: http_config.h: No such file or directory
../../httpd-2.2.14/server/request.c:39:26: error: http_request.h: No such file or directory
../../httpd-2.2.14/server/request.c:40:23: error: http_core.h: No such file or directory
../../httpd-2.2.14/server/request.c:41:27: error: http_protocol.h: No such file or directory
../../httpd-2.2.14/server/request.c:42:22: error: http_log.h: No such file or directory
../../httpd-2.2.14/server/request.c:43:23: error: http_main.h: No such file or directory
../../httpd-2.2.14/server/request.c:44:25: error: util_filter.h: No such file or directory
../../httpd-2.2.14/server/request.c:45:26: error: util_charset.h: No such file or directory
../../httpd-2.2.14/server/request.c:46:25: error: util_script.h: No such file or directory
../../httpd-2.2.14/server/request.c:48:22: error: mod_core.h: No such file or directory
BRead 0 branches.
Read 0 nodes.
Wrote 0 branch edges.
[root#localhost src]#
You can set the C_INCLUDE_PATH environment variable (use a : to separate multiple paths):
export C_INCLUDE_PATH=/path/to/include/files:/path/to/more/include/files

Resources