Sign in to follow this  

How to use lib3ds at vs2005

This topic is 3456 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi there, I tried to use lib3ds at vs2005 which run at vista system. I add the lib3ds files dir(lib3ds-1.3.0\lib3ds) to vs2005 "include dir", and I also set up the SDL. Then I create a new project on vs2005, and add the example(3dsplay.c) of lib3ds to that project. When I build the project, I got the following link error. So how to set up lib3ds at vs2005 on windows? Thank you all! //=============================error============================================ Linking... start.obj : error LNK2019: unresolved external symbol __imp__lib3ds_file_eval referenced in function "void __cdecl timer_cb(int)" (?timer_cb@@YAXH@Z) start.obj : error LNK2019: unresolved external symbol __imp__lib3ds_file_free referenced in function "void __cdecl load_model(void)" (?load_model@@YAXXZ) start.obj : error LNK2019: unresolved external symbol __imp__lib3ds_file_insert_light referenced in function "void __cdecl load_model(void)" (?load_model@@YAXXZ) start.obj : error LNK2019: unresolved external symbol __imp__lib3ds_light_new referenced in function "void __cdecl load_model(void)" (?load_model@@YAXXZ) start.obj : error LNK2019: unresolved external symbol __imp__lib3ds_file_insert_camera referenced in function "void __cdecl load_model(void)" (?load_model@@YAXXZ) start.obj : error LNK2019: unresolved external symbol __imp__lib3ds_camera_new referenced in function "void __cdecl load_model(void)" (?load_model@@YAXXZ) start.obj : error LNK2019: unresolved external symbol __imp__lib3ds_file_bounding_box_of_nodes referenced in function "void __cdecl load_model(void)" (?load_model@@YAXXZ) start.obj : error LNK2019: unresolved external symbol __imp__lib3ds_file_insert_node referenced in function "void __cdecl load_model(void)" (?load_model@@YAXXZ) start.obj : error LNK2019: unresolved external symbol __imp__lib3ds_node_new_object referenced in function "void __cdecl load_model(void)" (?load_model@@YAXXZ) start.obj : error LNK2019: unresolved external symbol __imp__lib3ds_file_load referenced in function "void __cdecl load_model(void)" (?load_model@@YAXXZ) start.obj : error LNK2019: unresolved external symbol __imp__lib3ds_matrix_inv referenced in function "void __cdecl display(void)" (?display@@YAXXZ) start.obj : error LNK2019: unresolved external symbol __imp__lib3ds_matrix_camera referenced in function "void __cdecl display(void)" (?display@@YAXXZ) start.obj : error LNK2019: unresolved external symbol __imp__lib3ds_vector_length referenced in function "void __cdecl display(void)" (?display@@YAXXZ) start.obj : error LNK2019: unresolved external symbol __imp__lib3ds_vector_sub referenced in function "void __cdecl display(void)" (?display@@YAXXZ) start.obj : error LNK2019: unresolved external symbol __imp__lib3ds_file_camera_by_name referenced in function "void __cdecl display(void)" (?display@@YAXXZ) start.obj : error LNK2019: unresolved external symbol __imp__lib3ds_file_node_by_name referenced in function "void __cdecl display(void)" (?display@@YAXXZ) start.obj : error LNK2019: unresolved external symbol __imp__lib3ds_file_material_by_name referenced in function "void __cdecl render_node(struct Lib3dsNode *)" (?render_node@@YAXPAULib3dsNode@@@Z) start.obj : error LNK2019: unresolved external symbol __imp__lib3ds_mesh_calculate_normals referenced in function "void __cdecl render_node(struct Lib3dsNode *)" (?render_node@@YAXPAULib3dsNode@@@Z) start.obj : error LNK2019: unresolved external symbol __imp__lib3ds_matrix_copy referenced in function "void __cdecl render_node(struct Lib3dsNode *)" (?render_node@@YAXPAULib3dsNode@@@Z) start.obj : error LNK2019: unresolved external symbol __imp__lib3ds_file_mesh_by_name referenced in function "void __cdecl render_node(struct Lib3dsNode *)" (?render_node@@YAXPAULib3dsNode@@@Z) C:\Users\charles\Documents\Visual Studio 2005\Projects\Country_Road_Race\Debug\Country_Road_Race.exe : fatal error LNK1120: 20 unresolved externals Build log was saved at "file://c:\Users\charles\Documents\Visual Studio 2005\Projects\Country_Road_Race\Country_Road_Race\Debug\BuildLog.htm" Country_Road_Race - 21 error(s), 8 warning(s) ========== Rebuild All: 0 succeeded, 1 failed, 0 skipped ==========

Share this post


Link to post
Share on other sites
Hi Daaark,

The problem is I don't know how to make a library in windows. I just download the source code from lib3ds. And the "makefile" file cannot work, or I don't know how to let them work in windows sys.

So do I need the make the library in Linux? Can you tell me how to do it?

Thank you!

Share this post


Link to post
Share on other sites
In VS2005 create a new empty Win32 DLL project, add the source files of the library to the project, adjust your directories in the project properties if necessary, now build. A dll and lib file will be generated, you need to link with the library and include the dll with your executable.

If you compile the library using GCC (the linux c++ compiler) then you would not be able to use the file with VS2005 due to incompatible library formats.

Share this post


Link to post
Share on other sites
Thank you so much TheGilb! You help me a lot. With your direction, I get the .dll and the .lib files.

But I still have one problem, because I just use C++ for 3 weeks, there are lots of things that I don't know.

I changed the "additional library dir" at "project property/linker/general" to link the lib3ds.lib . And copy the lib3ds.dll file to my currect project's root dir.

I also changed "additional include dir" at "project property/ c/c++ /general" to link the dir which containd all the .h and .c files in lib3ds source code folder.

Then when I rebuild the project, vs2005 says that "LINK : fatal error LNK1104: cannot open file 'lib3ds/lib3ds.lib'".

So how can I solve this problem? Maybe I didn't link the dll file. If so, can you tell me how to do that?

Thank you so much!!!

Share this post


Link to post
Share on other sites
Hi, I think I find the solution by my self. I don't know whehter it is the correct way, but it works.

In vs2005, I have two projects. One is "my currect project", the other is "lib3ds", which I use to generate the dll and lib file.

Now in "my currect project", I directly change the "additional lib dir" to the debug dir in "lib3ds" project. That debug dir contains the output of lib3ds project, that are the .dll and .lib files.

And then build "my currect project", and it works.

If there is a better way to link the lib3ds.lib and lib3ds.dll file, please reply to this topic.

Thank all of you who reply this topic and support me!

(Sorry for my poor English!)

Share this post


Link to post
Share on other sites

This topic is 3456 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this