Gtk with Eclipse CDT - c

I installed pkg-config
and added pkg-config -cppflags and pkg-config --libs in build setting
please help
I am working on windows 8 and eclipse kepler
14:58:32 **** Incremental Build of configuration Debug for project Hi_c_gtk ****
make all
Building file: ../src/Hi_c_gtk.c
Invoking: Cross GCC Compiler
gcc -O0 -g3 -Wall -c -fmessage-length=0 pkg-config gtkmm-2.4 --cflags -MMD -MP -MF"src/Hi_c_gtk.d" -MT"src/Hi_c_gtk.d" -o "src/Hi_c_gtk.o" "../src/Hi_c_gtk.c"
cygwin warning:
MS-DOS style path detected: C:\Users\Project\workspace1\Hi_c_gtk\Debug
Preferred POSIX equivalent is: /cygdrive/c/Users/Project/workspace1/Hi_c_gtk/Debug
CYGWIN environment variable option "nodosfilewarning" turns off this warning.
Consult the user's guide for more details about POSIX paths:
http://cygwin.com/cygwin-ug-net/using.html#using-pathnames
gcc: error: pkg-config: No such file or directory
gcc: error: gtkmm-2.4: No such file or directory
gcc: error: unrecognized command line option ‘--cflags’
src/subdir.mk:18: recipe for target 'src/Hi_c_gtk.o' failed
make: *** [src/Hi_c_gtk.o] Error 1

I understand you're trying to integrate GTK with Eclipse on Windows.
I've recently managed to achieve so in both GNU/Linux and Windows environments. On GNU/Linux it was as easy as install pkg-config from the Eclipse marketplace and adding needed libraries.
On Windows tough, I had to configure include paths manually by modifying compiler options. You need to add manually all includes and libraries requested by GTK+ on Project-C/C++ Build-Settings. I used Cygwin's gcc.
The full process is described on http://irkedrants.blogspot.com.es/2011/02/configuring-eclipse-to-compile-gtk.html

Related

GCC as m68k cross-compiler

