Jump to content

  • Log In with Google      Sign In   
  • Create Account

FREE SOFTWARE GIVEAWAY

We have 4 x Pro Licences (valued at $59 each) for 2d modular animation software Spriter to give away in this Thursday's GDNet Direct email newsletter.


Read more in this forum topic or make sure you're signed up (from the right-hand sidebar on the homepage) and read Thursday's newsletter to get in the running!


lib3ds


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
8 replies to this topic

#1 huymoi7   Members   -  Reputation: 122

Like
0Likes
Like

Posted 19 March 2013 - 11:07 PM

Hi I am trying to load a 3ds model into OpenGL. I did some research and found that lib3ds is a popular solution.

https://code.google.com/p/lib3ds/

I read this tutorial on how to use it, which wasn't too hard

www.donkerdump.nl/node/207

but after downloading the zip folder and unzipping I have no idea how to install it.

 

I've never really installed a library before, is there a generic tutorial on how to do this?

 

I am using code blocks.

 

Is lib3ds is a good solution for this?

 

If so could I get some instructions for installing lib3ds into codeblocks.

 

Cheers.



Sponsor:

#2 wintertime   Members   -  Reputation: 1881

Like
1Likes
Like

Posted 20 March 2013 - 04:50 AM

There is not really much to install for a library. Just put all librarys in a subfolder of some common folder like C:\libs, compile the library if it doesnt come precompiled and then add search paths for preprocessor and linker and the actual librarys to the projects. You can make this a bit easier if you go to settings, global variables in code::blocks and add one with the path you can then reference in all your projects instead of typing in the whole paths everytime.

You can find enough information on that in the codeblocks wiki.


Edited by wintertime, 20 March 2013 - 04:51 AM.


#3 huymoi7   Members   -  Reputation: 122

Like
1Likes
Like

Posted 20 March 2013 - 06:28 AM

There is no .dll files or .lib files (just .h, .cpp and some make files). So does that mean I do not link anything?

 

I redirected my compiler in code blocks to the folder with the lib3ds h files (settings->compiler->search directories tab).

 

Here is a picture of my problem.

 

 

20702231.jpg
 
 
  • It detects the included header file <lib3ds.h>

  • It understands the type Lib3dsFile from <lib3ds.h> 

  • but I can't get it to understand the function 'lib3ds_file_open'. It gives me an "undefined reference to 'lib3ds_file_open' error.

 

but when I hover my mouse over the function it displays the function prototype (as seen in the .h file), I also went to the included .h file for <lib3ds.h> and checked that the function is there (which it is).

 

Why can I detect the lib3ds.h file, read in a struct from it, but fail to find a reference to the lib3ds_file_open function?


Edited by huymoi7, 20 March 2013 - 06:30 AM.


#4 KnolanCross   Members   -  Reputation: 1364

Like
0Likes
Like

Posted 20 March 2013 - 08:32 AM

Are you sure there is no lib files? Haven't you downloaded a linux version and there is a so file?

 

This is a linker error, maybe you need to compile from the source?

 

The linker options are here, but without lib files, there isn't much you can do:

Settings > Compiler and Debbuger > linker settings


Currently working on a scene editor for ORX (http://orx-project.org), using kivy (http://kivy.org).


#5 wintertime   Members   -  Reputation: 1881

Like
1Likes
Like

Posted 20 March 2013 - 12:28 PM

I already said if the library does not come precompiled you have to compile the library first. If it doesnt exist you cannot link your project with it.

Look for documentation of the library on how to compile it, typically there is a file called readme or usage! If there are makefiles you are probably supposed to use make with one of them.



#6 huymoi7   Members   -  Reputation: 122

Like
0Likes
Like

Posted 20 March 2013 - 05:27 PM

Hey so the readme file just gave me a link to the website in which to download it but there is a file called "INSTALL", but it gives me instructions on how to compile it in linux and I am working in windows.

 

Is there a way to run make files in windows? Or do I have download it on linux, precompile it there and transfer it to my windows machine?

 

Cheers



#7 kidman171   Members   -  Reputation: 498

Like
1Likes
Like

Posted 20 March 2013 - 06:27 PM

You can compile makefiles on windows with MinGW32-make. Just check in your mingw installation and see if there is a binary called mingw32-make. If so, open a command prompt, cd to the folder with the makefile in it, and run mingw32-make.

#8 huymoi7   Members   -  Reputation: 122

Like
0Likes
Like

Posted 21 March 2013 - 08:05 PM

Alright so I used MSYS to help me compile the library using a ./configure -> make -> make install process.

It gave me some new files in the lib3ds directory, as per below


75903236.png

It appears that each .c file is given a .o and .ol file, there is also two new directories (there is also a .la file). The .deps directory is full .pol files and .libs directory is full of .o files.

Does this look right? There still are no .lib or .dll files.

I linked the Codeblocks compiler (Settings -> Compiler -> Search Directories -> Linker) and set them both to the src folder. It didn't work. I then proceeded to set every folder in lib3ds (i.e. ./lib3ds, ./lib3ds/src, ./lib3ds/src/.libs, ./lib3ds/src/.deps), but still the error says


43500337.png

I feel like I'm so close I'm following instructions as far as I can tell perfectly but it still just won't work. Does the compilation look right? Any suggestions please? Thanks in advance.

Edited by huymoi7, 21 March 2013 - 08:08 PM.


#9 huymoi7   Members   -  Reputation: 122

Like
0Likes
Like

Posted 21 March 2013 - 08:15 PM

Just a hypothesis but, when I've installed other libraries (opengl, glut, sdl) in the past I often have to edit the linker settings via "Build options". i.e.

 

 

63978376.png
 
Could there be something I need to do here (I ask because I know it's specifically a linker problem)? 
 
Lastly here is what my "Search directories" tab looks like (in case it helps)
 

49273218.png
 
 

Edited by huymoi7, 21 March 2013 - 08:16 PM.





Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS