Skipping incompatible when searching for... - SDL2 - c

I wanted to try out SDL2 but I can't seem to succeed in the installation.
Here's what I get:
cmd.exe /C "cd . && C:\PROGRA~1\JETBRA~1\CLION2~1.3\bin\mingw\bin\gcc.exe -g CMakeFiles/SDL.dir/main.c.obj -o SDL.exe -Wl,--out-implib,libSDL.dll.a -Wl,--major-image-version,0,--minor-image-version,0 -LC:/libs/SDL/lib/x86 -lSDL2main -lSDL2 -lkernel32 -luser32 -lgdi32 -lwinspool -lshell32 -lole32 -loleaut32 -luuid -lcomdlg32 -ladvapi32 && cd ."
C:\Program Files\JetBrains\CLion 2022.2.3\bin\mingw\bin/ld.exe: skipping incompatible C:/libs/SDL/lib/x86/SDL2main.lib when searching for -lSDL2main
C:\Program Files\JetBrains\CLion 2022.2.3\bin\mingw\bin/ld.exe: skipping incompatible /mingw/lib/../lib/libSDL2main.a when searching for -lSDL2main
C:\Program Files\JetBrains\CLion 2022.2.3\bin\mingw\bin/ld.exe: skipping incompatible /mingw/lib/../lib\libSDL2main.a when searching for -lSDL2main
C:\Program Files\JetBrains\CLion 2022.2.3\bin\mingw\bin/ld.exe: skipping incompatible /mingw/lib/libSDL2main.a when searching for -lSDL2main
C:\Program Files\JetBrains\CLion 2022.2.3\bin\mingw\bin/ld.exe: skipping incompatible /mingw/lib\libSDL2main.a when searching for -lSDL2main
C:\Program Files\JetBrains\CLion 2022.2.3\bin\mingw\bin/ld.exe: skipping incompatible C:/libs/SDL/lib/x86/SDL2main.lib when searching for -lSDL2main
C:\Program Files\JetBrains\CLion 2022.2.3\bin\mingw\bin/ld.exe: skipping incompatible C:/libs/SDL/lib/x86\SDL2main.lib when searching for -lSDL2main
C:\Program Files\JetBrains\CLion 2022.2.3\bin\mingw\bin/ld.exe: skipping incompatible /mingw/lib/../lib/libSDL2main.a when searching for -lSDL2main
C:\Program Files\JetBrains\CLion 2022.2.3\bin\mingw\bin/ld.exe: skipping incompatible /mingw/lib/libSDL2main.a when searching for -lSDL2main
C:\Program Files\JetBrains\CLion 2022.2.3\bin\mingw\bin/ld.exe: cannot find -lSDL2main
C:\Program Files\JetBrains\CLion 2022.2.3\bin\mingw\bin/ld.exe: skipping incompatible C:/libs/SDL/lib/x86/SDL2main.lib when searching for -lSDL2main
C:\Program Files\JetBrains\CLion 2022.2.3\bin\mingw\bin/ld.exe: skipping incompatible /mingw/lib/../lib/libSDL2main.a when searching for -lSDL2main
C:\Program Files\JetBrains\CLion 2022.2.3\bin\mingw\bin/ld.exe: skipping incompatible /mingw/lib/libSDL2main.a when searching for -lSDL2main
C:\Program Files\JetBrains\CLion 2022.2.3\bin\mingw\bin/ld.exe: skipping incompatible C:/libs/SDL/lib/x86/SDL2.lib when searching for -lSDL2
C:\Program Files\JetBrains\CLion 2022.2.3\bin\mingw\bin/ld.exe: skipping incompatible C:/libs/SDL/lib/x86/SDL2.dll when searching for -lSDL2
C:\Program Files\JetBrains\CLion 2022.2.3\bin\mingw\bin/ld.exe: skipping incompatible /mingw/lib/../lib/libSDL2.dll.a when searching for -lSDL2
C:\Program Files\JetBrains\CLion 2022.2.3\bin\mingw\bin/ld.exe: skipping incompatible /mingw/lib/../lib/libSDL2.a when searching for -lSDL2
C:\Program Files\JetBrains\CLion 2022.2.3\bin\mingw\bin/ld.exe: skipping incompatible /mingw/lib/../lib\libSDL2.a when searching for -lSDL2
C:\Program Files\JetBrains\CLion 2022.2.3\bin\mingw\bin/ld.exe: skipping incompatible /mingw/lib/libSDL2.dll.a when searching for -lSDL2
C:\Program Files\JetBrains\CLion 2022.2.3\bin\mingw\bin/ld.exe: skipping incompatible /mingw/lib/libSDL2.a when searching for -lSDL2
C:\Program Files\JetBrains\CLion 2022.2.3\bin\mingw\bin/ld.exe: skipping incompatible /mingw/lib\libSDL2.a when searching for -lSDL2
C:\Program Files\JetBrains\CLion 2022.2.3\bin\mingw\bin/ld.exe: skipping incompatible C:/libs/SDL/lib/x86/SDL2.lib when searching for -lSDL2
C:\Program Files\JetBrains\CLion 2022.2.3\bin\mingw\bin/ld.exe: skipping incompatible C:/libs/SDL/lib/x86/SDL2.dll when searching for -lSDL2
C:\Program Files\JetBrains\CLion 2022.2.3\bin\mingw\bin/ld.exe: skipping incompatible C:/libs/SDL/lib/x86\SDL2.lib when searching for -lSDL2
C:\Program Files\JetBrains\CLion 2022.2.3\bin\mingw\bin/ld.exe: skipping incompatible /mingw/lib/../lib/libSDL2.dll.a when searching for -lSDL2
C:\Program Files\JetBrains\CLion 2022.2.3\bin\mingw\bin/ld.exe: skipping incompatible /mingw/lib/../lib/libSDL2.a when searching for -lSDL2
C:\Program Files\JetBrains\CLion 2022.2.3\bin\mingw\bin/ld.exe: skipping incompatible /mingw/lib/libSDL2.dll.a when searching for -lSDL2
C:\Program Files\JetBrains\CLion 2022.2.3\bin\mingw\bin/ld.exe: skipping incompatible /mingw/lib/libSDL2.a when searching for -lSDL2
C:\Program Files\JetBrains\CLion 2022.2.3\bin\mingw\bin/ld.exe: cannot find -lSDL2
C:\Program Files\JetBrains\CLion 2022.2.3\bin\mingw\bin/ld.exe: skipping incompatible C:/libs/SDL/lib/x86/SDL2.lib when searching for -lSDL2
C:\Program Files\JetBrains\CLion 2022.2.3\bin\mingw\bin/ld.exe: skipping incompatible C:/libs/SDL/lib/x86/SDL2.dll when searching for -lSDL2
C:\Program Files\JetBrains\CLion 2022.2.3\bin\mingw\bin/ld.exe: skipping incompatible /mingw/lib/../lib/libSDL2.dll.a when searching for -lSDL2
C:\Program Files\JetBrains\CLion 2022.2.3\bin\mingw\bin/ld.exe: skipping incompatible /mingw/lib/../lib/libSDL2.a when searching for -lSDL2
C:\Program Files\JetBrains\CLion 2022.2.3\bin\mingw\bin/ld.exe: skipping incompatible /mingw/lib/libSDL2.dll.a when searching for -lSDL2
C:\Program Files\JetBrains\CLion 2022.2.3\bin\mingw\bin/ld.exe: skipping incompatible /mingw/lib/libSDL2.a when searching for -lSDL2
collect2.exe: error: ld returned 1 exit status
ninja: build stopped: subcommand failed.
Can someone help?
Here's my CMakeList file:
cmake_minimum_required(VERSION 3.23)
project(SDL C)
set(CMAKE_C_STANDARD 99)
set(SDL2_INCLUDE_DIR C:/libs/SDL/include)
set(SDL2_LIB_DIR C:/libs/SDL/lib/x86)
include_directories(${SDL2_INCLUDE_DIR})
link_directories(${SDL2_LIB_DIR})
add_executable(SDL main.c)
target_link_libraries(${PROJECT_NAME} SDL2main SDL2)

