I'm starting to learn C++ to make a game, I compiled some little programs and it worked fine to learn. Now I want to compile a game and learn how it was done.
The game I'm trying to compile is ATANKS (https://libregamewiki.org/Atanks).
First problem I have is the makefile contains an instruction on the target WINUSER that gives me error (it doesn't found the directory INSTALLDIR), I tried to compile manually entering SRC directory and run MAKE -f makefile.windows, it start to compile and stops with this error:
c:/tdm-gcc-64/bin/../lib/gcc/x86_64-w64-mingw32/4.8.1/../../../../x86_64-w64-min
gw32/bin/ld.exe: atanks.o: bad reloc address 0x20 in section `.data'
collect2.exe: error: ld returned 1 exit status
make: *** [../atanks.exe] Error 1
Because a comment in the file atanks.rc I asume this was writed using DEV-C++ but it hasn't the .DEV project file.
Some info:
I'm using windows 7 64 bits.
I have installed DEV-C++, but for my game I'm using CODEBLOCKS.
Installed TDM-GCC-4.8.1-3 and allegro-4.4.2-mingw-4.5.2
Installed make-3.81
The PATH variable is: PATH=c:\TDM-GCC-64\bin\;"c:\Program Files (x86)\GnuWin32\bin\";
Other thing I tryed is making a CODEBLOCKS project, it seems to go but give me some errors too.
Thanks in advance and forgive me the bad english :)
(maybe someone can recommend me a forum to ask more, better if the language is spanish)
Someone on a IRC Channel help me to solve it, a little change on the makefile and use a 32 bit compiler instead 64 bit one was the solution.
Related
Trying to build bgfx. Following the documentation for building it, I run make mingw-gcc.
This, originally resulted in Set MINGW environment variable & make.exe": *** [mingw-gcc-debug32] Error 127 so I set the MINGW environment variable, and this got rid of the Set MINGW environment variable message. However, I still get the same error:
make.exe": *** [mingw-gcc-debug32] Error 127, and I also noticed:
C:/(directory to my project)/extern/bgfx/C:/MinGW/msys/1.0/bin/make.exe: No such file or directory. Like the directory to make.exe was being appended onto the end of the directory to bgfx. I'm at a complete loss as to why or even how this is happening, and I've no idea how to fix it. I've tried changing the MINGW environment variable, using mingw32-make, specifying mingw-gcc-release64, etc... To be honest, I don't even know if this is related solely to bgfx or if it's a problem with make or whatever Idk... Shooting my shot here to see if anyone can help.
Thanks.
*This is my first programming course in over 20 years, so I am basically clueless.
I am trying to complete the last project in the course which includes installing and configuring SDL. Right now all I have is the basic "Hello World" code. I get the error when I add #include .
When I installed SDL, I copied the SDL2 folder and the entire lib folder to MinGW-w64 - as instructed by a tutorial.
I have MinGW-w64 installed. Here is the build error:
C:/MinGW64/bin/../lib/gcc/x86_64-w64-mingw32/8.1.0/../../../../x86_64-w64-mingw32/lib/../lib/libmingw32.a(lib64_libmingw32_a-crt0_c.o):crt0_c.c:(.text.startup+0x2e): undefined reference to `WinMain'
collect2.exe: error: ld returned 1 exit status
I've been googling for hours and cannot seem to find any help.*
Edit:
Thank you both so much for your quick responses.
Here is what I did in settings:
Do I need to put an 'l' in front of these items?
I got some help elsewhere and added #define SDL_MAIN_HANDLED. This allowed the project to build, but it still doesn't run. I get nothing at all when I try to run it. I tried calling SDL_GetError(), but still nothing.
also make sure your main has the following signature:
int main(int, char**) - SDL is pretty militant about it
I got some trouble trying to compile a programm developed by some researcher supposed to compute in a very precise way fourier transform and some other useful operation scientific paper here, whereas all the files needed and the makefile are provided.
I use gcc and a version of ubuntu available on windows10 (18.04), so, I linked all the librabries needed by the program and called in the pre-made makefile (fftw, lapack, gfortran..) everything is ok untill here, but once I tried to compile I got the error message:
/usr/bin/ld: cannot find -lgfortranbegin
collect2: error: ld returned 1 exit status
Makefile:38: recipe for target 'furian_main' failed
make: *** [furian_main] Error 1
After a few research it appears that libfortranbegin is a legacy code and no more available(source: here ) ..
So my question is: is it possible for me to compile my program without this legacy library (somme people say that we could get rid off this library, but I didn't understand what they do .. here)
Or should I do some update or use another library ?
Thank you for your time and consideration :)
The usual way of solving this is the following one:
remove the -lgfortranbegin
check the new link errors and look at what source file from the original source code implemented this feature
add this source file to your repository and your build and go back to step 2.
Be aware that it may still not work in the end, but hopefully you will be able to have the missing symbols.
This is the log I received from Dev-Cpp when I tried to compile a program:
Compiler: Default compiler
Building Makefile: "C:\Dev-Cpp\Makefile.win"
Executing make...
make.exe -f "C:\Dev-Cpp\Makefile.win" all
make.exe: Interrupt/Exception caught (code = 0xc00000fd, addr = 0x4ff283)
Execution terminated
I have googled for the answer, I've tried the "PATH" fix, and make my MINGW stuff first like this.
C:\Dev-Cpp\mingw32\bin;C:\Dev-Cpp\bin;
Yet I still can't compile, I've even restarted my computer (Windows 7 x64), and still the same error. So I'm wondering if you guys have any answers that can help.
Thanks in advance!
I have used the old Dev-C++ in the past and I've have had it break randomly on me at times.. (crucial times I might add).
Bloodshed Dev-C++ hasn't been updated for years and development has actually stopped on it.
If you really like the environment consider getting the updated and maintained Orwell Dev C++ that is improved, faster and much cleaner.
No additional PATH is normally needed for compilation with Dev-CPP.
Seems to be a very old Dev-CPP version. My version neither has a \Dev-Cpp\bin directory, nor a Makefile.win in the main location. Maybe your installation is defective.
Did you install the compiler system along with Dev-CPP (and make executeable).
Please remove everything and use a modern, up to date version of DevCpp for 32 or 64 bit.
Dev-CPP 32bit
Dev-CPP 64bit
One hint: Do not install DevCpp into a directiory with ' ' spaces, like /Program Files/ etc. Better, use C:\Apps\Dev-Cpp or sth. like that.
Addendum
To the critics who say "Dev-Cpp is very old, drop it". No, thats wrong. Dev-Cpp is imho actually the best free IDE/Compiler system for Windows - and I have a lot of them installed (Netbeans, CodeBlocks, VS2010, VS2012rc, dropped Eclipse/CDT). Please have a look here ...
Dev-Cpp retains the simplicity of the early Turbo-Compiler and connects that with 32/64bit gcc 4.6. Although I use VS2010/12rc for serious development, I always create the projects in parallel for Dev-Cpp in order to get gcc compatibility.
Regards
rbo
perhaps recursion problem in macro expansion.
Makefile:
rtest=$(info $(words $1))$(call rtest,$1 1)</b>
$(info $(call rtest))
# eof Makefile
yields :
2152
2153
mingw32-make: Interrupt/Exception caught (code = 0xc00000fd, addr = 0x00007ffdbdea2f57)
2154
I do think that some of my problems concerning adding new functionality to old C++ code can be solved elegantly using AOP. Now, my first idea was to download AspectC++ and just start working. However, it doesn't seem to be that simple:
The Visual Studio integration thingy by pure systems has been updated for the last time about 5 years ago, adding support for VS '05. '10 (which I'm using) isn't detected during installation which in turn results in the installation being canceled.
ACDT was updated the last time Feb '07, Eclipse 3.2 being the last one supported, installation on current Eclipse fails.
Simply trying to compile the examples that come with AspectC++ doesn't work either:
username#username-VirtualBox:/media/sf_Temp/aspectc++$ make
make -C examples/coverage
make[1]: Entering directory `/media/sf_Temp/aspectc++/examples/coverage'
Compiling main.cc
make[1]: /media/sf_Temp/aspectc++/ag++: Command not found
make[1]: *** [Junk/main.o] Error 127
make[1]: Leaving directory `/media/sf_Temp/aspectc++/examples/coverage'
make: *** [coverage.make] Error 2
username#username-VirtualBox:/media/sf_Temp/aspectc++$
This "command not found" is weird, as simply running ag++ works (albeit it then of course complains about having no input files).
Soooo ... I'm kind of lost now. Any help on where to find a working manual for performing the first steps or some hint concerning what I'm doing wrong would be appreciated. Or is AspectC++ just too outdated/unusable/whatever for people to use it (which would explain the lack of some simple first-steps-manual which usually can be found by the hundreds)?
Thanks in advance.
I'm the AspectC++ project leader. If you need help, the best way is to subscribe to the AspectC++ user mailing list (visit www.aspectc.org and click on "support") and post a question there. It is not possible to be aware of all questions being posted anywhere on the web. Sorry. Yet, you are really welcome on our mailing list! :-)
In your special case, the error message sounds as if ag++ hadn't found ac++. These two binaries have to reside in the same directory. ag++ is just a wrapper that calls ac++, which performs the actual code transformation, and g++ for the compilation into an object file.