Advertisement Jump to content

Archived

This topic is now archived and is closed to further replies.

Squirell

Linking in Dev C++

This topic is 5485 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 know this is a probably a retarded question but how do you put two files together in DevC++. For example if under a project i have main.cpp and game.cpp how do i use functions from game.

Share this post


Link to post
Share on other sites
Advertisement
I don't understand your question. Do you want to use functions from Game in Main?

Have you created header (.h) files with the function prototypes and included them in each file?

eg:


(game.h)

// function declaration

int game_func( void );

(Game.Cpp)
#include "game.h"

int game_func( void )
{
// do stuff here, this is the actual function

return 0;
}

(Main.cpp)

#include "game.h"

int main()
{

game_func();

return 0;
}





[edited by - downgraded on January 14, 2004 4:52:32 PM]

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!