I just had a fresh new version of Code::Blocks(12.11) and tried to make a glut example project, but the generated code has some linking issues.
The minGW settings are is set to the correct values, since I successfully linked ad compiled a glfw project from *.a files. My problem is the linker just can't handle .lib files for some reason. I always get undefined reference errors, despite of the linking of the correct libraries.
I just don't know what to do/link...
How can I link *.lib files in the new Code::blocks?
IF I cannot, are there any glut binaries in the format of *.a files, or should I build it myself?
Finally I found this link, used this package, and did a clean build(rebuild) of the project, instead of Build. Works like a charm!
Related
I had a CMake project. In order to use some cuda kernels in the project, i tried to first changed the name of mian.c to main.cu.
When i cmake the project, the Makefile is generated fine but when i try to build the project using make, the building process prompt me following:
main.cu: undefined reference to <ftns>
The building process works perfectly fine when i modify the main.cu to main.c
The issue was resolved.
The extension of the main was .cu and the which it was directly calling were in .c extensions. So i also changed the extension of those files to .cu and it worked.
I have included an external package callled SoPlex (a folder of .cpp and .h files and the library files) into my OMNet++ project. I have already tested the package in Code::Blocks IDE and it works fine besides some warnings it had: warning: explicit conversion operators only available with -std=c++11 or -std=gnu++11.
It certainly was working in Code::Blocks IDE. But when I want to use it in my OMNet++ project it gives a lot of errors for the SoPlex package like in the picture:
It gives a lot of errors for just the code of SoPlex and not my OMNet++ project code.
Any idea what may cause the problem?
I have used MinGW to compile SoPlex package in Code::Blocks IDE. When I use MinGW GCC in OMNet++ instead of GCC for OMNet++ as current toolchain there is this error fatal error: omnetpp.h: No such file or directory.
Regarding the errors with the 3rd party library. Depending where you put the library inside the src folder, at least that directory must be added as an include dir, otherwise the header files will not be found by the compiler.
As for the problem with the omnetpp.h: OMNeT++ has it's own makefile generator which automatically adds the required include folder (omnetpp_root/include). The generic MinGW GCC toolchain does not. If you want to avoid extra work, always use the omnet toolchain to build your models.
I'm trying to build libmcrypt library to use it with my project. It happened so, that they do not provide any kind of assistance.
First I've faced a problem with -no-undefined flag for gcc which is not further supported. I've replaced -no-undefined with -Wl,-no-undefined in makefiles and it does the trick.
But anyway I'am having problems. Lib is builded in .a files. I can see them in my C:\MinGW\msys\1.0\local\lib folder (it is analogue for /usr/local/lib folder in MinGW). But I need .dll library, not static .a .
So: what else must I change in makefiles to make MinGW build dll with header and debug info for it?
Problem is actually that my compiler doesn't find the SDL library files. I rounded down possible errors by removing all SDL files, reinstalling SDL and compiling without SDL_image. No help.
Files I copied from SDL-devel-1.2.15-mingw32.tar.gz package:
sdl\include to mingw\include\sdl (I later copied files to mingw\include root as well)
sdl\lib to mingw\lib (3 files: libSDL.dll.a libSDLmain.a and libSDL.la)
sdl.dll and sdl-config to mingw\bin
I installed it via msys, and later manually just to make sure, and also copied same files to corresponding places in msys folder.
The error message:
c:/mingw/bin/../lib/gcc/mingw32/4.7.0/../../../../mingw32/bin/ld.exe: cannot find -lSDL
I have been using a simple make command in msys console, I moved the options for build into makefile to make things easier.
I'm using WinXP, MinGW/MSYS, SDL 1.2.15 and trying to compile fheroes2 source code.
I am a noob and am having an issue with linker flags.
I tried building my own ssh2 libraries, and then afterwards I cloned a git repository with a project in the libraries already built.
Before I downloaded the compiled binaries, I was building with gcrypt and added the -lgrcrypt library to the other linker flags.
With this new library set that I am using, I no longer require gycrpt and so I removed the linker flags. However that did not clear the linker options. I am still getting all of the old linker flags in spite of clearing them in the project properties.
The error shows that the -lgrypt is still being processed as a linker flag:
-no_implicit_dylibs -mios-simulator-version-min=6.0 -lgcrypt
How can I reset the linker flags to what they were?
Thanks in advance
well i presume you have checked the flags and removed the path for that lib in your target level of the project, and also have clean the build and removed the previouse builds from organizer and inside xcode, and also have reset your simulator, and also have checked the project folder on your computer and removed that lib from the library folder of the project. these are the necessary steps and if you have done all of these then i cant think of anything else other than port your code to a new project and try to compile again. good luck my friend.