Related

I am trying to host my react website on netlify but this npm install error comes

If I run the npm run build command locally and drag and drop the build folder in netlify, then it is hosted but it gives this big error.
When I try continuous deployment from my github repository.
This is the error showed in the beginning
11:51:47 PM: npm WARN deprecated core-js#2.6.12: core-js#<3.3 is no longer maintained and not recommended for usage due to the number of issues. Because of the V8 engine whims, feature detection in old core-js versions could cause a slowdown up to 100x even if nothing is polyfilled. Please, upgrade your dependencies to the actual version of core-js.
11:54:08 PM: npm ERR! code 1
11:54:08 PM: npm ERR! path /opt/build/repo/node_modules/node-sass
11:54:08 PM: npm ERR! command failed
11:54:08 PM: npm ERR! command sh -c node scripts/build.js
11:54:08 PM: npm ERR! Building: /opt/buildhome/.nvm/versions/node/v16.8.0/bin/node /opt/build/repo/node_modules/node-gyp/bin/node-gyp.js rebuild --verbose --libsass_ext= --libsass_cflags= --libsass_ldflags= --libsass_library=
11:54:08 PM: npm ERR! make: Entering directory '/opt/build/repo/node_modules/node-sass/build'
11:54:08 PM: npm ERR! g++ '-DNODE_GYP_MODULE_NAME=libsass' '-DUSING_UV_SHARED=1' '-DUSING_V8_SHARED=1' '-DV8_DEPRECATION_WARNINGS=1' '-DV8_DEPRECATION_WARNINGS' '-DV8_IMMINENT_DEPRECATION_WARNINGS' '-D_GLIBCXX_USE_CXX11_ABI=1' '-D_LARGEFILE_SOURCE' '-D_FILE_OFFSET_BITS=64' '-D__STDC_FORMAT_MACROS' '-DOPENSSL_NO_PINSHARED' '-DOPENSSL_THREADS' '-DLIBSASS_VERSION="3.5.5"' -I/opt/buildhome/.node-gyp/16.8.0/include/node -I/opt/buildhome/.node-gyp/16.8.0/src -I/opt/buildhome/.node-gyp/16.8.0/deps/openssl/config -I/opt/buildhome/.node-gyp/16.8.0/deps/openssl/openssl/include -I/opt/buildhome/.node-gyp/16.8.0/deps/uv/include -I/opt/buildhome/.node-gyp/16.8.0/deps/zlib -I/opt/buildhome/.node-gyp/16.8.0/deps/v8/include -I../src/libsass/include -fPIC -pthread -Wall -Wextra -Wno-unused-parameter -m64 -O3 -fno-omit-frame-pointer -std=gnu++14 -std=c++0x -fexceptions -frtti -MMD -MF ./Release/.deps/Release/obj.target/libsass/src/libsass/src/ast.o.d.raw -c -o Release/obj.target/libsass/src/libsass/src/ast.o ../src/libsass/src/ast.cpp
11:54:08 PM: npm ERR! g++ '-DNODE_GYP_MODULE_NAME=libsass' '-DUSING_UV_SHARED=1' '-DUSING_V8_SHARED=1' '-DV8_DEPRECATION_WARNINGS=1' '-DV8_DEPRECATION_WARNINGS' '-DV8_IMMINENT_DEPRECATION_WARNINGS' '-D_GLIBCXX_USE_CXX11_ABI=1' '-D_LARGEFILE_SOURCE' '-D_FILE_OFFSET_BITS=64' '-D__STDC_FORMAT_MACROS' '-DOPENSSL_NO_PINSHARED' '-DOPENSSL_THREADS' '-DLIBSASS_VERSION="3.5.5"' -I/opt/buildhome/.node-gyp/16.8.0/include/node -I/opt/buildhome/.node-gyp/16.8.0/src -I/opt/buildhome/.node-gyp/16.8.0/deps/openssl/config -I/opt/buildhome/.node-gyp/16.8.0/deps/openssl/openssl/include -I/opt/buildhome/.node-gyp/16.8.0/deps/uv/include -I/opt/buildhome/.node-gyp/16.8.0/deps/zlib -I/opt/buildhome/.node-gyp/16.8.0/deps/v8/include -I../src/libsass/include -fPIC -pthread -Wall -Wextra -Wno-unused-parameter -m64 -O3 -fno-omit-frame-pointer -std=gnu++14 -std=c++0x -fexceptions -frtti -MMD -MF ./Release/.deps/Release/obj.target/libsass/src/libsass/src/ast_fwd_decl.o.d.raw -c -o Release/obj.target/libsass/src/libsass/src/ast_fwd_decl.o ../src/libsass/src/ast_fwd_decl.cpp
11:54:08 PM: npm ERR! g++ '-DNODE_GYP_MODULE_NAME=libsass' '-DUSING_UV_SHARED=1' '-DUSING_V8_SHARED=1' '-DV8_DEPRECATION_WARNINGS=1' '-DV8_DEPRECATION_WARNINGS' '-DV8_IMMINENT_DEPRECATION_WARNINGS' '-D_GLIBCXX_USE_CXX11_ABI=1' '-D_LARGEFILE_SOURCE' '-D_FILE_OFFSET_BITS=64' '-D__STDC_FORMAT_MACROS' '-DOPENSSL_NO_PINSHARED' '-DOPENSSL_THREADS' '-DLIBSASS_VERSION="3.5.5"' -I/opt/buildhome/.node-gyp/16.8.0/include/node -I/opt/buildhome/.node-gyp/16.8.0/src -I/opt/buildhome/.node-gyp/16.8.0/deps/openssl/config -I/opt/buildhome/.node-gyp/16.8.0/deps/openssl/openssl/include -I/opt/buildhome/.node-gyp/16.8.0/deps/uv/include -I/opt/buildhome/.node-gyp/16.8.0/deps/zlib -I/opt/buildhome/.node-gyp/16.8.0/deps/v8/include -I../src/libsass/include -fPIC -pthread -Wall -Wextra -Wno-unused-parameter -m64 -O3 -fno-omit-frame-pointer -std=gnu++14 -std=c++0x -fexceptions -frtti -MMD -MF ./Release/.deps/Release/obj.target/libsass/src/libsass/src/backtrace.o.d.raw -c -o Release/obj.target/libsass/src/libsass/src/backtrace.o ../src/libsass/src/backtrace.cpp
it ends here
11:54:08 PM: npm ERR! gyp ERR! node -v v16.8.0
11:54:08 PM: npm ERR! gyp ERR! node-gyp -v v3.8.0
11:54:08 PM: npm ERR! gyp ERR! not ok
11:54:08 PM: npm ERR! Build failed with error code: 1
11:54:08 PM: npm ERR! A complete log of this run can be found in:
11:54:08 PM: npm ERR! /opt/buildhome/.npm/_logs/2021-08-27T18_24_08_951Z-debug.log
11:54:09 PM: Error during NPM install
11:54:09 PM: Build was terminated: Build script returned non-zero exit code: 1
11:54:09 PM: Failing build: Failed to build site
11:54:09 PM: Finished processing build request in 3m28.53038114s
I've encountered the same problem today. I realised Netlify is now using node 16.x by default, which is incompatible with node-sass and other dependencies.
You can force a node version on your Netlify environment by going to "Deploy Settings" > "Environment" > "Edit variables" and by adding NODE_VERSION = [version number] (for example 14 to run node latest 14.x).
See https://docs.netlify.com/configure-builds/manage-dependencies/.

