Visual C++ 6 Problem

This is a discussion on Visual C++ 6 Problem within the C++ Programming forums, part of the General Programming Boards category; Yes, it's me again with another strange problem. After switching from the Debug to Release configuration, my build started throwing ...

  1. #1
    Budding Synth Programmer samGwilliam's Avatar
    Join Date
    Feb 2002
    Location
    Trefforest
    Posts
    368

    Visual C++ 6 Problem

    Yes, it's me again with another strange problem.

    After switching from the Debug to Release configuration, my build started throwing up an error (it always built under Debug) - an unresolved external symbol (a function, in this case).

    After some detective work, I whittled down the cause to an optimisation - regarding inline functions.

    The offending function was indeed an inline one, and making it out-of-line removed the problem.

    But why should this error occur in the first place? Why the trouble with inline functions?

  2. #2
    (?<!re)tired Mario F.'s Avatar
    Join Date
    May 2006
    Location
    Portugal
    Posts
    7,383
    I seem to remember reading on these forums before something about inline functions, visual c++ 6.0 and a the latest patch being needed. Just in case, you have the latest patch?

    You may also avoid the error without changing your code if you change your optimization settings for inline functions. If the code is meant to be compiled on other compilers and you are sure of the advantages of keeping the function inline, this may be your best option.

    However, I don't know why you are getting this error.
    The programmer’s wife tells him: “Run to the store and pick up a loaf of bread. If they have eggs, get a dozen.”
    The programmer comes home with 12 loaves of bread.


    Originally Posted by brewbuck:
    Reimplementing a large system in another language to get a 25% performance boost is nonsense. It would be cheaper to just get a computer which is 25% faster.

  3. #3
    CSharpener vart's Avatar
    Join Date
    Oct 2006
    Location
    Rishon LeZion, Israel
    Posts
    6,424
    is your inline function body located in the header?
    The first 90% of a project takes 90% of the time,
    the last 10% takes the other 90% of the time.

  4. #4
    Budding Synth Programmer samGwilliam's Avatar
    Join Date
    Feb 2002
    Location
    Trefforest
    Posts
    368
    Quote Originally Posted by vart
    is your inline function body located in the header?
    No. Should it be?

    I thought you just followed the same conventions as an out-of-line one...

  5. #5
    Its hard... But im here swgh's Avatar
    Join Date
    Apr 2005
    Location
    England
    Posts
    1,475
    No it shouldn't. Vart was just asking in case it was. Headers should only include function prototypes and definitions, not their implementations.
    I'm just trying to be a better person - My Name Is Earl

  6. #6
    CSharpener vart's Avatar
    Join Date
    Oct 2006
    Location
    Rishon LeZion, Israel
    Posts
    6,424
    Quote Originally Posted by swgh
    No it shouldn't. Vart was just asking in case it was. Headers should only include function prototypes and definitions, not their implementations.
    Some compilers cannot find inline functions, if the body is not present in the header file
    The first 90% of a project takes 90% of the time,
    the last 10% takes the other 90% of the time.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Visual studio.net C++ Problem
    By Dina in forum C Programming
    Replies: 5
    Last Post: 07-19-2008, 02:34 PM
  2. Visual C++ Tool Problem
    By wolfban in forum Tech Board
    Replies: 2
    Last Post: 07-23-2005, 07:41 PM
  3. errors in my class....
    By o0obruceleeo0o in forum C++ Programming
    Replies: 9
    Last Post: 04-14-2003, 03:22 AM
  4. Visual Basic Adodc Problem
    By rahat in forum Windows Programming
    Replies: 1
    Last Post: 01-20-2002, 05:55 AM
  5. Microsoft Visual C++ compiler, cast problem?
    By jonnie75 in forum C Programming
    Replies: 5
    Last Post: 11-10-2001, 07:53 AM

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