Thread: how do I...

  1. #1
    Registered User lsctt's Avatar
    Join Date
    Jun 2006
    Posts
    30

    Arrow how do I...

    I'm having a problem, For bigger projects I want to be able to have source files link from one another. I'm kind of new to C++ so this may be a dum question.(I just started taking programming methods, thanks to LCC. [A college in oregon]) but is there a way to have source files link together and how?

  2. #2
    Registered User lsctt's Avatar
    Join Date
    Jun 2006
    Posts
    30
    just a note I use a compiler called bloodshed device, It has a project something or other but i don't know how to use it...

  3. #3
    Registered User lsctt's Avatar
    Join Date
    Jun 2006
    Posts
    30
    if any one knows anything please, please let me know this is difficult, if i could link soarce files it would be a big help...

  4. #4
    Registered User
    Join Date
    Jun 2006
    Posts
    8
    Just #include the source files in one main file which you can compile.

    e.g.
    #include <abc.cpp>
    #include <anothersourcefile.cpp>
    etc.

  5. #5
    Lurking whiteflags's Avatar
    Join Date
    Apr 2006
    Location
    United States
    Posts
    9,613
    > #include <anothersourcefile.cpp>
    I don't think that you should include CPP files this way but it is a band aid for your problem. What is probably best is learning how your compiler works, so you can make projects with multiple files and let the linker take care of it when you compile.

    There are places to help you. Google your compiler or read a newsgroup.

  6. #6
    Registered User
    Join Date
    May 2006
    Location
    irc.abstracttech.com
    Posts
    8
    get a new compiler man.

    or buy this computer http://cgi.ebay.com/ws/eBayISAPI.dll...MESE%3AIT&rd=1

  7. #7
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    28,413
    just a note I use a compiler called bloodshed device,
    I havent heard of 'bloodshed device', but are you talking about Bloodshed's Dev-C++ IDE?

    It has a project something or other but i don't know how to use it...
    Create a new project, place your source files in that project. You will also need to have header files, methinks.

    get a new compiler man.
    If lsctt is using Dev-C++ 4.9.9.2, then there probably is no need to. It comes with the MinGW port of GCC 3.4.2, and that compiler is reasonably standards compliant.
    Quote Originally Posted by Bjarne Stroustrup (2000-10-14)
    I get maybe two dozen requests for help with some sort of programming or design problem every day. Most have more sense than to send me hundreds of lines of code. If they do, I ask them to find the smallest example that exhibits the problem and send me that. Mostly, they then find the error themselves. "Finding the smallest program that demonstrates the error" is a powerful debugging tool.
    Look up a C++ Reference and learn How To Ask Questions The Smart Way

  8. #8
    Registered User lsctt's Avatar
    Join Date
    Jun 2006
    Posts
    30

    ...

    Ive used the projects before but it auto adds a make win. file, then it tells me there are errors with the win file. so i have to figure out how to do it with out making a project...

  9. #9
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    28,413
    Ive used the projects before but it auto adds a make win. file, then it tells me there are errors with the win file. so i have to figure out how to do it with out making a project...
    You can do that by abandoning Dev-C++ and running g++ from the command line... but why not use projects properly? Have you ever got a Dev-C++ project to work?
    Quote Originally Posted by Bjarne Stroustrup (2000-10-14)
    I get maybe two dozen requests for help with some sort of programming or design problem every day. Most have more sense than to send me hundreds of lines of code. If they do, I ask them to find the smallest example that exhibits the problem and send me that. Mostly, they then find the error themselves. "Finding the smallest program that demonstrates the error" is a powerful debugging tool.
    Look up a C++ Reference and learn How To Ask Questions The Smart Way

  10. #10
    Registered User lsctt's Avatar
    Join Date
    Jun 2006
    Posts
    30
    no just compiled soarce files...

  11. #11
    Registered User lsctt's Avatar
    Join Date
    Jun 2006
    Posts
    30
    the book came with the hello world project pre-made it even said the make win. files were wrong...

  12. #12
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    28,413
    Well, try this:

    1. File -> New -> Project
    Choose empty project. Ensure "C++ Project" radio button is selected. Choose a suitable name and click Ok.
    Select a location to create the project and its .dev file.

    2. File -> New -> Source File
    Add to project, give it a suitable name. Enter this:
    Code:
    #include <iostream>
    
    int main()
    {
    	std::cout << "Hello world!" << std::endl;
    	std::cin.get();
    }
    3. Compile and run.
    Quote Originally Posted by Bjarne Stroustrup (2000-10-14)
    I get maybe two dozen requests for help with some sort of programming or design problem every day. Most have more sense than to send me hundreds of lines of code. If they do, I ask them to find the smallest example that exhibits the problem and send me that. Mostly, they then find the error themselves. "Finding the smallest program that demonstrates the error" is a powerful debugging tool.
    Look up a C++ Reference and learn How To Ask Questions The Smart Way

  13. #13
    Registered User lsctt's Avatar
    Join Date
    Jun 2006
    Posts
    30
    ok...
    Ive done this before...

  14. #14
    Registered User lsctt's Avatar
    Join Date
    Jun 2006
    Posts
    30
    this is what i Want it to do:

    ask person wich program to jump to.

    jump to it...

    repeat until they quit.

  15. #15
    Registered User lsctt's Avatar
    Join Date
    Jun 2006
    Posts
    30
    I got one of my programs to work but i noticed it goes down the row until it gets to the bottom...

Popular pages Recent additions subscribe to a feed