Sign in to follow this  

Porting to windoze

This topic is 3865 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

I recently recruited some people for my project, http://palodequeso.geektyme.org, but unlike the rest of the world, I develop in linux. I chose to use SDL, opengl, and a few other libs and have it all working well in linux. All of the libs I use also have windows counterparts. I set up a basic project with just sdl and opengl and it compiled just fine. But when I added my source to the project and the extra depends, I quickly ran into some trouble. I had to modify a lot of code but that compiles without error now. But my biggest problem are linker errors. I had run into this before using various libraries but thsi time I'm completely stumped. Under additional dependencies in vc8 express I added: SDL.lib SDLmain.lib opengl32.lib glu32.lib glut32.lib glew32.lib SDL_image.lib SDL_ttf.lib libxml2.lib libbulletdynamics_d.lib libbulletcollision_d.lib libbulletmath_d.lib fmodexL_vc.lib FColladaD.lib iconv.lib and I added the appropriate directories for the includes (obviously because it compiled) and the libraries (which is also working because I had a simple app running using the SDL.lib SDLmain.lib opengl32.lib glu32.lib libraries. The linker errors are as follows, and they're pretty non-descript:
1>Model.obj : error LNK2019: unresolved external symbol "public: bool __thiscall FCDocument::LoadFromFile(class std::basic_string<wchar_t,struct std::char_traits<wchar_t>,class std::allocator<wchar_t> > const &)" (?LoadFromFile@FCDocument@@QAE_NABV?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@@Z) referenced in function "public: int __thiscall GRAPHICS::Model::Load(class std::basic_string<wchar_t,struct std::char_traits<wchar_t>,class std::allocator<wchar_t> >)" (?Load@Model@GRAPHICS@@QAEHV?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@@Z)
1>RenderingInterface.obj : error LNK2019: unresolved external symbol "public: __thiscall btCapsuleShape::btCapsuleShape(float,float)" (??0btCapsuleShape@@QAE@MM@Z) referenced in function "public: void __thiscall GRAPHICS::RenderingInterface::AddObject(class ENTITY::Object *)" (?AddObject@RenderingInterface@GRAPHICS@@QAEXPAVObject@ENTITY@@@Z)
1>SDLmain.lib(SDL_win32_main.obj) : error LNK2019: unresolved external symbol _SDL_main referenced in function _main
1>..\runtime\debug\engine_vc8.exe : fatal error LNK1120: 3 unresolved externals

any suggestions are welcome, as well as any requests for more information, thanks in advance.

Share this post


Link to post
Share on other sites
Translated:

Model.obj defines function "int GRAPHICS::Model::Load(const std::wstring&)",
which calls "bool FCDocument::LoadFromFile(const std::wstring&)", which is not
found.

RenderingInterface.obj defines function "void
GRAPHICS::RenderingInterface::AddObject(ENTITY::Object*)", which calls
"btCapsuleShape::btCapsuleShape(float, float)", which is not found.

SDLmain.lib(SDL_win32_main.obj) defines function "_main", which calls
"_SDL_main", which is not found.


The error messages mention plenty of your own project's classes/functions in addition to _sdl_main(). Are you sure you can currently build it *from scratch* on Linux as well?

(For the one that does deal with SDL: I think you're supposed to rename your project's main() function accordingly as _SDL_main(); the Windows version of the library provides the entry point for you and calls your "main" from within there, so that it can set things up ahead of time. ICBW though; I've never actually used that stuff.)

Share this post


Link to post
Share on other sites
Quote:
Original post by Zahlman
Translated:
(For the one that does deal with SDL: I think you're supposed to rename your project's main() function accordingly as _SDL_main(); the Windows version of the library provides the entry point for you and calls your "main" from within there, so that it can set things up ahead of time. ICBW though; I've never actually used that stuff.)


No you're not. The reason this is happening is you must have your main function defined like this:


int main(int argc, char **argv)



As has been mentioned your other errors look like you just forgot to add FCDocument.cpp and btCapsuleShape.cpp to your new project (or which ever cpp files you have those classes defined in).

Alan

Share this post


Link to post
Share on other sites
interestingly enough when I had started this project, I hadn't made it customary to use int argc, char **argv, however I do now, thanks for the heads up, unfortunately I'm not at that box yet but the error makes sense.

Share this post


Link to post
Share on other sites

This topic is 3865 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