MinGW Error "Only Win32 target is supported" - c

I recently updated my Ubuntu and now I get an error message saying "In included file: Only Win32 target is supported" every time I try to compile a C project. I use Codelite 15.0.2 and Mingw-w64 7.0.0-2. Before I updated my OS everything worked flawlessly and I have no idea how to fix this error, reinstalling Codelite and Mingw-w64 and searching on google didn't solve anything either :(

MinGW-w64 exists for 32-bit and 64-bit Windows.
The /usr/i686-w64-mingw32 part of the message you get tells me you're using the 32-bit Windows target.
If you run apt-cache search mingw-w64 in Ubuntu you will see there are seperate i686 and x86-64 packages.

Related

netbeans8.2 + msys2_64 + mingw64 + cygwin64 + C project build errors

On new HP tower G4 workstation with Xeon E2224G processor, Windows 10 pro for wokstations OS build 19042.746.
install netbeans 8.2
Install msys2_64 and mingw64
set path e:\msys64\usr\bin; e:\msys64\mingw64\bin; %PATH%
Verify that make,sh,bash,rm and more are in e:\msys64\usr\bin
configure netbeans for C project and try to clean and build and get this error:
'No shell found. Cannot proceed. Please install either CYGWIN or Msys.'
OK then, install cygwin.
Now get this error:
'1 [main] rm (7980) E:\cygwin64\bin\rm.exe: *** fatal error - cygheap base mismatch detected - 0x180345408/0x180347408.'
This problem is probably due to using incompatible versions of the cygwin DLL.
Search for cygwin1.dll using the Windows Start->Find/Search facility
and delete all but the most recent version. The most recent version *should*
reside in x:\cygwin\bin, where 'x' is the drive on which you have
installed the cygwin distribution. Rebooting is also suggested if you
are unable to find another cygwin DLL.
cygcheck -c gives
base-cygwin 3.8-1 OK
base-files 4.3-2 OK
cygwin 3.1.7-1 OK
I have searched and there is only one cygwin1.dll
frank#FRANK_NEW ~
$ which cygwin1.dll
/usr/bin/cygwin1.dll
I have restarted the machine several times to no avail.
I have been using netbeans and mingw then msys/mingw for about 10 years and
have the combination working on other desktop and laptop machines, but have
not had this problem.
Thanks for the replies above. The problem here is the different ways that PATH is handled by Windows 10 Pro and Windows 10 Pro for Workstations.
For Win10 Pro
define a user variable 'MSYS_HOME' give it a value of 'E:\msys64\usr\bin'
now put that in the system path i.e.
some system path;%MSYS_HOME%;more system path
Netbeans will find the tools rm, sh, make, etc and complete the clean and build of the project.
for Win10 Pro for Worksations
the above did not work. Netbeans would not build the project and give the error
'No shell found. Cannot proceed. Please install either CYGWIN or Msys.'
the path has to be set in the system path directly i.e.
some system path;E:\msys64\usr\bin;more system path
this made Netbeans work correctly to perform clean and build.

Eclipse neon C program not getting build g++ and gcc not found in path error

Today I have installed for c and c++ development in windows 7 64 bit os. when creating the project getting error in console .
Eclipse neon version :
Eclipse IDE for C/C++ Developers
Version: Neon.2 Release (4.6.2)
Build id: 20161208-0600
When opening eclipse getting below error in the IDE
1) "g++" not found in PATH
2) gcc not found in Path.
I have installed MinGW GCC compiler still getting error in Eclipse neon and Luna.
More attached a video screencast.
http://recordit.co/E1lFakauTK
After many hours looking for the problem I solved it by adding a variable:
Open Window-->Preferences-->C/C++-->Build-->Environment
Click on Add
Write in Variable: PATH
Write in Value: C:{your MinGW Directory}\bin
Hope it helps.

OpenMP support on OSX 10.11, gcc errors with "file omp.h not found"

I have been using gcc version 5.3.0. It says that it comes with openmp support. But every time when I compile a program using either gcc [by terminal] or via xCode 7, I get same error, "file omp.h not found". I have searched too much on this issue and tried almost everything I found.
First I tried to locate omp.h on my mac. I found some files; then in header file, I used that specific location of omp.h but no help [it gave me linker error].
I installed gcc version 6.0 (pre-release) but no help. I tried changing C_INCLUDE_PATH [which is now, and previously set to none] but that didn't helped me as well.
I reinstalled clang-omp but no help.
I am using llvm compiler version 7.0. Although i have installed clang-omp, there is no omp.h in my /usr/include/*
I changed the compiler and now I am able to run it. [It was issue of clang, which I couldn't solve].
I am a student and Intel is giving Intel Parallel Studio 1 year licence for free to students.
So I downloaded, and installed it.
In xCode, under build settings, I set my compiler to 'Intel C/C++ compiler' and in parallalization, I turned it to 'yes'. That was it. Then it compiled successfully. But, note that you won't be using header file 'omp.h' anymore.
By the way, I am still looking for answers, just to know what I was doing wrong.
You can install 'clang-omp' or 'gcc' (corresponds to GCC 5.3 right now) packages via Homebrew, both of which support OpenMP.
The built in GCC is based upon GCC 4.2.1 abs uses LLVM back end via Dragonegg, which is why it doesn't support OpenMP.
As noted already, Intel compilers support OpenMP on Mac.
I don't use Xcode editor so I don't know how to use any of these from there, but all will work from terminal just as they do on Linux.
the compiler on the mac is clang (based on llvm 3.5) which does not support openmp.
you can try install llvm/clang/openmp from source or using prebuild binaries, but I must admit it does not work as advertised for me…
edit unless you use the -fopenmp=libomp flag.

GCC installed on ubuntu 14.04, but no toolchain visible on eclipse?

So itś my first time using eclipse in ubuntu and I seem to have problems with setting up GCC as the toolchain. I expect the toolchains to work with a standard HelloWorld example, but they don't (after building the project of course).
I get the following error:
When adding the new project, I only have a choice between these toolchains:
When unmarking ¨Show project types and toolchains only if...¨, I do get the GCC toolchain in the list, but that doesn´t seem right (and is also not working).

Linking libbz2.dll under windows (64-bit)

I'm trying to use BZ2_bzBuffToBuffDecompress() provided by bzlib.h from bzip.org
My OS is windows 8 64-bit.
I'm using Dev-C++ 5.6.2 and MingW64.
I created a new C project, included "bzip2-1.0.6/bzlib.h" and added the linker -lbz2
Then I built libbz2.dll using Visual studio 2013.
The first time, I built it using the Win32 platform option, witch gave me (while compiling my C program)
skipping incompatible .../bzip2-1.0.6/libbz2.dll when searching for
-lbz2
The second time, I built it using the x64 platform option, witch gave me
undefined reference to BZ2_bzBuffToBuffDecompress
Is there any way to solve this?
UPDATE
I tried the libraries from Cygwin64 (libbz2.a, libbz2.dll.a, libbz2-2.dll) but each one gave the first error message.
UPDATE 2
I ended up using MinGW (32-bit) with libbz2-2.dll

Resources