Error 255 when try to create .exe using dev-C++ - c++

Today i got the most generic compile error for Dev-C++ ever
Compiler: Default compiler
Building Makefile: "C:\projects\Makefile.win"
Executing make...
make.exe -f "C:\projects\Makefile.win" all
g++.exe -c test.cpp -o test.o -I"C:/Dev-Cpp/lib/gcc/mingw32/3.4.2/include" -I"C:/Dev-Cpp/include/c++/3.4.2/backward" -I"C:/Dev-Cpp/include/c++/3.4.2/mingw32" -I"C:/Dev-Cpp/include/c++/3.4.2" -I"C:/Dev-Cpp/include" -I"C:/SDL-1.2.15/include"
make.exe: *** [test.o] Error 255
Execution terminated
and that's it. I googled around online but usually you can see some other type of errors follow it within the compile log but no in my case. Anyone help. I am running this on window 8

Please update your IDE to the following version, which fixes an immense list of bugs, ships with GCC 4.6.1 or 4.7.0, and is fully portable: http://sourceforge.net/projects/orwelldevcpp/
That would be the number one fix to try and fix this problem regarding the automatically generated makefile. Chances are the updated version will fix your makefile problems.
You could also open up the auto generated makefile yourself and:
Go to Project >> Project Options >> Makefile and tick "use custom makefile".
Try to fix the makefile manually.
???
Rebuild.
Profit.
If this option was previously left unticked, you are sure either the old Dev-C++ made an error creating the makefile or the bundled compiler got broken for some reason.

Related

how do I eliminate linker error mingw32/bin/ld.exe: cannot find -lSDL

I am trying to build SDL for use with Eclipse. I am trying to remove this linker error:
Beginning Compilation
21:15:53 **** Incremental Build of configuration Debug for project CMD ****
Info: Internal Builder is used for build
g++ "-IC:\\MinGW\\include\\SDL2" -O0 -g3 -Wall -c -fmessage-length=0 -o "src\\CMD.o" "..\\src\\CMD.cpp"
g++ -o CMD.exe "src\\CMD.o" -lmingw32 -lSDL -lSDL2main -lSDL2
ERROR(s):
c:/mingw/bin/../lib/gcc/mingw32/5.3.0/../../../../mingw32/bin/ld.exe: cannot find -lSDL
collect2.exe: error: ld returned 1 exit status
21:15:54 Build Finished (took 1s.36ms)
The most pertinent SO archive source I researched didn't seem to have an actionable answer for my problem, though it had the exact same problem/error:
title --
producing the same error message:
c:/mingw/bin/../lib/gcc/mingw32/4.7.0/../../../../mingw32/bin/ld.exe: cannot find -lSDL.
If you click to the authors "solution" for the same error as mine its not clear to me how he solved it.
Any help?
Problem solved, SDL2 awesome. Ok:
c:/mingw/bin/../lib/gcc/mingw32/4.7.0/../../../../mingw32/bin/ld.exe: cannot find -lSDL.
Reinstallation of SDL2 avoiding binary conflict between SDL files and SDL2 files
as keltar mentioned resolved the immediate problem, and the problem built with no errors!Fixing what was in the braces unmasked new problem: crashing. I stripped the program to bare bones and concluded the crashing was outside of the code since it was occurring even without code.
To solve the new problem would need to go the SDL2 distribution file (the one copied to MinGW) and copy the SDL2.dll from it [DLL from distributable][1]--- by dragging the file over your debug and/or release folders where the .exe file lives.(.exe + dll -> right?) moving dll to exes. Build/Run the program
it should work!
You should see a Welcome message!
https://www.caveofprogramming.com/c-for-complete-beginners/setting-up-sdl-windows.html

Clang/LLVM on Eclipse (Mac)

I am trying to run Eclipse with the Clang compiler without success. First I went here http://clang.llvm.org/get_started.html and followed the instructions 1 through 8 successfully. I also installed the llvm toolchain via Eclipse marketplace.
What do I do next to successfully compile with Clang? From the installation I have two folders, llvm and build, where do I put them? How do I connect this to Eclipse?
I also downloaded lld in case I needed it since the llvm-ld doesn't work anymore. Below is my error message. I'll be so grateful if someone can help me figure this out! I've wasted a lot of hours on this.
20:09:47 **** Incremental Build of configuration Debug for project recursion ****
Info: Internal Builder is used for build
clang -O0 -emit-llvm -g3 -Wall -c -fmessage-length=0 -o recursiveprint.bc ../recursiveprint.c
lld -v -native -o recursion recursiveprint.bc
Cannot run program "lld": Unknown reason
Error: Program "lld" not found in PATH
PATH=[/usr/bin:/bin:/usr/sbin:/sbin]
20:09:47 Build Finished (took 74ms)

Compiling Yap on windows 8

