I have one question about SDL compile, I use DEV C++ compiler a SDL program, but there is a error, the error log:
d:\program files (x86)\dev-cpp\mingw64\x86_64-w64-mingw32\bin\ld.exe cannot find -lSDLmain
d:\program files (x86)\dev-cpp\mingw64\x86_64-w64-mingw32\bin\ld.exe cannot find -lSDL
d:\program files (x86)\dev-cpp\mingw64\x86_64-w64-mingw32\bin\ld.exe cannot find -lobjc
D:\C++\SDL\collect2.exe [Error] ld returned 1 exit status
I learn it from : http://tjumyk.github.io/sdl-tutorial-cn/lessons/lesson01/windows/devcpp/index.html
I completely followed the course step by step to install and config ,but it doesn't compile.
Related
I'm trying to setup SDL2 on windows with vs code and mingw. I have some example code and both the include and lib folders in a src folder in my project. I also have a MakeFile:
When I open a terminal and type "make" I get the following error.
g++ -Isrc/Include -Lsrc/lib -o main main.cpp -lmingw64 -lSDL2main -lSDL2
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/12.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -lmingw64: No such file or directory
collect2.exe: error: ld returned 1 exit status
make: *** [Makefile:2: all] Error 1
My include path in the C/C++ Configurations Extension is "${workspaceFolder}/**".
I also looked in my mingw folder and found the g++.exe I think I need but am not sure why it's saying there is no such file or directory.
I'm trying to setup SDL graphics for my project, and I tried to run it after I was almost complete, but then I got this error:
g++ -o dist/Debug/Cygwin-Windows/project_2_snake build/Debug/Cygwin-Windows/main.o -L../../../../../../../../../SDL2/lib -lmingw32 -lsdl2main -lsdl2
/usr/lib/gcc/x86_64-pc-cygwin/11/../../../../x86_64-pc-cygwin/bin/ld: cannot find -lmingw32
collect2: error: ld returned 1 exit status
make[2]: *** [nbproject/Makefile-Debug.mk:63: dist/Debug/Cygwin-Windows/project_2_snake.exe] Error 1
Can anyone could help me with this?
Additional information
windows 10 i think
Cygwin c++ compiler
Your linker does not know where to find the library you are referencing.
You will have to tell it where to find it. The easiest solution would likely be to add the libs directories of the libraries you are referencing to your linker's search directories.
Well, i did all i knew to work with allegro in C++ but i keep getting the same problem,
-lalleg not found
D:\Program Files (x86)\Dev-Cpp\MinGW64\x86_64-w64-mingw32\bin\ld.exe skipping incompatible D:\Program Files (x86)\Dev-Cpp\MinGW64\lib/liballeg.a when searching for -lalleg
D:\Program Files (x86)\Dev-Cpp\MinGW64\x86_64-w64-mingw32\bin\ld.exe skipping incompatible D:/Program Files (x86)/Dev-Cpp/MinGW64/bin/../lib/gcc/x86_64-w64-mingw32/4.9.2/../../../liballeg.a when searching for -lalleg
D:\Program Files (x86)\Dev-Cpp\MinGW64\x86_64-w64-mingw32\bin\ld.exe cannot find -lalleg
E:\Programacion\C++\Practicas\Allegro\Testing\collect2.exe [Error] ld returned 1 exit status
i tried to make DevC++ to send the -lalleg at compiling but i keep getting that
,if i don't put the compiler to use -lalleg
i get this
D:\Users\J****n\AppData\Local\Temp\ccz9vWbS.o In function `_mangled_main()':
4 E:\Programacion\C++\Practicas\Allegro\Testing\Main.cpp undefined reference to `_install_allegro_version_check'
D:\Users\J****n\AppData\Local\Temp\ccz9vWbS.o In function `WinMain':
7 E:\Programacion\C++\Practicas\Allegro\Testing\Main.cpp undefined reference to `_WinMain'
E:\Programacion\C++\Practicas\Allegro\Testing\collect2.exe [Error] ld returned 1 exit status
any of you know of any possible solution
i'm using Allegro 4.2.2 and the last version of DevC++
the code is something basig ,just a test
int main(){
allegro_init();
return 0;
}
END_OF_MAIN();
any help is welcome,thank you for the time
I'm trying to use MingGW on Windows but when I try to compile my c/c++ files, following error occurs when I compile with C(gcc)
> gcc c:\Users\Administrator\Desktop\C_C++\helloworld\hello.c - o c:\Users\Administrator\Desktop\C_C++\helloworld/hello
c:/mingw/bin/../lib/gcc/mingw32/6.3.0/../../../../mingw32/bin/ld.exe: cannot find -lgcc
c:/mingw/bin/../lib/gcc/mingw32/6.3.0/../../../../mingw32/bin/ld.exe: cannot find -lgcc_eh
c:/mingw/bin/../lib/gcc/mingw32/6.3.0/../../../../mingw32/bin/ld.exe: cannot find -lgcc
c:/mingw/bin/../lib/gcc/mingw32/6.3.0/../../../../mingw32/bin/ld.exe: cannot find -lgcc_eh
collect2.exe: error: ld returned 1 exit status
and following error occurs when I compile with C++(g++)
> g++ c:\Users\Administrator\Desktop\C_C++\helloworldcpp\hello.cpp -o c:\Users\Administrator\Desktop\C_C++\helloworldcpp/hello
g++.exe: error: CreateProcess: No such file or directory
The path variable is C:\MinGW\bin . I've downloaded mingw-developer-toolkit, mingw32-base, mingw32-gcc-g++ and msys-base among the basic setup packages. Also I'm getting #include error for iostream. I've tried almost all of the methods out in the internet but couldn't fix.
It seems like MinGW wasn't installed correctly.
Re-installing it will likely fix the issue.
I have a hello.cpp file and I used a tutorial about boost installation from here.
I did everything like they said and I have a problem trying to run it.
I get:
...found 9 targets...
...updating 3 targets...
compile-c-c++ bin\msvc-14.0\debug\hello.obj
hello.cpp
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE\crtdefs.h(10): fatal error C1083: Cannot open include file: 'corecrt.h': No such file or directory
call "C:\Users\Paula\AppData\Local\Temp\b2_msvc_14.0_vcvarsall_x86.cmd" >nul
cl /Zm800 -nologo #"bin\msvc-14.0\debug\hello.obj.rsp"
...failed compile-c-c++ bin\msvc-14.0\debug\hello.obj...
...skipped <pbin\msvc-14.0\debug>hello.exe for lack of <pbin\msvc-14.0\debug>hello.obj...
...skipped <pbin\msvc-14.0\debug>hello.pdb for lack of <pbin\msvc-14.0\debug>hello.obj...
...failed updating 1 target...
...skipped 2 targets...
I have corecrt.h in:
C:\Program Files (x86)\Windows Kits\10\Include\10.0.10150.0\ucrt
and in:
C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt
I tried setting includes and libraries like here Unable to compile and link simple C++ program with Visual Studio 2015 command line tools but it doesn't work for me. I tried to find help here: Introducing the Universal CRT, but I'm not creating any project in VS, just trying to run one with a Command Prompt and I'm not sure what to do in my case. I'm totally new in this topic and I know my question may be stupid, but I really need it. I spent many hours trying to solve it and I have nothing.
Found solution here: https://svn.boost.org/trac/boost/ticket/11487
1) Go to %TEMP% folder
2) Remove all b2_*.cmd files