how will i create the react app but this error keeps coming

Error: EEXIST: file already exists, mkdir 'C:\Users\Souvik'
TypeError: Cannot read property 'loaded' of undefined
at exit (C:\Program Files\nodejs\node_modules\npm\lib\utils\error-handler.js:97:27)
at errorHandler (C:\Program Files\nodejs\node_modules\npm\lib\utils\error-handler.js:216:3)
at C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js:78:20
at cb (C:\Program Files\nodejs\node_modules\npm\lib\npm.js:225:22)
at C:\Program Files\nodejs\node_modules\npm\lib\npm.js:263:24
at C:\Program Files\nodejs\node_modules\npm\lib\config\core.js:81:7
at Array.forEach ()
at C:\Program Files\nodejs\node_modules\npm\lib\config\core.js:80:13
at f (C:\Program Files\nodejs\node_modules\npm\node_modules\once\once.js:25:25)
at afterExtras (C:\Program Files\nodejs\node_modules\npm\lib\config\core.js:171:20)
C:\Program Files\nodejs\node_modules\npm\lib\utils\error-handler.js:97
var doExit = npm.config.loaded ? npm.config.get('_exit') : true
^
TypeError: Cannot read property 'loaded' of undefined
at exit (C:\Program Files\nodejs\node_modules\npm\lib\utils\error-handler.js:97:27)
at process.errorHandler (C:\Program Files\nodejs\node_modules\npm\lib\utils\error-handler.js:216:3)
at process.emit (events.js:210:5)
at process._fatalException (internal/process/execution.js:150:25)
Install for [ 'create-react-app#latest' ] failed with code 7
Step 1: npm i -g create-react-app
Step 2: If it is already installed, update it
Step 3: create-react-app
Try the above.
Try to write this in your terminal (please only write this in your application folder!): rm -rf node_modules && npm install

