-
Notifications
You must be signed in to change notification settings - Fork 27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Building project on Linux #143
Comments
Have you followed the steps in wiki? http://indielib.com/wiki/index.php?title=Building_IndieLib |
Yeah. I've built all the dependencies as it is said in wiki. Even if I try to build the first tutorial, I get that errors. |
When I got similar error on Windows, I just added "#pragma comment (lib, "IndieLib.lib")" to CIndieLib_vc2008.h and it worked. But I can't do the same here. |
Hm, what error do you get exactly? We moved along from having the Visual studio pragma to link. Lib should be linked by compiler settings. It would be good to know what distro you are running too. |
I get "undefined reference to <func_name>" for all the IndieLib functions that are called. |
By the way, you can take a look at our configuration for the test and tutorials to link against the library. You will need LD flag, to link against indielib: -lIndieLib For example, for tutorial 01 automake file: |
Where do I have to use this flag? |
By the way, if I remove that pragma I get this: |
Hm. that declaration is windows, not linux code. What version of indielib are you trying to build against? Did you try latest master? I've compiled it just now under Debian. |
Ok. I'll try to add that flag. |
can you update to latest master? It's quite stable right now. If you can post any makefile here we can help you in getting it right to link against Indielib |
I use the latest version. Updated two hours ago. I use Code::Blocks, so I have no idea about makefile. (Have no experience in building on Linux). |
Hmm, I never used Code::Blocks... BUT, you need to link against indielib in your project somehow. Maybe this would help, (sorry I just throw first thing returned from google search, which has some meaning to me): http://www.learncpp.com/cpp-tutorial/a3-using-libraries-with-codeblocks/ |
I found how to link to the library but I have to select the lib file. Have no idea where it is. |
Or can you tell me the easiest way to build my project without any IDE? |
Regarding of where the lib file is, you will see it when you make: To build indielib It generally should be in /usr/local/lib/ after you built and installed indielib in your system |
The easiest way is whatever is more comfortable for you :) makefiles can be 'easier', but if you will start to hack a bigger project they become a hassle. so you can stick with Code::Blocks. Problem is we don't support it directly. We want to make CMake a priority, so anybody could choose to which IDE work using CMake to generate project files. Will come in due time ... |
There is no IndieLib in /usr/local/lib. I guess there were some errors in building it. Gonna check it out tomorrow. |
Ok. There were some problems with building IndieLib. After doing 'autoreconf' I had to do next: After this commands I finally have libIndieLib in my /usr/local/lib. |
Tried to build project. Linked it to IndieLib. Then I had to link FreeImage, GLEW and SDL. Now I get errors about undefined reference to OpenGL functions. |
Yes this is not totally correct on our side, we will fix it. You should not need to link against dependencies again in the app using indielib. Just add gl to the linked libs, should be in your system already. Glad you could advance further with the problem. |
Actualy I need to link dependencies, because there is the same problem with them - undefined reference. The only problem left is to find GL libs. Couldn't find them. |
I think it's the Glew dependencies. If you take a look under the Linux part in the wiki, they are mentioned : http://indielib.com/wiki/index.php?title=Building_IndieLib |
@Sergey-Yaschuk Did you suceed? Can we close this issue? |
Yeah. You can close it. Thanks for help. |
When I try to build my project I get a lot of "undefined reference to" errors. This is my first project on Linux, so I have no guess what should I do. All my projects were built on Windows without any problems.
The text was updated successfully, but these errors were encountered: