This comes as a surprise. I have a C++ project in which the code has been split across several folders. I have two .CPP files of the same name (utility.cpp) in two different folders. The content in the files is not the same. Different symbols defined in each. Sounds like this should work without a hitch, right?
I'm not yet sure of this but it looks like there is no straightforward way to do this in VS2008. Both files are compiled to the same output folder. It looks like the compiler (cl.exe) compiles both .CPP files to the same .OBJ file. So, the last compiled .CPP wins. By the time the linker (linker.exe) reaches the scene, only the symbols defined in the last compiled .CPP are available and the linker fails giving you "LNK2028: unresolved token".
I looked at VS2008 options to see if there was a way to include the relative path of the source file as part of the compiler's output file path, but so far I have not been successful.
Here's the related post on stackoverflow.com.
Subscribe to:
Post Comments (Atom)
About Me
- Agnel CJ Kurian
- C/C++ Programmer doing CAD on Windows. Some web development experience. Bangalorean.
Blog Archive
Labels
- .net (11)
- advocacy (1)
- apache (2)
- code (1)
- direct3d (1)
- drawing (1)
- geometry (1)
- graphics (1)
- humour (1)
- javascript (1)
- links (1)
- microsoft (1)
- morons (1)
- postgresql (1)
- programming (4)
- python (1)
- rant (5)
- software (1)
- subversion (2)
- svn (1)
- tools (11)
- trac (1)
- truecrypt (1)
- typing (1)
- vc++ (14)
- video (1)
- vs2008 (1)
- windows-forms (1)
- windows7 (1)
No comments:
Post a Comment