create-react-app failing with error

I'm trying to create a new react project with create-react-app but it's failing with the below error
Installing packages. This might take a couple of minutes.
Installing react, react-dom, and react-scripts...
yarn add v1.3.2
info No lockfile found.
[1/4] Resolving packages...
error Couldn't find any versions for "require-from-string" that matches "^1.1.0"
info Visit https://yarnpkg.com/en/docs/cli/add for documentation about this command.
Error: Received malformed response from registry for "timed-out". The registry may be down.
at MessageError (C:\Program Files (x86)\Yarn\lib\cli.js:139:5)
at C:\Program Files (x86)\Yarn\lib\cli.js:48907:15
at next (native)
at step (C:\Program Files (x86)\Yarn\lib\cli.js:92:30)
at C:\Program Files (x86)\Yarn\lib\cli.js:110:14
at new Promise (C:\Program Files (x86)\Yarn\lib\cli.js:93093:7)
at C:\Program Files (x86)\Yarn\lib\cli.js:89:12
at Function.findVersionInRegistryResponse (C:\Program Files (x86)\Yarn\lib\cli.js:48946:7)
at C:\Program Files (x86)\Yarn\lib\cli.js:48963:28
at next (native)
Aborting installation.
This is a temporary failure in npm registry (source)

unable to run npm start for react-native project

