Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


Dev C++ wont link .rc file

horus79horus79 Member Posts: 2
Hello i'm new to programming

i am trying to learn how to display a bitmap on a window using the GDI.

i couldn't find any decent tutorials with code that worked on the net.
so i decided to strip down the winAnim example that shipped with Dev C++ V untill all it did was display a bitmap. After i successfully did this i then decided to write one myself using the pre generated code that Dev C++ outputs when you create a new windows project. my code all compiles without any errors or warnings but it displays no picture.
when i compare my project to the stripped down winAnim project the only difference that i can spot is that in the project optionsfiles tab the WinAnim has a tick next to the include in linking when you select the .rc file.
And in my project that option is greyed out.

if any one can help me this would be great


  • LundinLundin Member Posts: 3,711
    Although I'm no Dev expert, it sounds strange. You usually just add the .rc and then it adds it to the files to be linked and everything works automagically - the IDE creates a .res file for you. Did you try to make a new project?
  • horus79horus79 Member Posts: 2
    i have found a solution to my problem but it leaves me even more confused than i was before.
    if i mess around with project optionsparameters and add a file then compile i get errors but after i remove the file it will display the bitmap where before it wouldn't. i have on separate occasions added the .o file and my .rc file and both worked using the above technique. So far this solution seems completely random to me.
    but at least i can display a bitmap.
    thanks for your reply but if any one can explain to me what is going on i would still be grateful to hear it.

  • CameronPhorCameronPhor Member Posts: 1
    I had a problem using .rc flies in dev c++ for a while untill i learned why it wasn't working for me.

    When you create a new project with a standard windows template in devc++
    then create a new .rc file in the project. what happens is it creates the _private file in the same directory which points to the .rc file.

    The problem comes along when you create the file .rc file it creates it as "Untitled-1.rc" or something like that , and then creates the _private.rc in the same directory that points to "Untitled-1.rc".

    Now if you rename your .rc file to something else it doesn't seem to update the _private.rc . So when you compile it tries to compile the "Untitled-1.rc" file into the program and the renamed file is completely ignored.

    [u]Solution[/u]: If this is your problem . You can either create a resource file into your project and leave it with the default name. Or create a .rc file outside of the project with the name you want then add it to the project.
    This should work. It worked for me . Hoped this helped someone.
Sign In or Register to comment.