OS: Windows 10, desktop pc
pkg-config --cflags gtk+-2.0
-mms-bitfields -Ik:/gtk/include/gtk-2.0 -Ik:/gtk/lib/gtk-2.0/include -Ik:/gtk/include/atk-1.0 -Ik:/gtk/include/cairo -Ik:/gtk/include/gdk-pixbuf-2.0 -Ik:/gtk/include/pango-1.0 -Ik:/gtk/include/glib-2.0 -Ik:/gtk/lib/glib-2.0/include -Ik:/gtk/include -Ik:/gtk/include/freetype2 -Ik:/gtk/include/libpng14
all ok
gcc pkg-config --cflags gtk+-2.0 test.cpp
gcc.exe error: pkg-config: No such file or directory
gcc.exe error: gtk+-2.0`: No such file or directory
gcc.exe error: unrecognized command line option '--cflags'
On other pc with Windows 10 i have not this problem.
What is the problem on this pc ?
Related
I'm trying to install a package through ifort on Mac since it requires ifort to compile and run the code and I am and getting error
ld: library not found for -lSystem
I don't know if oneAPI comes with that library.
ifort -O3 -warn all -fpp -free -assume byterecl -heap-arrays -nogen-interface -static-intel /opt/intel/oneapi/compiler/latest/mac/compiler/include generate_inpmat.F90 -o generate_inpmat
I corrected this error by pointing the correct library path.
The correct path is at
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/lib
In place of
/opt/intel/oneapi/compiler/latest/mac/compiler/include
I am running the command
gcc -o openmptest -fopenmp openmptest.c
however am getting the error:
clang: error: unsupported option '-fopenmp'
I am running this on Mac Mojave. In addition I am using VS code which is telling me
cannot open source file "omp.h"
for my include statement.
I think it could work if you install libomp by
brew install libomp
and then,
clang -Xpreprocessor -fopenmp -I/usr/local/include -L/usr/local/lib -lomp openmptest.c -o main
This should work, I was having the same issue and and managed to compile my code by using the above.
I'm trying to create a standalone of my C# app using mono's mkbundle, I got Xcode installed and the Mono Developer Kit too (I'm sure it's MDK not the runtime). Yet I run mkbundle using
mkbundle test.exe
and I get these errors
Compiling:
as -o temp.o temp.s
cc -g -o a.out -Wall temp.c `pkg-config --cflags --libs mono-2` temp.o
sh: pkg-config: command not found
temp.c:1:10: fatal error: 'mono/metadata/mono-config.h' file not found
1 error generated.
[Fail]
What's happening?
pkg-config is stored at '/Library/Frameworks/Mono.framework/Commands'.
Solution (see here and here):
Prepend the "/Library/Frameworks/Mono.framework/Commands" folder to
your PATH variable:
export PATH=/Library/Frameworks/Mono.framework/Commands:$PATH
This is needed in addition to the architecture solution proposed by aiapatag and the objective-c runtime and CoreFoundation framework solution:
export AS="as -arch i386"
export CC="cc -arch i386 -framework CoreFoundation -lobjc -liconv"
It looks like the pkg-config tool is not found. Maybe it's not in the default paths.
Do you have a 'pkgconfig' directory somewhere? It should be a subdirectory of your Mono installation.
Try to see if you have a path looking like /Library/Frameworks/Mono.framework/Versions/XXXX/lib/pkgconfig
If yes, point the PKG_CONFIG_PATH environment variable to this path, you can specify it directly when running your mkbundle command (this is just an example):
$ PKG_CONFIG_PATH=/Library/Frameworks/Mono.framework/Versions/XXXX/lib/pkgconfig mkbundle ....
I have installed the latest libxml2-2.8.0, as usual: $ ./configure, $ make, $ make install.
The $ xml2-config --cflags --libs gives this output:
-I/usr/local/include/libxml2
-L/usr/local/lib -lxml2 -lm
But trying to compile any example...
$ gcc `xml2-config --cflags --libs` xmltest.c
The linker says:
/tmp/cc8ezrPl.o: In function `processNode':
xmltest.c:(.text+0x19): undefined reference to `xmlTextReaderConstName'
xmltest.c:(.text+0x38): undefined reference to `xmlTextReaderConstValue'
...etc.
Anything I've googled can be solved by xml2-config --cflags --libs flags, or upgrading to the latest version of libxml2, or something. Unfortunately, neither works for me.
What can be the steps to identify the problem?
Using Ubuntu 12.04 64-bit.
The libraries should be specified only after the source file so that the linker can resolve the undefined references in the source file. Try compiling the example with this
gcc -I/usr/local/include/libxml2 -L/usr/local/lib xmltest.c -lxml2 -lm
Ok for now i managed to call managed code (mono) from native C code
referring to:
http://www.mono-project.com/Embedding_Mono
which works on my host system (x86) ubuntu.
Now i try to crosscompile it for my target (arm) debian system.
Crosscompiler is arm-none-linux-gnueabi-gcc 2010 from Codesourcery
when i go for:
arm-none-linux-gnueabi-gcc 'pkg-config --cflags glib-2.0 --libs mono' -o main.o main.c
i get
Sourcery_G++_Lite/bin/../lib/gcc/arm-none-linux-gnueabi/4.4.1/../../../../arm-none-linux-gnueabi/bin/ld: cannot find -lmono
so the libmono.so , libmono.a was found in /usr/lib and i go for:
arm-none-linux-gnueabi-gcc -L/usr/lib 'pkg-config --cflags glib-2.0 --libs mono' -o main.o main.c
which results in:
/Sourcery_G++_Lite/bin/../lib/gcc/arm-none-linux-gnueabi/4.4.1/../../../../arm-none-linux-gnueabi/bin/ld: skipping incompatible /usr/lib/libmono.so when searching for -lmono
/Sourcery_G++_Lite/bin/../lib/gcc/arm-none-linux-gnueabi/4.4.1/../../../../arm-none-linux-gnueabi/bin/ld: skipping incompatible /usr/lib/libmono.a when searching for -lmono
/Sourcery_G++_Lite/bin/../lib/gcc/arm-none-linux-gnueabi/4.4.1/../../../../arm-none-linux-gnueabi/bin/ld: cannot find -lmono
somebody has advice?
best regards
Gobliins
Build libmono for ARM first, instead of trying to use your x86 build.