Like Tree1Likes
  • 1 Post By whiteflags

Dev C++ Dependency Dropped

This is a discussion on Dev C++ Dependency Dropped within the C Programming forums, part of the General Programming Boards category; Dear all, When use Dev C++ for writing C and compile, there is so called dependency dropped. Do you know ...

  1. #1
    Registered User kw42chan's Avatar
    Join Date
    Jan 2013
    Location
    Hong Kong, China
    Posts
    18

    Dev C++ Dependency Dropped

    Dear all,

    When use Dev C++ for writing C and compile, there is so called dependency dropped.

    Do you know why there is the reason and how to solve, use other compiler??

    Code:
    #include <stdio.h>main()
    {
     int x;
     char cArray[5];
     char cName[] = "Olivia";
     printf("\nCharacter array not initialized:\n");
     for ( x = 0; x < 5; x++ )
     printf("Element %d's contents are %d\n", x, cArray[x]);
    
    
     printf("\nInitialized character array:\n");
     for ( x = 0; x < 6; x++ )
     printf("%c", cName[x]);
    } //end main
    Attached Images Attached Images  

  2. #2
    and the hat of wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,548
    Dev-c++ is an old, buggy and unmaintained IDE.
    Basically, the IDE decided to ........ on it's own makefile.

    Try this, which is newer, possibly less buggy, and maintained.
    Orwell Dev-C++ | Free Development software downloads at SourceForge.net
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

  3. #3
    Registered User kw42chan's Avatar
    Join Date
    Jan 2013
    Location
    Hong Kong, China
    Posts
    18
    Quote Originally Posted by Salem View Post
    Dev-c++ is an old, buggy and unmaintained IDE.
    Basically, the IDE decided to ........ on it's own makefile.

    Try this, which is newer, possibly less buggy, and maintained.
    Orwell Dev-C++ | Free Development software downloads at SourceForge.net
    Thanks, I would try it!

  4. #4
    Registered User kw42chan's Avatar
    Join Date
    Jan 2013
    Location
    Hong Kong, China
    Posts
    18
    Quote Originally Posted by Salem View Post
    Dev-c++ is an old, buggy and unmaintained IDE.
    Basically, the IDE decided to ........ on it's own makefile.

    Try this, which is newer, possibly less buggy, and maintained.
    Orwell Dev-C++ | Free Development software downloads at SourceForge.net
    Dear

    the problem still exist. can anyone help? any syntax error?

    Name:  Initiation of array_20130105.jpg
Views: 2411
Size:  96.7 KB
    Attached Images Attached Images  
    Last edited by kw42chan; 01-05-2013 at 02:58 AM. Reason: upload wrong picture

  5. #5
    Registered User
    Join Date
    May 2009
    Posts
    2,577
    Did you try naming the file with the normal extension of ".c" or ".cpp"?

    Edit: Many IDEs use the file extension to decide how to treat the file.
    The GUI image shows a file with no file extension on it.

    Tim S.
    "Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the universe trying to produce bigger and better idiots. So far, the Universe is winning." Rick Cook

  6. #6
    Registered User kw42chan's Avatar
    Join Date
    Jan 2013
    Location
    Hong Kong, China
    Posts
    18
    Quote Originally Posted by stahta01 View Post
    Did you try naming the file with the normal extension of ".c" or ".cpp"?

    Edit: Many IDEs use the file extension to decide how to treat the file.
    The GUI image shows a file with no file extension on it.

    Tim S.
    I try to rename the file with cpp extension name, however the problem still exist

    Name:  Initiation of array_20130105.jpg