I am trying to compile yap on my PC since it seems YAP default installers don't come with the Depth limit flag enabled. I need this to work on an ILP project on Aleph.
The thing is, that I am forced to use a PC with windows 8 without enough memory for a Linux Virtual machine.
I got cygwin to attempt to install it, but once I get to the 'make' stage of the installation ( http://www.dcc.fc.up.pt/~vsc/Yap/Yap4.3/yap.html#SEC2 ) I get this following error
$ make
Makefile:714: warning: overriding recipe for target 'yap.dll'
Makefile:545: warning: ignoring old recipe for target 'yap.dll'
gcc -mno-cygwin -c -O3 -fomit-frame-pointer -Wall -Wstrict-prototypes -Wmissing-prototypes -g -O2 -DCUT_C=1 -DCOROUTINING=1 -DRATIONAL_TREES=1 -DDEPTH_LIMIT=1 -DHAVE_CONFIG_H -D_YAP_NOT_INSTALLED_=1 -I. -I../H -I../OPTYap -I../BEAM -I../MYDDAS ../C/agc.c -o agc.o
gcc: error: unrecognized command line option ‘-mno-cygwin’
Makefile:488: recipe for target 'agc.o' failed
make: *** [agc.o] Error 1
I assume it's due to the latest YAP being outdated right now, does anyone know what to do to work around this?
It seems long time has passed since the question is asked. But I would like to answer since the problem is still relevant (I had this problem lately).
Asking at YAP-users mailing list, I was able to solve this problem. You can check the details here.
In short, using MSYS2 or MinGW-w64 (with toolchain installed) and making few changes in the source code makes it possible.
Changes are:
Adding #include <stdio.h> in blob.c file.
Refactoring H with HEAD (or some other name) in whole project. Which was defined in Regs.h, line 590.

not able to make resource compiler to work with Code::Blocks

I use C++ with Code::Blocks. I like Code::Block, but I can't make resource compiler get working... My test setup is very simple.
**in MoviesList.rc file:**
#include "MoviesList.h"
IDR_TEXT1 RCDATA "C:\\_C++\\PROJECTS\\test2\\MoviesList.txt"
**in MoviesList.h file:**
#define IDR_TEXT1 101
**in main()**
{
HRSRC resInfo = ::FindResource(0, MAKEINTRESOURCE(IDR_TEXT1), RT_RCDATA);
return 0;
}
I get this compile error all the time:
x86_64-w64-mingw32-windres.exe -J rc -O coff -i C:\_C__~1\PROJECTS\test2\MOVIES~1.RC -o obj\Debug\MoviesList.res
Execution of 'x86_64-w64-mingw32-windres.exe -J rc -O coff -i C:\_C__~1\PROJECTS\test2\MOVIES~1.RC -o obj\Debug\MoviesList.res' in 'C:\_C++\PROJECTS\test2' failed.
Nothing to be done (all items are up-to-date).
Compiler setup is the following:
C compiler: x86_64-w64-mingw32-gcc.exe
C++ compiler: x86_64-w64-mingw32-g++.exe
Linker for dynamic libs: x86_64-w64-mingw32-g++.exe
Linker for static libs : x86_64-w64-mingw32-ar.exe
Resource compiler: x86_64-w64-mingw32-windres.exe
Make program: mingw32-make.exe
When I go to project's Properties and then to Build Targets I see that main.cpp and MoviesList.rc are checked, which should be correct... I have Mingw version 4.8.1 and Code::Blocks version is 12.11. All things including Boost work fine, except for the resource compiler.
UPDATE
After changing from x86_64-w64-mingw32-windres.exe to windres.exe the build has produce no errors.
There is no x86_64-w64-mingw32-windres.exe in MinGW/bin, just windres.exe.... I
Entry for the resource compiler has been incorrect.
Code::Blocks is an IDE that invokes the compiler, linker and other tools like the resource compiler. The output of these tools is catched and displayed in the output window.
When you don't get any output from one of these tools you should take the build log and start the tools with the parameter you found in the build log. This might help to isolate the problem.
Additionally you could change the parameters. e.g tell the compiler to stop after preprocessing to look at the preprocessed output. Similar options may exist for the resorce compiler.

Help on build using g++ on Windows

There is a small project C++ (it has win32 code) that I need to build. It already has its Makefile. I was told to use MinGW. I have never used it before. I downloaded and installed the latest MinGW installer.
Then, I opened the MinGW shell and did make. The exe file was created. But when I try to run it I get libgcc_s_dw2-1.dll is missing! Why do I get this error? Shouldn't the exe be self-contained and run anywhere?
UPDATE
Here's more information, from the Makefile:
CC = g++
CCOPTIONS=-DWINDOWS -DFORCEINLINE -DMINGW -DSRTP_SUPPORT -D__EXPORT= -D_WIN32_WINNT=0x0501 -DNOMVS
setup.exe: setup.o common.o
$(CC) -ggdb -g -O0 -o $# setup.o common.o -mno-cygwin -mwindows -lwsock32 -lws2_32 -lwinmm -lgdi32 -lcomctl32 -lmapi32 -lVfw32
Whether or not the exe should be self-contained depends on how you built it. We need to see the commands that were executed, or post the makefile. But that DLL does not seem to be part of the current version of MinGW. Also, please clarify if you are actually doing this under cygwin, or if you added the tag by mistake.
Edit: A bit of googling seems like it has to do with the horrible "official" MinGW installation. Remove it, and download the Twilight Dragon build from http://tdm-gcc.tdragon.net and then rebuild completely. The "official" build is cr*p anyway - I don't know why anyone uses it.
If what you want to do is a stand alone application with MinGW, you should add -static to the linking options.
On a side note, if you're making a Win32 application, add the -mwindows option to the C++ compiler so it doesn't open a console together with your main window.