I am trying to recompile binutils and GCC as a cross-compiler for m68k architecture. I am following these instructions:
http://darkdust.net/writings/megadrive/crosscompiler
However, the process keeps failing on one part or another. I have tried with binutils 2.16.1 and gcc 3.4.6, binutils 2.15 and gcc 3.4.2 and binutils 2.15 and gcc 3.4.6.
This last attempt fails when running "make" on gcc, after making and installing binutils. It gives the following error:
gcc -g -O2 -DIN_GCC -DCROSS_COMPILE -W -Wall -Wwrite-strings -Wstrict-
prototypes -Wmissing-prototypes -pedantic -Wno-long-long -DHAVE_CONFIG_H
-I. -I. -I../../gcc-3.4.2/gcc -I../../gcc-3.4.2/gcc/. -I../../gcc-
3.4.2/gcc/../include \
-DTARGET_MACHINE=\"m68k-coff\" \
-c ../../gcc-3.4.2/gcc/collect2.c -o collect2.o
In file included from /usr/include/fcntl.h:289:0,
from ../../gcc-3.4.2/gcc/system.h:214,
from ../../gcc-3.4.2/gcc/collect2.c:30:
In function ‘open’,
inlined from ‘collect_execute’ at ../../gcc-3.4.2/gcc/collect2.c:1535:20:
/usr/include/x86_64-linux-gnu/bits/fcntl2.h:50:4: error: call to
‘__open_missing_mode’ declared with attribute error: open with O_CREAT or
O_TMPFILE in second argument needs 3 arguments
__open_missing_mode ();
^
Makefile:1364: recipe for target 'collect2.o' failed
make[1]: *** [collect2.o] Error 1
make[1]: Leaving directory '/home/gabriel/src/gcc-build/gcc'
Makefile:23339: recipe for target 'all-gcc' failed
make: *** [all-gcc] Error 2
I don't expect to fix this error, but does anyone know of a combination of binutils and gcc release that work? Should I be using a certain version of gcc to recompile gcc successfuly?
Thanks for any insight you may have on this!
EDIT:
My linux has GCC 5.4.0 so I just downloaded the 5.4.0 source to try and rebuild that for m68k cross-compiling. I now get the following error when running "make" on the gcc source:
*** Configuration m68k-unkown-coff not supported
What could be the cause of this? Is it because I need an older version of GCC? (the binutils version i'm using definately supports the m68k target). The tutorial I'm using always defines "--target=m68k-coff", should that instead be "--target=m68k-unkown-coff"?
EDIT 2:
So I tried compiling for m68k-elf but now I get this error:
checking for m68k-elf-gcc... /home/gabriel/src/gcc-build/./gcc/xgcc -B/home/gabriel/src/gcc-build/./gcc/ -B/opt/m68k/m68k-elf/bin/ -B/opt/m68k/m68k-elf/lib/ -isystem /opt/m68k/m68k-elf/include -isystem /opt/m68k/m68k-elf/sys-include
checking for suffix of object files... configure: error: in `/home/gabriel/src/gcc-build/m68k-elf/libgcc':
configure: error: cannot compute suffix of object files: cannot compile
I ran download_prerequisites before building so it should not be a problem with the MPC library. Any idea how to move on? I need assembler only so I don't mind what the format of the object files is. Thanks!
I used to do pretty much what you are doing right now.
My advice is to use crosstool-ng (http://crosstool-ng.github.io), as it does pretty much everything in an automated manner.
If you are studying m68k assembly, I used to host a modified version of gcc-explorer by Matt Godbolt (https://godbolt.org/). You can find a runnable docker image here (https://hub.docker.com/r/esantoro/acso-explorer/) and some more details here (https://znpy.wordpress.com/2017/05/08/decommisioning-acso-explorer-santoro-tk/)
Hope it helps,
znpy
you can build most versions with a current Linux. To install the prerequisites have a look at https://github.com/bebbo/amiga-gcc
unpack the gcc archive, e.g. to /opt/cross/gcc-6.5.0
create a separate build folder, e.g. /opt/cross/xcc-6.5.0 - never build inside gcc's source folder!
create the prefix folder, that's where binaries are installed to, e.g. /opt/cross/gcc65
ensure that these folders exist and are writable, then
configure from within that build folder using an absolute path for configure
cd /opt/cross/xcc-6.5.0/
/opt/cross/gcc-6.5.0/configure --target=m68k-elf --program-prefix=m68k-elf- --enable-languages=c,c++ --prefix=/opt/cross/gcc65 --disable-libssp --disable-nls --disable-multilib
make all-gcc
make install-gcc
I'm also running the compiler explorer for 68k gccs at https://franke.ms/cex/

Gaining sqlite3 functionality in C (Eclipse)

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 :-)

Eclipse IDE for C/C++, gcc can't find *.c document

I am working on a C project in Eclipse, the environment is windows X64,
When I tried to compile the program, it said:
11:54:29 **** Incremental Build of configuration Debug for project
TPCembarque **** Info: Internal Builder is used for build gcc
"-ID:\java workspace\TPCembarque\inc" "-ID:\java
workspace\TPCembarque\lib\" "-includeD:\java
workspace\TPCembarque\lib\libVirtualBoard.a" -O0 -g3 -Wall -c
-fmessage-length=0 -o "src\main.o" "..\src\main.c" gcc: error: workspace\TPCembarque\lib\libVirtualBoard.a -O0 -g3 -Wall -c
-fmessage-length=0 -o src\main.o ..\src\main.c : No such file or directory gcc: fatal error: no input files compilation terminated.
11:54:29 Build Finished (took 657ms)
so as a result it couldn't find main.c
All my data related to the project were saved in D:/systnum
and I created my project in D:/java workspace/TPCembarque.
I've already set the build environment as d:\systnum\MinGW\bin;d:\systnum\MSys\1.0\bin
I have already added the file main.c to the project 1
Could anybody tell me how to let the Compiler find main.c? thanks!
Is it possible to paste the makefile of your project?
I see a potential issue due to two different paths mentioned in your build log.
"src\main.o" -> src is a folder in current directory
"..\src\main.c" -> src is a folder in the directory one folder back.

compiling Vim 7.4 under AIX 6.1

I have a problem while compiling Vim 7.4 under AIX 6.1.
My options for the configure script are: "--prefix /opt/freeware/bin" and "--enable-pythoninterp".
There where no Errors while running the configure Script but when I try to run "make" I get the error message:
cd src && make first
cc -qlanglvl=extc89 -c -I. -Iproto -DHAVE_CONFIG_H -DFEAT_GUI_ATHENA -DFUNCPROTO=15 -g -o objects/regexp.o regexp.c "regexp_nfa.c"
line 4410.1: 1506-046 (S) Syntax error.
make: 1254-004 > The error code from the last command is
1.
Stop. make: 1254-004 The error code from the last command is 2.
Stop.
Does anyone know what to do?
I had compiled Vim 7.4 in my home directory so I know that there is a workaround but I can't find it anymore.
AIX's built in make (based on standard AT&T make) is not compatible with the Makefiles built by autoconf tools. Use GNU make (gmake) instead. You may already have it installed (check /opt/freeware/bin), install from the Linux Toolbox for AIX set (from IBM), or from one of the websites providing prebuilt GNU tools for AIX systems (perzl, bullfreeware, etc). Just provide an alias from make to gmake, or override the use of make in the Makefile itself.

Cross-compiling for ARM while linking to libssh - libssh.so: file not recognized

I want to know if it is possible to link my application to libssh while cross-compiling with Sourcery toolchain for ARM. My host system is Ubuntu x86_64
:~/c/ssh$ arm-none-linux-gnueabi-gcc ssh.c -o arm `pkg-config --cflags --libs libssh`
cc1: warning: include location "/usr/local/include" is unsafe for cross-compilation [-Wpoison-system-directories]
/home/user/CodeSourcery/Sourcery_CodeBench_Lite_for_ARM_GNU_Linux/bin/../lib/gcc/arm-none-linux-gnueabi/4.6.1/../../../../arm-none-linux-gnueabi/bin/ld: warning: library search path "/usr/local/lib" is unsafe for cross-compilation
/usr/local/lib/libssh.so: file not recognized: File format not recognized
collect2: ld returned 1 exit status
My application compile fine with gcc using this command:
gcc ssh.c -o ssh -lssh
Adding the same -lssh flag while cross-compiling result in the following error:
:~/c/ssh$ arm-none-linux-gnueabi-gcc ssh.c -o arm -lssh
ssh.c:2:49: fatal error: libssh/libssh.h: No such file or directory
compilation terminated.
Your first attempt is trying to link the libssh.o from your host environment instead of your target environment. This is because the command "pkg-config --cflags --libs libssh" returns the package configuration of libssh on your host machine.
You will need to obtain or compile up a copy of libssh specifically for the target environment (ARM).
If compiling it yourself (likely your only option, for me at least a quick google did not reveal any suitable pre-built package) then you should specify a separate installation directory, eg. in your home directory somewhere. This will result in separate include and lib dirs, containing the cross compiled libssh, which you can reference from your own compilation commands, eg:
arm-none-linux-gnueabi-gcc -I{includedir} -L{libdir} ssh.c -o arm -lssh
Note that libssh in turn relies on other libraries - openssl and zlib - which you also have to cross-compile.

Resources