I'm having a problem linking SDL_ttf library with C++ compiler. I have tried three different programs and i couldn't solve the problem in any of them. I've tried Dev C++, Eclipse and CodeBlocks. In all of them it appeared a different error, but all related to not finding -lSDL_ttf or not recognizing the functions of that library.
I'm following this tutorial http://lazyfoo.net/SDL_tutorials/ and have done everything i have found on the internet. I copy the .h file inside /include/SDL/ directory, the .dll files inside the project directory, and the files within /lib directory into the /lib directory that i am using. I think the error might be here, as SDL_image for example, have ".lib" files, and in ttf there is no such file. They are all ".a" or ".la". I'm new to C++ so i don't know if i am doing something wrong.
Thank anyone for his help.
The error in code blocks is the following:
ld.exe cannot find -lSDL_ttf
Make sure you downloaded the correct version of the library. If you have ".a" files, you probably downloaded the mingw version. And for that you have to use a mingw compiler. If you are using something like Visual Studio, you need the version with -VC.zip at the end.
Hope it was useful.
Good coding ;-)
Related
I'm learning to use the Codeblocks editor and I would like to setup a SDL2 project. My question is about the necessary files in the SDL2 package.
In the bin directory there is:
sdl-config
In the lib directory there is:
directories -
cmake and pkgconfig
In the share directory there is:
aclocal
I deleted these files, but my experience with SDL2 and C++ is almost at a beginner level. My understanding is, that these support files are for various command line tools used for compilation. For example I know what pkg-config is and I searched somewhat for the other file types. Is it ok to delete these files since I am using Codeblocks, or will Codeblocks possibly require any of these in some unexpected way at a later time? that I might not have considered. As far as I know, Codeblocks makes full use of it's wizards and it's project handling is separate from these other tools. I basically like to set everything up as an Empty Project. I have no compilation issues or errors, but I wanted the opinion of someone more experienced on this.
I am facing a really for me time-expensive problem. I am new to ubuntu and want to start learning more about opengl by using the glfw. Of course I cannot switch the OS so I will have to stay at ubuntu. I have come so far that I installed the glfw( by following this "tutorial": 2. step by filipwasil), so I have got an include directory in the usr/local dir, aswell as a lib directory. The include directory contains the glfw3.h and the lib directory the libglfw3.a file. If I try to add them to my project in code::blocks it seems like only the include part works, because I can see the functions provided by the glfw while typing, but once I want to compile and run the project, I get an error for each glfw function call: like "not defined reference to e.g. glfwInit". The lib directory also contains a cmake dir, which contains glfwconfig and glfwtarget files, but I really do not know what these files should do. I also noticed the question by Artur, which is quiet identical, but it does not help me because I want to know which files exactly I have to add in order to get a running window. So may question is: How is it possible to make the code::blocks IDE, actually the gcc compiler, know whats behind the glfw functions?
Every help will be appreciated. Sorry for my bad english. :)
Add GL, GLEW and glfw in the linker settings. Note the "glfw" in lowercase
I installed SDL2 for mingw using this guide. However, when i try to compile using the compilation syntax and test code they provide, only with my own file names, I get the error shown here. I assume that this error has something to do with a problem in the way I installed SDL, as the installation instructions did not exactly match the files with which I was provided, but I did my best to follow them. Could they problem be something else? If not what is the correct way to install SDL2 for mingw?
Note: I do have the SDL2.dll file in the sdltest folder where I try to compile the program.
One way to let MinGW know where your SDL libraries are would be to create environment variable named "LIBRARY_PATH" with the value as the path to the directory containing the libraries. Similarly, you can have "CPLUS_INCLUDE_PATH" for the headers as well.
Did you follow step 2 of that tutorial ?
EDIT : OK, I fixed the issue I outlined originally with not being able to find headers for curl and cryptlib. But, after fixing these issues by installing curl and libcryptopp with macports, I encountered a zillion errors in the associated files. I'm marking this answer as complete though
I'm trying to add the Mega.co.nz client SDK to an Objective-C XCode project. The client is written in C++, with .h header files and .cpp implementation files. XCode recognizes these as needing to be compiled with the C++ compiler (I presume).
At this point all I want to do is get the project to compile with no errors. At this time I am getting two errors, both of them on some #include statements.
#include <curl/curl.h> 'curl/curl.h file not found'
#include <crypto++/cryptlib.h> 'crypto++/cryptlib.h file not found'
I think it has something to do with me not having the correct components installed or not referenced correctly within XCode. Should I be linking against a static library to get these headers? Is there a project setting I need to change to search in a specific directory to find these files?
If you can help, thank you very much.
Xcode cannot find the above headers. This is because they are not in the include path. This is most likely to one of two reasons.
You don't have the above libraries installed.
You haven't added the correct path to your build config (like /opt/local/include if you are using macports)
Solutions to try:
Make sure that you actually installed Curl and cryptopp (crypto++) (i.e. compiled them yourself or used a package manager like macports or brew)
Make sure that your build includes the paths to these files (Look at the "header search paths" in xcode project settings
PS. Do not think about linking or such - this has nothing to do with it. You will run into these problems after you've actually compiled the code - i.e. in the linking phase :)
I am using boost libraries in an application which is targeted for multiple platforms including android.
unfortunately boost libraries are not included in android so i am trying to include the boost source files in project and compile them but i am getting many errors when i am trying to do that mostly unresolved symbols in many files
i have created the project as a shared library using eclipse ide and os is ubuntu 11.10
please help and i am not really a nerd so easy to understand solution would be really helpful.
Thanks in advance
make a folder called local/include/ in your home folder. Then create a symbolic link from /usr/include/boost to there. Include ~/local/include in the LOCAL_C_INCLUDES variable in your Android.mk. This will work for the header-only libraries in boost.