I wanted to compile a task using SDL in C++ and I wanted to run the generated executable on another Linux that does not have this library installed, so how can I compile it in a way that I can include dependencies of SDL for running on another computer with Linux without the SDL installed?
122343
I have been trying to produce a statically linked "single binary" version of my game for windows. I want to link with sdl, sdl_image and sdl_mixer which in turn pull in a few support libraries. Unfortunately I haven't found a way to get them all to compile and link using cygwin/mingw/gcc. As far as I can tell all existing public versions are only shared libraries / dlls.  Please note that I'm not talking about licencing here. The source will be open thus the GPL/LGPLness of sdl is not relevant.
123209
I'm trying to write a basic program in C using gedit or sublime text (which I prefer), but no matter what I do when I try to compile or run, or even while writing, I have no option to use 'stdio.h' or any similar package. Even when I start typing #include &lt;st the only word completion sublime suggests is 'struct'.  I've read dozens of threads, but all managed to fix this by installing gcc, which I've tried to reinstall multiple times, with no luck.  This is the output from gcc -v:  Using built-in specs. COLLECT_GCC=gcc COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/7/lto-wrapper OFFLOAD_TARGET_NAMES=nvptx-none OFFLOAD_TARGET_DEFAULT=1 Target: x86_64-linux-gnu Configured with: ../src/configure -v --with-pkgversion='Ubuntu 7.2.0-8ubuntu3' --with-bugurl=file:///usr/share/doc/gcc-7/README.Bugs --enable-languages=c,ada,c++,go,brig,d,fortran,objc,obj-c++ --prefix=/usr --with-gcc-major-version-only --program-suffix=-7 --program-prefix=x86_64-linux-gnu- --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-libmpx --enable-plugin --enable-default-pie --with-system-zlib --with-target-system-zlib --enable-objc-gc=auto --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-offload-targets=nvptx-none --without-cuda-driver --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu Thread model: posix gcc version 7.2.0 (Ubuntu 7.2.0-8ubuntu3) `   This is the code:   #include &lt;stdio.h&gt;  int main(void) { printf("hello, world\n"); }   When I compile using gcc, I get nothing, no error at least. but when I try to run using just ./hello.c this is what I get.
44627
Is there some chance to know how a binary was built, under Linux? (and or other Unix)  Compiler, version, time, flags etc...  I looked at readelf and couldn't find much, but there might be other ways at analyzing the binary code/section etc...  Anything you know how to extract?
54033
I'm aware that shared objects under Linux use "so numbers", namely that different versions of a shared object are given different extensions, for example:   example.so.1 example.so.2   I understand the idea is to have two distinct files such that two versions of a library can exist on a system (as opposed to "DLL Hell" on Windows). I'd like to know how this works in practice? Often, I see that example.so is in fact a symbolic link to example.so.2 where .2 is the latest version. How then does an application depending on an older version of example.so identify it correctly? Are there any rules as to what numbers one must use? Or is this simply convention? Is it the case that, unlike in Windows where software binaries are transferred between systems, if a system has a newer version of a shared object it is linked to the older version automatically when compiling from source?  I suspect this is related to ldconfig but I'm not sure how.
4205
I have seen a few (old) posts on the 'net about hacking together some support for pre-compiled headers in CMake. They all seem a bit all-over the place and everyone has their own way of doing it. What is the best way of doing it currently?
28124
I'm interested in compiling a new kernel under Ubuntu 12.04 x86 64 bit.  I found  which is basically a mirror for  and there are a lot of steps (git, etc.) that appear useless to me.  With earlier releases/distros, I used to create a .config file and modify a Makefile if I needed to, then just run make and it's done.  Is there is a simple way to do this under Ubuntu?
39216
This is a  about Compile Dependencies and Package Management.    I have a question regarding compiling ports/software or installing RPMs on my *nix server.  When I try to do this I receive lots of messages about missing dependencies.  Can the Server Fault community please help?
90202
Is it possible to convert/recompile an already compiled x86 binary into an ARM binary?   I'm using a  with a command-line Ubuntu (Maverick) and want to run a  server but the x86 executable they supply cannot be run on the hardware as far as I can tell (most likely due to differing architecture).  Unfortunately I don't have access to the source to allow me to recompile it natively.  If not, is there any other way I can get the binary to run (emulation for example)?
22874
I've already finishing compiling the kernel from source,  but how to compile it with debug symbols,what additional steps to I need to take?
15417
Is there a need to install a C/C++ compiler in Ubuntu 14.04 LTS? Where to write the program? How to compile the same?
59417
I'm using code that I found on the .  The only problem is it uses external DLL calls that don't work in mono.  I was wondering if anyone knew of a way to accomplish the same thing as that code, but will run in both Windows using .net, and Linux using mono?  Edit:  Clarifying what I'm trying to do: I'm making a .  The program sits in the system tray and when the user presses the hot-key, it will pop up all the gadgets.  So the program doesn't have focus, so typically it won't catch any keystrokes, so I'm using the low-level keyboard hook and I hook the two keys that the user defines as the hot-keys.  But I'm using a Windows DLL call for that, which doesn't work in Linux using mono.  So I'm wondering if there's a way to do the same thing, but will run in Linux using mono?
69231
I need a specific command line tool and I have made a C program in my Linux shell. I have compiled the program with an ARM cross-compiler. I have then moved the program into the Android file system and tried to run it.  The output is permission denied.  What do I have to do, in order to run my own compiled programs in Android file system?
26941
I have the following makefile that I use to build a program (a kernel, actually) that I'm working on. Its from scratch and I'm learning about the process, so its not perfect, but I think its powerful enough at this point for my level of experience writing makefiles.  AS  =   nasm CC  =   gcc LD  =   ld  TARGET      =   core BUILD       =   build SOURCES     =   source INCLUDE     =   include ASM         =   assembly  VPATH = $(SOURCES)  CFLAGS  =   -Wall -O -fstrength-reduce -fomit-frame-pointer -finline-functions \             -nostdinc -fno-builtin -I $(INCLUDE) ASFLAGS =   -f elf  #CFILES     =   core.c consoleio.c system.c CFILES      =   $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.c))) SFILES      =   assembly/start.asm  SOBJS   =   $(SFILES:.asm=.o) COBJS   =   $(CFILES:.c=.o) OBJS    =   $(SOBJS) $(COBJS)  build : $(TARGET).img  $(TARGET).img : $(TARGET).elf     c:/python26/python.exe concat.py stage1 stage2 pad.bin core.elf floppy.img  $(TARGET).elf : $(OBJS)     $(LD) -T link.ld -o $@ $^  $(SOBJS) : $(SFILES)     $(AS) $(ASFLAGS) $&lt; -o $@  %.o: %.c     @echo Compiling $&lt;...     $(CC) $(CFLAGS) -c -o $@ $&lt;  #Clean Script - Should clear out all .o files everywhere and all that. clean:     -del *.img     -del *.o     -del assembly\*.o     -del core.elf   My main issue with this makefile is that when I modify a header file that one or more C files include, the C files aren't rebuilt. I can fix this quite easily by having all of my header files be dependencies for all of my C files, but that would effectively cause a complete rebuild of the project any time I changed/added a header file, which would not be very graceful.  What I want is for only the C files that include the header file I change to be rebuilt, and for the entire project to be linked again. I can do the linking by causing all header files to be dependencies of the target, but I cannot figure out how to make the C files be invalidated when their included header files are newer.  I've heard that GCC has some commands to make this possible (so the makefile can somehow figure out which files need to be rebuilt) but I can't for the life of me find an actual implementation example to look at. Can someone post a solution that will enable this behavior in a makefile?  EDIT: I should clarify, I'm familiar with the concept of putting the individual targets in and having each target.o require the header files. That requires me to be editing the makefile every time I include a header file somewhere, which is a bit of a pain. I'm looking for a solution that can derive the header file dependencies on its own, which I'm fairly certain I've seen in other projects.
118942
Assume I perform ldd /bin/ls with the pthread library removed. I obtain  linux-vdso.so.1 (0x00007ffcc3563000)  libselinux.so.1 =&gt; /lib64/libselinux.so.1 (0x00007f87e5459000) libcap.so.2 =&gt; /lib64/libcap.so.2 (0x00007f87e5254000) libc.so.6 =&gt; /lib64/libc.so.6 (0x00007f87e4e92000) libpcre.so.1 =&gt; /lib64/libpcre.so.1 (0x00007f87e4c22000) libdl.so.2 =&gt; /lib64/libdl.so.2 (0x00007f87e4a1e000) /lib64/ld-linux-x86-64.so.2 (0x00005574bf12e000) libattr.so.1 =&gt; /lib64/libattr.so.1 (0x00007f87e4817000) libpthread.so.0 =&gt; not found   The return code is zero. Is there a command returning an error in this case? Something similar to   #!/bin/bash if [[ ! -z $(ldd ${target} | grep 'not found') ]]; then    exit 1 fi
91909
With VS2005, I want to create a DLL and automatically export all symbols without adding __declspec(dllexport) everywhere and without hand-creating .def files. Is threre a way to do this?
63290
How can I compile/run C or C++ in Unix console or a Mac terminal?  (I know it, forget it, and relearn it again. Time to write it down.)
32481
We have a new application that requires glibc 2.4 (from gcc 4.1). The machine we have runs on has gcc 3.4.6.   We can not upgrade, and the application must be run on this machine.    We installed gcc 4.1, however, when it comes to compile time it is using all the includes, etc, from 3.4.6.    How do we get around this?  Any suggestions on using 4.1 for just this application?