I am using Ubuntu 18.04.4, and Eclipse 2019-12 (4.14.0) and I try to create a little C application with the help of Glade for the user interface.
Adding the following header files in C results in "unresolved inclusion" error:
#include <gtk/gtk.h>
#include <gtk/gtkx.h>
I have searched and tried in many ways to fix this, but unfortunately I didn't manage (I am new to linux/eclipse). The most easy solution seems to be a package called "Pkg-config" that knows itself how to add the gtk package, but unfortunately, this version of Eclipse does not support it.
The compiler sends the following error:
10:22:19 **** Incremental Build of configuration Debug for project MyTestProject ****
make all
Building file: ../src/MyTestProject.c
Invoking: GCC C Compiler
gcc -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"src/MyTestProject.d" -MT"src/MyTestProject.o" -o "src/MyTestProject.o" "../src/MyTestProject.c"
../src/MyTestProject.c:17:10: fatal error: gtk/gtk.h: No such file or directory
#include <gtk/gtk.h>
^~~~~~~~~~~
compilation terminated.
src/subdir.mk:18: recipe for target 'src/MyTestProject.o' failed
make: *** [src/MyTestProject.o] Error 1
"make all" terminated with exit code 2. Build might be incomplete.
10:22:19 Build Failed. 3 errors, 0 warnings. (took 466ms)
Any ideas how I can solve this? I mention that libgtk-3-dev is installed on my system and it appears inside the "includes" folder.
Related
I have been trying to test a program using cygwin64 (on Windows 10 and Eclipse 20-21) because my target is a Linux Realtime system, I have installed cygwin64 and as per this document (https://www.eclipse.org/4diac/documentation/html/installation/cygwin.html) . I have to add environment in windows
still my inclusion #include<stdio.h>, #include <stdlib.h> etc says unresolved
I checked if Cygwin is installed by going to cmd and giving bash. which returned correctly
My path variables are like this
My toolchain settings are like this
This is my build report
15:52:34 **** Incremental Build of configuration Debug for project udpexx1 ****
Info: Internal Builder is used for build
gcc "-IC:\\cygwin64" -O0 -g3 -Wall -c -fmessage-length=0 -o "src\\udpexx1.o" "..\\src\\udpexx1.c"
Cannot run program "gcc": Launching failed
Error: Program "gcc" not found in PATH
PATH=[C:\cygwin64\bin]
15:52:34 Build Finished. 0 errors, 0 warnings. (took 94ms)
#####################################################################
Is there anything that im missing or need to do?
my run configurations are like this
I'm new to linux, and am trying to compile and install some libraries.
Unfortunately, things are quite difficult as I am unable to obtain sudo access to my machine, and had to install the libraries in non-standard locations.
I'm having trouble getting the compiler to find the libraries I installed.
One of the libraries (https://github.com/tpm2-software/tpm2-tss/blob/master/INSTALL.md) I'm trying to install has dependencies on the other libraries, and I am getting the following error code when trying to compile, and am unable to fix it.
src/tss2-esys/esys_crypto_ossl.c:11:10: fatal error: openssl/evp.h: No such file or directory
#include <openssl/evp.h>
compilation terminated.
make[1]: *** [Makefile:14063: src/tss2-fapi/api/libtss2_fapi_la-Fapi_AuthorizePolicy.lo] Error 1
In file included from ./src/tss2-fapi/fapi_int.h:11, from src/tss2-fapi/api/Fapi_ChangeAuth.c:18:
./src/tss2-fapi/ifapi_policy_instantiate.h:13:10: fatal error: json-c/json.h: No such file or directory
#include <json-c/json.h>
compilation terminated.
So far, I've been trying to compile it in bash using the following commands:
./bootstrap
export PKG_CONFIG_PATH=/home/me/test/lib/pkgconfig:$PKG_CONFIG_PATH
export LDFLAGS='-L../missing_libs -lssl -L../missing_libs -lz -L../missing_libs/json-c/.libs -ljson-c -L../missing_libs/curl-7.68.0/lib/.libs -lcurl -L../openssl-1.0.2 -lcrypto'
export CFLAGS='-I../missing_libs/curl-7.68.0/include/lib:../missing_libs/json-c:../missing_libs/openssl-1.0.2'
./configure --prefix=/home/me/test --with-udevrulesdir=/lib/udev --disable-doxygen-doc
make -j$(nproc)
The LDFLAGS are the folders that contain my .so and .a files, while the CFLAGS are the folders that contain my h files.
Can I check if anyone knows what I am not linking properly?
Thanks!
I found the problem. Apparently I was linking to the wrong place.
Since library was searching for , I should not link to the directory where json.h is, but the directory where json-c/json.h is.
So for my CFLAGS should be "-I../missing_libs" instead of "-I../missing_libs/json-c"
Thanks for the help Jonathan!
I am using Kepller eclipse and I have C++ and C projects on that. I have no problem in compiling and running C++ projects, but when I create a C project, I see this error.
gcc: error: CreateProcess: No such file or directory
the whole message is:
23:46:32 **** Rebuild of configuration Debug for project HelloWorld ****
Info: Internal Builder is used for build
gcc "-IC:\\MinGW\\include" -O0 -g3 -Wall -c -fmessage-length=0 -o "src\\HelloWorld.o" "..\\src\\HelloWorld.c"
gcc: error: CreateProcess: No such file or directory
23:46:32 Build Finished (took 416ms)
I have set the path variable as C:\MinGW\bin
is there anybody who can help me.
I would like to be able to use the sqlite3 functionality with C, I recently downloaded the sqlite3 amalgamation from the SQLite website and compiled this to get sqlite3.so and hence included this in my project. I have included what I believe to be the necessary libraries to compile the code however I always get the same error. The linker appears to be looking in the wrong folder for -lsqlite3 and I cant find this specified path anywhere in any of the project properties and it also does not appear to be a valid location on my PC!
Below is the output when I try to compile the code. If I am stupidly missing anything required for any help please let me know, bit of a beginner when using eclipse for C.
16:21:03 **** Build of configuration Debug for project SQLite ****
make all
Building file: ../main.c
Invoking: Cross GCC Compiler
arm-linux-gnueabihf-gcc -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"main.d" -MT"main.d" -o "main.o" "../main.c"
Finished building: ../main.c
Building target: SQLite
Invoking: Cross GCC Linker
arm-linux-gnueabihf-gcc -L/root/workspacecpp/SQLite/ -o "SQLite" ./main.o -lsqlite3.so
/home/development/raspberrypi/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin/../lib/gcc/arm-linux-gnueabihf/4.8.3/../../../../arm-linux-gnueabihf/bin/ld: cannot find -lsqlite3.so
collect2: error: ld returned 1 exit status
make: *** [SQLite] Error 1
You are cross-compiling, so you need to place the ARM[*] version of libsqlite3.so in a place where the cross compiler will look for it. This is likely somewhere in or below /home/development/raspberrypi/tools/arm-bcm2708/. See your cross-compiler's documentation.
[*] Of course you used your cross-compiler to create an ARM version of libsqlite3.so :-)
I'm trying to build binutils 2.21 source code with debugging on. My main aim is to debug objdump actually. But in order to build it I think I have to build whole package.
Unfortunately there is no debugging option on the configure file. I tried adding -g and -ggdb to CFLAGS before I configure it. However the error was:
Configuring in ./intl
configure: loading cache ./config.cache
configure: error: `CFLAGS' has changed since the previous run:
configure: former value: `-g -O2 -D__USE_MINGW_ACCESS'
configure: current value: `-g -D__USE_MINGW_ACCESS'
configure: error: in `/c/binutils-2.21/intl':
configure: error: changes in the environment can compromise the build
configure: error: run `make distclean' and/or `rm ./config.cache' and start over
make[1]: *** [configure-intl] Error 1
make[1]: Leaving directory `/c/binutils-2.21'
make: *** [all] Error 2
I tried "make clean" and "make distclean" but I'm receiving the same error. Actually according to former CFLAGS it had -g option on before but when I try to open objdump.exe in gdb it says
Reading symbols from c:\binutils-2.21\binutils/objdump.exe...
(no debugging symbols found)...done.
Thank you in advance.
Yes I've tried a lot. As I said -g tag was on to gcc. However makefile saves all debugging enabled binaries to binutils.libs\ directory. So when I run binutils.libs\objdump.exe under gdb it was fine. Thanks for your answer though.