This is my first attempt at running react-native project. Followed all the instructions mentioned at react-native side. and ran 'npm start'
Getting below error in command prompt :
ERROR watchman--no-pretty get-sockname returned with exit code null dyld: Library not loaded: /usr/local/lib/libpcre.1.dylib
Referenced from: /usr/local/bin/watchman
Reason: image not found
Error: watchman--no-pretty get-sockname returned with exit code null dyld: Library not loaded: /usr/local/lib/libpcre.1.dylib
Referenced from: /usr/local/bin/watchman
Reason: image not found
at ChildProcess.<anonymous> (/Users/z013mrq/AwesomeProject/node_modules/react-native/node_modules/sane/node_modules/fb-watchman/index.js:198:18)
at emitTwo (events.js:87:13)
at ChildProcess.emit (events.js:172:7)
at maybeClose (internal/child_process.js:818:16)
at Socket.<anonymous> (internal/child_process.js:319:11)
at emitOne (events.js:77:13)
at Socket.emit (events.js:169:7)
at Pipe._onclose (net.js:469:12)
Try reinstalling watchman:
npm r -g watchman
brew update && brew upgrade
brew install watchman
If that doesn't fix it, try the answers posted here.
Try to re-install libtool by:
brew reinstall libtool --universal && brew unlink libtool && brew link
libtool
If won't help, try to remove it completely and re-try above
again:
brew uninstall libtool

Building GCC make: *** [all] Error 2

