Raylib Makefile Issue - makefile

I've install raylib according to this wiki page.
My Project Folder is look like this:
[this][1]
> ..\build>mingw32-make
g++ ../main.cpp -o test.exe -O2 -Wall -Wno-missing-braces -I ../include/ -L ../lib/ -lraylib -lopeng132 -lgdi32 -lwinmm
D:/Software/raylib/mingw/bin/../lib/gcc/i686-w64-mingw32/8.1.0/../../../../i686-w64-mingw32/bin/ld.exe: cannot find -lopeng132
collect2.exe: error: ld returned 1 exit status
mingw32-make: *** [Makefile:2: default] Error 1```
[1]: https://i.stack.imgur.com/QK2X3.png

It seems you have typed openg132 instead of opengl132. You have mistaken the letter l for the number 1

Related

fatal error: png.h: No such file or directory(MiddleBury Evaluation)

I am testing stereo algorithm in MiddleBury Stereo Evaluation
One of step was to compile the tools in code/as follows.
cd code/imageLib
make
cd ..
make
cd ..
In this case, there is error in first make as follows,
$ make
g++ -O3 -W -Wall -g -c -o ImageIOpng.o ImageIOpng.cpp
ImageIOpng.cpp:19:17: fatal error: png.h: No such file or directory
compilation terminated.
make: *** [<builtin>: ImageIOpng.o] Error 1
and, regarding second make,
$ make
g++ -g -O3 -W -Wall -IimageLib ii.cpp -LimageLib -lImg.i686-g -lpng -lz -o ii
/usr/lib/gcc/i686-pc-cygwin/5.4.0/../../../../i686-pc-cygwin/bin/ld: cannot find -lImg.i686-g
/usr/lib/gcc/i686-pc-cygwin/5.4.0/../../../../i686-pc-cygwin/bin/ld: cannot find -lpng
collect2: error: ld returned 1 exit status
make: *** [<builtin>: ii] Error 1
In previous step, make worked fine.
So, what was the problem? I downloaded sample algorithm and did not edit/change contents in any file.
png.h is part of libpng16-devel and the specific include
directory must be added to the include path of your project.
$ cygcheck -l libpng16-devel |grep png.h
/usr/include/libpng16/png.h

CMake failing to detect pthreads due to warnings

I get an error when making a project with CMake:
-- Could NOT find Threads (missing: Threads_FOUND)
The error log shows that CMake tripped up over something truly banal:
/usr/bin/cc -std=c11 -D_GNU_SOURCE -Wall -Wextra -Wpointer-arith -Wundef -Wvla -Wwrite-strings -Werror -Wno-error=extra -Wno-error=deprecated-declarations -Wno-error=sign-compare -Wno-error=strict-aliasing -Wno-error=type-limits -Wno-unused-parameter -Wno-error=unused-variable -Wno-error=undef -Wno-error=uninitialized -Wlogical-op -Wno-error=maybe-uninitialized -Waggregate-return -Wnested-externs -Wold-style-definition -Wstrict-prototypes -march=native -o CMakeFiles/cmTryCompileExec2533162744.dir/CheckIncludeFiles.c.o -c /mnt/shared/fooproj/build/release/CMakeFiles/CMakeTmp/CheckIncludeFiles.c
/mnt/shared/fooproj/build/release/CMakeFiles/CMakeTmp/CheckIncludeFiles.c:5:5:
error: function declaration isn’t a prototype [-Werror=strict-prototypes]
int main(){return 0;}
^
/mnt/shared/fooproj/build/release/CMakeFiles/CMakeTmp/CheckIncludeFiles.c:
In function ‘main’:
/mnt/shared/fooproj/build/release/CMakeFiles/CMakeTmp/CheckIncludeFiles.c:5:5:
error: old-style function definition [-Werror=old-style-definition]
cc1: all warnings being treated as errors
[...]
Source:
/* */
#include <pthread.h>
int main(){return 0;}
This really should be no reason for CMake to think Threads doesn't exist. How do I go about fixing this?
I believe this is CMake bug 15058 which I just reported.
The test that CMake is using to check the include file uses an old-style C function definition. If -Wold-style-definition -Werror is in effect, gcc will barf on this.
I included a patch in the bug report linked above, but for a quick fix, find the file Modules/CheckIncludeFiles.cmake in your CMake installation (possibly in /usr/share/cmake or similar), find the line
"${CMAKE_CONFIGURABLE_FILE_CONTENT}\n\nint main(){return 0;}\n")
and change int main() to int main(void).
Issue seems to be still there.
I try to compile the lates nominatim. seems i got the same error.
Determining if the pthread_create exist failed with the following output:
Change Dir: /home/mikelaptop/Desktop/nominatim/290102/Nominatim/build/CMakeFiles/CMakeTmp
Run Build Command:"/usr/bin/make" "cmTC_b87d8/fast"
/usr/bin/make -f CMakeFiles/cmTC_b87d8.dir/build.make CMakeFiles/cmTC_b87d8.dir/build
make[1]: Entering directory '/home/mikelaptop/Desktop/nominatim/290102/Nominatim/build/CMakeFiles/CMakeTmp'
Building C object CMakeFiles/cmTC_b87d8.dir/CheckSymbolExists.c.o
/usr/bin/cc -o CMakeFiles/cmTC_b87d8.dir/CheckSymbolExists.c.o -c /home/mikelaptop/Desktop/nominatim/290102/Nominatim/build/CMakeFiles/CMakeTmp/CheckSymbolExists.c
Linking C executable cmTC_b87d8
/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_b87d8.dir/link.txt --verbose=1
/usr/bin/cc -rdynamic CMakeFiles/cmTC_b87d8.dir/CheckSymbolExists.c.o -o cmTC_b87d8
CMakeFiles/cmTC_b87d8.dir/CheckSymbolExists.c.o: In function `main':
CheckSymbolExists.c:(.text+0x1b): undefined reference to `pthread_create'
collect2: error: ld returned 1 exit status
CMakeFiles/cmTC_b87d8.dir/build.make:97: recipe for target 'cmTC_b87d8' failed
make[1]: *** [cmTC_b87d8] Error 1
make[1]: Leaving directory '/home/mikelaptop/Desktop/nominatim/290102/Nominatim/build/CMakeFiles/CMakeTmp'
Makefile:126: recipe for target 'cmTC_b87d8/fast' failed
make: *** [cmTC_b87d8/fast] Error 2
File /home/mikelaptop/Desktop/nominatim/290102/Nominatim/build/CMakeFiles/CMakeTmp/CheckSymbolExists.c:
/* */
#include <pthread.h>
int main(int argc, char** argv)
{
(void)argv;
#ifndef pthread_create
return ((int*)(&pthread_create))[argc];
#else
(void)argc;
return 0;
#endif
}
Determining if the function pthread_create exists in the pthreads failed with the following output:
Change Dir: /home/mikelaptop/Desktop/nominatim/290102/Nominatim/build/CMakeFiles/CMakeTmp
Run Build Command:"/usr/bin/make" "cmTC_eb9e3/fast"
/usr/bin/make -f CMakeFiles/cmTC_eb9e3.dir/build.make CMakeFiles/cmTC_eb9e3.dir/build
make[1]: Entering directory '/home/mikelaptop/Desktop/nominatim/290102/Nominatim/build/CMakeFiles/CMakeTmp'
Building C object CMakeFiles/cmTC_eb9e3.dir/CheckFunctionExists.c.o
/usr/bin/cc -DCHECK_FUNCTION_EXISTS=pthread_create -o CMakeFiles/cmTC_eb9e3.dir/CheckFunctionExists.c.o -c /usr/share/cmake-3.9/Modules/CheckFunctionExists.c
Linking C executable cmTC_eb9e3
/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_eb9e3.dir/link.txt --verbose=1
/usr/bin/cc -DCHECK_FUNCTION_EXISTS=pthread_create -rdynamic CMakeFiles/cmTC_eb9e3.dir/CheckFunctionExists.c.o -o cmTC_eb9e3 -lpthreads
/usr/bin/ld: cannot find -lpthreads
collect2: error: ld returned 1 exit status
CMakeFiles/cmTC_eb9e3.dir/build.make:97: recipe for target 'cmTC_eb9e3' failed
make[1]: *** [cmTC_eb9e3] Error 1
make[1]: Leaving directory '/home/mikelaptop/Desktop/nominatim/290102/Nominatim/build/CMakeFiles/CMakeTmp'
Makefile:126: recipe for target 'cmTC_eb9e3/fast' failed
make: *** [cmTC_eb9e3/fast] Error 2
Edit: cmake -lpthread .. seems to fix this

'glib.h' file not found on Max OSX 10.9

I'm trying to compile msg2pdf which is a tool to convert messages in mu4e (mu for Emacs) to pdf.
I'm receiving the following error :
/Applications/Xcode.app/Contents/Developer/usr/bin/make all-recursive
Making all in .
CC msg2pdf.o
In file included from msg2pdf.c:20:
In file included from ../../lib/mu-msg.h:24:
../../lib/mu-flags.h:24:10: fatal error: 'glib.h' file not found
#include <glib.h>
^
1 error generated.
make[2]: *** [msg2pdf.o] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2
Oddly, I checked the Makefile and GLIB_CFLAGS seem to be pointing on the right folder (where brew installed it).
In fact, glib.h is located in /usr/local/Cellar/glib/2.40.0_1/include/glib-2.0.
GLIB_CFLAGS = -D_REENTRANT -I/usr/local/Cellar/glib/2.40.0_1/include/glib-2.0 -I/usr/local/Cellar/glib/2.40.0_1/lib/glib-2.0/include -I/usr/local/opt/gettext/include
GLIB_LIBS = -L/usr/local/Cellar/glib/2.40.0_1/lib -L/usr/local/opt/gettext/lib -lgio-2.0 -lgobject-2.0 -lglib-2.0 -lintl
How can I succeed compiling the file? Is there any command line "hack" I can use while calling
make?
Edit
Here are the files in the directory
https://github.com/flexdec/temp
Edit 2
This is the output when using make V=1
/Applications/Xcode.app/Contents/Developer/usr/bin/make all-recursive
Making all in .
gcc -DHAVE_CONFIG_H -I. -I../.. -I../../lib -DICONDIR='""' -Wall -Wextra -Wno-unused-parameter -Wdeclaration-after-statement -g -O2 -MT msg2pdf.o -MD -MP -MF .deps/msg2pdf.Tpo -c -o msg2pdf.o msg2pdf.c
In file included from msg2pdf.c:20:
In file included from ../../lib/mu-msg.h:24:
../../lib/mu-flags.h:24:10: fatal error: 'glib.h' file not found
#include <glib.h>
^
1 error generated.
make[2]: *** [msg2pdf.o] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2
Edit 3
The new error I get using make V=1 now that GLIB_CFLAGS issue is fixed
/Applications/Xcode.app/Contents/Developer/usr/bin/make all-recursive
Making all in .
gcc -DHAVE_CONFIG_H -I. -I../.. -I../../lib -D_REENTRANT -I/usr/local/Cellar/glib/2.40.0_1/include/glib-2.0 -I/usr/local/Cellar/glib/2.40.0_1/lib/glib-2.0/include -I/usr/local/opt/gettext/include -DICONDIR='""' -Wall -Wextra -Wno-unused-parameter -Wdeclaration-after-statement -g -O2 -MT msg2pdf.o -MD -MP -MF .deps/msg2pdf.Tpo -c -o msg2pdf.o msg2pdf.c
msg2pdf.c:24:10: fatal error: 'gtk/gtk.h' file not found
#include <gtk/gtk.h>
^
1 error generated.
make[2]: *** [msg2pdf.o] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2
make V=1 instead of make will tell you what the C compiler command looks like (instead of just "CC msg2pdf.o")—check that and make sure it includes the flags you need.
Based on a quick look at your Makefile.am, you are including $(GTK_CFLAGS) and $(WEBKIT_CFLAGS) in your AM_CPPFLAGS but not $(GLIB_CFLAGS).
You need to run ./configure in mu's top-level directory on the machine where you want to compile it. configure will tell you about any missing dependencies. Optional components (such as msg2pdf) are skipped if their dependencies are not there.
Then, after configure succeeds, do a 'make'.
In any case, if configure has run successfully, the top-level 'make' should succeed as well (that's why we have configure!), otherwise please file a bug.

Program does not link to library even adding content of "pkg-config --libs" to $CFLAGS or $LDFLAGS

I am trying to compile a program which depends upon GLib's libgthread. The library is installed in my machine (Ubuntu 12.04) and pkg-config finds it:
$ pkg-config --libs gthread-2.0
-pthread -lgthread-2.0 -lrt -lglib-2.0
I tried to run configure setting $CFLAGS with such output:
$ CFLAGS=`pkg-config --libs gthread-2.0` ./configure
but it did not work:
$ make
[...]
gcc -g -O2 -I/include -I/home/adam/fs//include -I/usr/include/libxml2 -pthread -lgthread-2.0 -lrt -lglib-2.0 -o ama [...] -lxml2
ama-ama.o: In function `main':
/home/adam/software/ama/src/ama.c:89: undefined reference to `g_thread_init'
collect2: ld returned 1 exit status
make[2]: ** [ama] Erro 1
make[2]: Saindo do diretório `/home/adam/software/ama/src'
make[1]: ** [all-recursive] Erro 1
make[1]: Saindo do diretório `/home/adam/software/ama'
make: ** [all] Erro 2
I tried to set $LDFLAGS, too:
$ LDFLAGS=`pkg-config --libs gthread-2.0` ./configure
and got the same error.
What should I do?
The correct variable to set is $LIBS:
$ LIBS=`pkg-config --libs gthread-2.0` ./configure

make library not found

I'm trying to compile a program using a third party library, Omnet++ in my case. Apparently "make" does not find a library, but the path it uses is correct as you can see (in the sense that I can see the library under omnet++ source tree)
pv135168:basic Bob$ opp_makemake
Creating Makefile in /Users/Bob/Code/network_sim/basic... Makefile created, running "make depend" to add dependencies... opp_makedep -Y --objdirtree -I. -f Makefile -P\$O/ -- ./*.cc
pv135168:basic Bob$ make
g++ -c -g -Wall
-fno-stack-protector -m32 -DHAVE_PCAP -DXMLPARSER=libxml
-DWITH_PARSIM -DWITH_NETBUILDER -I.
-I/Users/Bob/Code/omnetpp-4.1/include -o out/gcc-debug//txc1.o txc1.cc g++ -m32 -Wl,-rpath,/Users/Bob/Code/omnetpp-4.1/lib -Wl,-rpath,. -o out/gcc-debug//basic out/gcc-debug//txc1.o -Wl,-all_load
-L"/Users/Bob/Code/omnetpp-4.1/lib/gcc"
-L"/Users/Bob/Code/omnetpp-4.1/lib" -u _tkenv_lib -lopptkenvd
-loppenvird -lopplayoutd -u _cmdenv_lib -loppcmdenvd -loppenvird
-loppsimd -lstdc++
ld: library not found for -lopptkenvd
collect2: ld returned 1 exit status make: *** [out/gcc-debug//basic]
Error 1 pv135168:basic Bob$
It's looking in the following directories for a file called libopptkenvd.dylib or libopptkenvd.a:
/Users/Bob/Code/omnetpp-4.1/lib/gcc
/Users/Bob/Code/omnetpp-4.1/lib
Is that file in one of those directories (or in the standard directories like /usr/lib)? I don't see an indication of that in your output.

Resources