dev c++

This is a discussion on dev c++ within the C++ Programming forums, part of the General Programming Boards category; alright first of all I know next to nothing about programming but I'm trying here. I've been writting some code ...

  1. #1
    Registered User
    Join Date
    Nov 2005
    Posts
    3

    dev c++

    alright first of all I know next to nothing about programming but I'm trying here. I've been writting some code using this graphics program called ccc_win.h and it requires me to use two other programs called ccc_msw.cpp and ccc_shap.cpp. I've made a lot of other programs and have found dev cpp the most user friendly. However, when I try to compile projects these graphic projects on it I get a bunch of linker errors. 2 questions:

    1. what is a linker error and what can I do about them

    2. anyone know why it works in borland but not in dev.

    Anyway this my first post so be nice to me

    Thanks a lot anybody

  2. #2
    Super Moderator
    Join Date
    Sep 2001
    Posts
    4,913
    To answer those questions we need to see the specific error messages and possibly even the source. Linker errors are problems that occur when Dev-C++ is trying to combine your code with the code in the standard library and other libraries that you use.

  3. #3
    Registered User
    Join Date
    Nov 2005
    Posts
    3

    you guys are fast

    alright here we go.
    most of the errors (about 20 of em) are like this:

    " [Linker error] undefined reference to `DeleteObject@4' "

    then there is one of these at the end:

    "ld returned 1 exit status"

    and this at the very bottom:
    C:\Dev-Cpp\Makefile.win [Build Error] [rectangle1.exe] Error 1

    I would give you guys the code but's a lot of stuff I could probably work with some general hints

  4. #4
    Registered User
    Join Date
    Nov 2005
    Posts
    3
    oh yes and I'm only using standard library as far as I'm concerned. Is it maybe a problem that there are already objects with the same name I'm using. Is that what your saying when you say combining with my same standard library stuff.

  5. #5
    and the hat of wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,417
    > ccc_win.h and it requires me to use two other programs called ccc_msw.cpp and ccc_shap.cpp
    Did you put the two .cpp files into your project - along side your prog.cpp file containing your code?

  6. #6
    Registered User
    Join Date
    Jun 2005
    Posts
    6,157
    Quote Originally Posted by da1nownlee
    " [Linker error] undefined reference to `DeleteObject@4' "
    This means that an attempt has been made to call a function (or, possibly, access a global variable) named "DeleteObject@4" and the linker can't find it in any of the object files or libraries being linked. As you're working with C++, "DeleteObject@4" is probably the mangled name of a function being called from your code. It is a fair bet that the actual name not being resolved includes the string "DeleteObject". If your code defines this name (eg provides the body for a function named DeleteObject), then you need to ensure that the corresponding object file is included in the link stage.

    You said this code builds with borland but not with dev-c++. That might mean that you are using a Borland-specific function in your code. It might also mean that there is an error in the way you have specified how the program should be built by dev-c++.
    Quote Originally Posted by da1nownlee
    then there is one of these at the end:

    "ld returned 1 exit status"
    ld is the name of the program invoked to actually do the linking. This message is simply reporting the exit status from the linker. A non-zero exit status means an error has occurred, which you already knew from the preceding messages about undefined references.

    Quote Originally Posted by da1nownlee
    and this at the very bottom:
    C:\Dev-Cpp\Makefile.win [Build Error] [rectangle1.exe] Error 1
    OK; a file named Makefile.win is being used (by a program named make, probably) to compile your code and link the resultant object files. This line simply means that an error has occurred building something called rectangle1.exe. The preceding reports of undefined references and the exit status from the linker are probably the cause. The reason you get told the same thing in multiple ways is that make invokes the compiler, the linker, and various other programs. In this case the linker is reporting errors and also returning an error status. make detects that error status, and tells you it failed to build.

    The cause may be in your code or in the way Makefile.win tells the linker to link your program (eg what object files and libraries are linked, and in what order).
    Last edited by grumpy; 11-27-2005 at 01:48 AM.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Whats better, C-Free or Dev C++??
    By i_can_do_this in forum Tech Board
    Replies: 10
    Last Post: 07-07-2006, 04:34 AM
  2. Resources with Dev C++ Problem (many simple problems)
    By Zeusbwr in forum Windows Programming
    Replies: 4
    Last Post: 04-06-2005, 11:08 PM
  3. New to Dev C++/<windows.h>...
    By Cilius in forum C++ Programming
    Replies: 3
    Last Post: 02-23-2005, 12:05 AM
  4. Glut and Dev C++, Programs not Quitting?
    By Zeusbwr in forum Game Programming
    Replies: 13
    Last Post: 11-29-2004, 07:43 PM
  5. Tutorial about Bloodshed Dev!
    By Unregistered in forum C++ Programming
    Replies: 2
    Last Post: 11-13-2001, 06:42 PM

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