-
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
Project should use CMake #128
Comments
Note to self: remember to take a look at issue #19 when creating the Cmake setup for linux. |
My CMake implementation is well on the way. The library libIndieLib builds for me, but with no DirectX support and Tests haven't been added yet. /tmp/cc6m8U90.o: In function Yet, I can see that indielib.cpp and IND_Render.cpp are being built. Checking libIndieLib with nm also shows that these symbols are missing. |
@Smilex Great! CMake is a transition we definitely want to make. Hm, I can just guess why is it you have these undefined refs. What platform are you compiling for? |
Ubuntu Raring, Linux 64 bit arch |
You should be able to recreate it by checking out my cmake branch. This is my test code. Compiled with: g++ --std=c++11 -L"." -lIndieLib main.cpp #include "../common/include/Indie.h"
int main()
{
IndieLib::init(IND_DEBUG_MODE);
IND_Render * render = new IND_Render;
IND_WindowProperties properties("Test",800,600, 32, false, false, true);
IND_Window * window = render->initRenderAndWindow( properties );
IndieLib::end();
return 0;
} |
Hi, Hmm, in thoose clases we use preprocessor macros. But you state thet the On 21/09/2013 20:21 "Ian T. Jacobsen" [email protected] wrote:
|
Hi Ian, I did the buildsetting for the linux version (very poorly i might add) . linux/tutorials/basic/01_Installing (makefile) The code is placed at: IndieLib/tutorials/basic/01_Installing/ The code in Cindielib.cpp and Cindielib.h is the code im referring to. Hope it can help. Regards. Michael, On 21/09/2013 22:51 "Ian T. Jacobsen" [email protected] wrote:
|
I'm checking on my side. Trying to understand and figure out what happens. By the way, very good work on setting CMake up! I want a pull request when it works :) |
Ok, I'm using Tutorial 01 now for testing. Seems like there are undefined references to everything. Not sure what's going on |
I can't get the files to configure. I get GLEW not found errors on OSX and Debian virtual machine. Are you building static lib? It would be helpful if you can upload the output of nm to a file. |
DarthMike: I'm building a shared lib. On Debian do "sudo apt-get install libglew-dev". The local source for GLEW doesn't work yet with CMake http://www.cmake.org/pipermail/cmake/2004-April/004948.html |
Output of nm http://sprunge.us/beJR |
Try building static lib. I think in the code, Defines.h for Linux, we miss a line like this: Actually the same as OSX and iOS. By building a static Indielib library this is not a problem. I see in nm output, all Indielib symbols are defined. Buy you may be right, and there is static lib order issue. Thing is depencencies are quite independent to each other. So only GLEW and SDL may be related, as FreeImage is independent, so is TiXml |
I get the same issues by building statically |
Turns out that many of the dependencies for IndieLib aren't linked statically into the IndieLib library. I have now successfully built the first tutorial, with IndieLib built with CMake as a static library. I'll look into statically linking dependencies. |
We currently link all dependencies statically. For iOS all libs need to be statically linked, so I changed it in other platforms as well. |
SDL 2 has CMake build files in its git repository, and because of that I see no reason for me to do my own. Other than that, I'm building everything in statically. |
So was the issue related to linking dependencies as shared libs? Was it anything else? |
When building the tutorial, or just any application using IndieLib, you have to link most of the dependencies for IndieLib (SDL, GLEW, etc.) to your application as well. |
@Smilex Hm that should not be the case. It depends how the dependencies are linked against indielib. They should be linked statically, regardless if we build an Indielib shared or static library. The point of libs like indielib is to hide those dependencies. On current setups, client apps don't need to link against: Unless they want to use those in their code, not by using Indielib. |
I'm working on fixing it, but I'm quite busy at the moment. |
It's been awhile, but I think I'm almost there. The cmake branch is now rebased on a new SDL-hg branch, which is SDL taken from their hg repo. This is because CMake files for SDL are in there. libFreeImage.a(GetType.cpp.o): relocation R_X86_64_32 against `.rodata' can not be used when making a shared object; recompile with -fPIC I did push my progress so far, to my fork because I don't expect to have much time to work on this. |
Ok IndieLib compiles. Just a few linker errors left |
@Smilex great :) |
@Smilex any chance, that you can post those linker errors here, just so we have an idea what's left when we pickup the code? |
For FreeImage I was having build issues with libjpeg (missing io.h) and libtiff (missing unixio.h). First I tried figuring it out, but found that libopenjpeg also exists, so I decided to drop building libjpeg. libtiff had a very similiar issue, so I decided to drop it (with the plan of solving it later). So now when I try to build a tutorial with IndieLib, I get undefined references to libtiff, amongst other things, which doesn't come as a surprise, but that's where I'm at now.
|
Moved issue to 0.7 |
got the cmake build up and running. have sucessfully build the static version of indielib , and build the tutorials and benchmark tests using the static build. The executables runs fine, and is about 8 mb big. All work is done in the CMAKE branch. |
All non3D Tutorials Tests and Unittest are now up and running in CMAKE. Haven't had succes with building the tileless editor yet though. It is really cool to see Everything being buildt and linked by a single command =) |
Using CMake will enable us to just edit one project config, thus easing the development when new features or even single files need to be added to compile targets.
The text was updated successfully, but these errors were encountered: