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!


more help needed...


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
3 replies to this topic

#1 Crusable   Members   -  Reputation: 594

Like
0Likes
Like

Posted 21 October 2012 - 10:55 PM

I really feel like a fool posting again on the forums about my ridiculous SDL problems. But it just pisses me off when my programs don't work and i cannot fix them. I got all the issues worked out with the past problems, however i dove into a new one. I am still working on lazy foo's tutorial, however things are getting messy, so i decided to use a more Object oriented approach to this. now i think that the reason my other problems occurred were because i never though about it and just winged it. So i sat down and make a plan. I got it all done and when i compiled, i got this stupid message:

1>------ Build started: Project: Space Game, Configuration: Debug Win32 ------
1> Game.cpp
1> Generating Code...
1> Compiling...
1> main.cpp
1> Generating Code...
1>main.obj : error LNK2005: "void __cdecl apply_surface(int,int,struct SDL_Surface *,struct SDL_Surface *)" (?apply_surface@@YAXHHPAUSDL_Surface@@0@Z) already defined in Game.obj
1>main.obj : error LNK2005: "struct SDL_Surface * __cdecl load_image(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >)" (?load_image@@YAPAUSDL_Surface@@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z) already defined in Game.obj
1>C:\Users\Mathew\Documents\Visual Studio 2010\Projects\Space Game\Debug\Space Game.exe : fatal error LNK1169: one or more multiply defined symbols found
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

Before i go any further i would like to say sorry for the lack of formatting the code and message, I have tried to o it in recent posts but it never worked. But, if im reading this right, its saying that the apply_surface is already somewhere else. But it isn't. I will link the project so i don't have to write all the code out, but i originally had two separate files for the Load_Image and Apply_Surface functions, but i got this message. so i put them all in the game.cpp file, and still got the message, the into he game.cpp. and that is where i am now. I was thinking i could add this to the class, but this is one of the problems i was having with the debug log, so i don't know how i would go about doing it. Again, if im reading this message right, then that wouldn't fix my problem.

all help is much appreciated.

Sponsor:

#2 Crusable   Members   -  Reputation: 594

Like
0Likes
Like

Posted 21 October 2012 - 11:01 PM

Im having trouble editing my posts and linking my project, is there something wrong with gamedev.net?

Attached Files



#3 Crusable   Members   -  Reputation: 594

Like
0Likes
Like

Posted 21 October 2012 - 11:03 PM

See, the project was linked, but it never showed.

#4 Crusable   Members   -  Reputation: 594

Like
0Likes
Like

Posted 22 October 2012 - 06:21 AM

Nevermind, i played around with the code and i put the apply_Surface and Load_Image into my class and it worked.




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