I am trying to set up a cross-compiler for i686-elf on Ubuntu following the OSDev GCC Cross-Compiler Tutuorial. However, the code to set up GCC fails to build every time. I know my sources are not out of date because I sudo apt-get update'd before doing anything.
In order to get the packages I needed, I did:
sudo apt-get install g++
sudo apt-get install make
sudo apt-get install bison
sudo apt-get install flex
sudo apt-get install libgmp3-dev
sudo apt-get install libmpfr-dev libmpfr-doc libmpfr4 libmpfr4-dbg
sudo apt-get install mpc
sudo apt-get install texinfo
sudo apt-get install libcloog-isl-dev
I think there is no problem with that method?
Then, with gcc-5.2.0 and binutils-2.25.1 (in ubuntu, bintuils appears to not work with anything above that old version) I installed binutils just fine. I went to build gcc but when I typed in make, I got the following error:
Unfortunately, I can't copy+paste 30 pages in, but this all the code near the end:
checking command to parse nm output from gcc -m32 object... failed
checking how to run the C preprocessor... /lib/cpp
checking for ANSI C header files... no
checking for sys/types.h... no
checking for sys/stat.h... no
checking for stdlib.h... no
checking for string.h... no
checking for memory.h... no
checking for strings.h... no
checking for inttypes.h... no
checking for stdint.h... no
checking for unistd.h... no
checking for dlfcn.h... no
checking for objdir... .libs
checking if gcc -m32 supports -fno-rtti -fno-exceptions... no
checking for gcc -m32 option to produce PIC... -fPIC -DPIC
checking if gcc -m32 PIC flag -fPIC -DPIC works... yes
checking if gcc -m32 static flag -static works... no
checking if gcc -m32 supports -c -o file.o... yes
checking if gcc -m32 supports -c -o file.o... (cached) yes
checking whether the gcc -m32 linker (ld -m elf_x86_64 -m elf_i386) supports shared libraries... yes
checking whether -lc should be explicitly linked in... no
checking dynamic linker characteristics... configure: error: Link tests are not allowed after GCC_NO_EXECUTABLES.
Makefile:9590: recipe for target 'configure-zlib' failed
make[1]: *** [configure-zlib] Error 1
make[1]: Leaving directory '/home/david/scr'
Makefile:876: recipe for target 'all' failed
make: *** [all] Error 2
And this is the part (right after that) where something really bad happens:
checking dynamic linker characteristics... configure: error: Link tests are not allowed after GCC_NO_EXECUTABLES.
Makefile:9590: recipe for target 'configure-zlib' failed
make[1]: *** [configure-zlib] Error 1
make[1]: Leaving directory '/home/david/scr'
Makefile:876: recipe for target 'all' failed
make: *** [all] Error 2
Can anyone tell me what I am doing wrong and how I would fix it?
Thanks!
The problem was that I wasn't installing mpc from source.
Here is the finished file (setup-gcc.sh):
####################################
echo Stage 1 - Building Dependencies
####################################
# make a working directory
cd $HOME/Documents
rm -rf Cross
mkdir Cross
cd Cross
# install or update all apt-get dependencies
sudo apt-get update
sudo apt-get upgrade -y
sudo apt-get install gcc -y # not cross
sudo apt-get install g++ -y
sudo apt-get install make -y
sudo apt-get install bison -y
sudo apt-get install flex -y
sudo apt-get install gawk -y
sudo apt-get install libgmp3-dev -y
sudo apt-get install libmpfr-dev libmpfr-doc libmpfr4 libmpfr4-dbg -y
sudo apt-get install mpc -y
sudo apt-get install texinfo -y # optional
sudo apt-get install libcloog-isl-dev -y # optional
sudo apt-get install build-essential -y
sudo apt-get install glibc-devel -y
sudo apt-get -y install gcc-multilib libc6-i386 -y
# download and unpack necessary files
wget http://ftpmirror.gnu.org/binutils/binutils-2.25.1.tar.gz
wget http://ftpmirror.gnu.org/gcc/gcc-5.3.0/gcc-5.3.0.tar.gz
wget http://ftpmirror.gnu.org/mpc/mpc-1.0.3.tar.gz
for f in *.tar*; do tar zvxf $f; done
# create installation directory
mkdir Install
export PREFIX="$HOME/Documents/Cross/Install"
export TARGET=i686-elf
export PATH="$PREFIX/bin:$PATH"
################################
echo Stage 2 - Building Compiler
################################
# install mpc
mkdir build-mpc
cd build-mpc
../mpc-1.0.3/configure --prefix="$PREFIX"
make -j2
make -j2 check
make -j2 install
cd ..
# install binutils
mkdir build-binutils
cd build-binutils
../binutils-2.25.1/configure --target=$TARGET --prefix="$PREFIX" --with-sysroot --disable-nls --disable-werror
make -j2
make -j2 install
cd ..
# install gcc
mkdir build-gcc
cd build-gcc
../gcc-5.3.0/configure --target=$TARGET --prefix="$PREFIX" --disable-nls --enable-languages=c,c++ --without-headers --with-mpc="$PREFIX"
make -j2 all-gcc
make -j2 all-target-libgcc
make -j2 install-gcc
make -j2 install-target-libgcc
Once you have it installed, you can run it with:
export PREFIX="$HOME/Documents/Cross/Install"
export TARGET=i686-elf
$PREFIX/bin/$TARGET-gcc --version
Unfortunately, doing this inside of an alias or bash script doesn't seem to properly launch it, so, unless this gets fixed, you might have to just store the script in a text file and copy-paste it into terminal every time you reboot.
To uninstall your cross-compiler, simply delete the $HOME/Documents/Cross directory.
As a final note, changing the installation directory or target is as easy as changing the value of $PREFIX or $TARGET, but I wouldn't recommend it, because you may run into other unexpected problems.
In addition to --with-system-zlib, it worked for me when I use --disable-multilib option.

Resources