Views: 551
Size:  85.9 KB

  7. #7
    Programming Wraith GReaper's Avatar
    Join Date
    Apr 2009
    Location
    Greece
    Posts
    1,625
    Do you use an automatic makefile or your own?
    Devoted my life to programming...

  8. #8
    Registered User kw42chan's Avatar
    Join Date
    Jan 2013
    Location
    Hong Kong, China
    Posts
    18
    Quote Originally Posted by GReaper View Post
    Do you use an automatic makefile or your own?
    I just make the file on my own, by the way, how to use automatic makefile as i m new to programming

  9. #9
    Registered User
    Join Date
    Jan 2013
    Posts
    24
    Code:
    #include<stdio.h>
    
    int main(void)
    {
       int x;
       char cArray[5];
       char cName[] = "Olivia";
       
       printf("Character array not initialized:\n");
    
    
       for(x = 0; x < 5; ++x)
       {
          printf("Element %d contents are %c\n", x, cArray[x]);
          printf("Initialized character array:\n");
       }
       
       for(x = 0; cName[x] != '\0'; ++x)
       {
          printf("%c", cName[x]);
       }
       getchar();
       return 0;
    }
    I dont believe this is what your looking for but eh. will work. btw name it with .c extension and not .cpp since it is c code and not c++. hope you can figure out the other three mistakes in this.
    Last edited by jamesedmonds; 01-05-2013 at 09:46 AM.

  10. #10
    Registered User whiteflags's Avatar
    Join Date
    Apr 2006
    Location
    United States
    Posts
    7,706
    Quote Originally Posted by kw42chan View Post
    I just make the file on my own, by the way, how to use automatic makefile as i m new to programming
    I don't think you understand the question being asked. First of all, look at this example makefile:

    Code:
    # Project: Project1
    # Makefile created by Dev-C++ 5.3.0.4
    
    CPP      = g++.exe
    CC       = gcc.exe
    WINDRES  = windres.exe
    OBJ      = Untitled2.o $(RES)
    LINKOBJ  = Untitled2.o $(RES)
    LIBS     = -L"C:/Users/Josh2/Downloads/Dev-Cpp/MinGW32/lib" -static-libstdc++ -static-libgcc
    INCS     = -I"C:/Users/Josh2/Downloads/Dev-Cpp/MinGW32/include"
    CXXINCS  = -I"C:/Users/Josh2/Downloads/Dev-Cpp/MinGW32/include"
    BIN      = Project1.exe
    CXXFLAGS = $(CXXINCS)  -ansi -w -Wall -Wextra -pedantic
    CFLAGS   = $(INCS)  -ansi -w -Wall -Wextra -pedantic
    RM       = rm -f
    
    .PHONY: all all-before all-after clean clean-custom
    
    all: all-before $(BIN) all-after
    
    
    clean: clean-custom
    	${RM} $(OBJ) $(BIN)
    
    $(BIN): $(OBJ)
    	$(CPP) $(LINKOBJ) -o $(BIN) $(LIBS)
    
    Untitled2.o: Untitled2.c
    	$(CPP) -c Untitled2.c -o Untitled2.o $(CXXFLAGS)
    Just so you know, this is probably not going to work on anyone else's computer, so don't use it.

    This is input for a program called "make", which is a part of the IDE, responsible for managing the other programs that create or destroy executeables. An "automatic makefile" is the makefile that the IDE will create, unless you provide an alternate. Unless you clicked on Project Properties and provided the location of your makefile, you did not provide an alternate. I'm guessing that you did not write your own makefile, as an inexperienced person wouldn't know where to begin, and Makefile.win is the name Dev-C++ gives its automatic makefile.

    So with that misunderstanding cleared up, please give the full text of the linker error you are getting now. Since it comes from the Exercise2 file, I want to see that too.

    I have my guesses about what is going on, but I just want to see what's in there first. Whatever is in there isn't being used. So the ultimate solution might be to remove all of the files in the project except for the main that you want to compile.
    Last edited by whiteflags; 01-05-2013 at 09:58 AM.
    stahta01 likes this.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. First word dropped off of string.
    By Arborius in forum C++ Programming
    Replies: 8
    Last Post: 09-07-2008, 10:57 PM
  2. Circular main <- main.o dependency dropped.
    By Queatrix in forum C++ Programming
    Replies: 4
    Last Post: 10-21-2005, 02:32 PM
  3. Replies: 3
    Last Post: 08-31-2005, 12:41 PM
  4. packets dropped by kernel?
    By threahdead in forum C Programming
    Replies: 2
    Last Post: 01-26-2003, 06:44 AM
  5. Post count dropped!
    By mithrandir in forum A Brief History of Cprogramming.com
    Replies: 21
    Last Post: 10-04-2001, 05:28 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21