error LNK2019: unresolved external symbol _function_new referenced in function ....
now, in cpp file, of course that I have the body of this function, but is not recognized at all ... if this body function is written in cpp, or if I would delete the body of this function, the error is exactly the same ... strange, no ?
What could be the problem here, I am struggle to solve this error for days ...
1. You did not link the object file containing the implementation to your program.
Check your build options to make sure it's there.
2. The declaration in your header does not match your implementation.
Make sure there is no typo, the argument type and number matches, and ...
3. ... that it's compiled as C code. You mentioned a cpp file: if your compiler deducts how to compile a file by it's suffix, it may have compiled a C++ instead of a C function! In that case the linker won't find it. You could check your compiler's documentation for an option to force compilation as C. Alternately, just to find out you're on the right track, try removing 'extern "C"' in your header to find out whether that's actually the cause.
P.S.: Here's a good site pointing out all the details you need to watch out for when mixing C++ and C: How to mix C and C++[^]
GOTOs are a bit like wire coat hangers: they tend to breed in the darkness, such that where there once were few, eventually there are many, and the program's architecture collapses beneath them. (Fran Poretto)
What could be the cause where a pdb files is not generated ? It is a warning generated by a VS2008 compiler used in command line mode ... Why others .pdb files is generated and this one (utils.pdb) are not ?
warning LNK4099: PDB 'utils.pdb' was not found with '.\..\..\retail\some.lib'or at 'D:\.....\retail\utils.pdb'; linking object as if no debug info
The warning from above I had taken from build logs, but I don't know where I could find the project settings, I use compiler in command line mode ... I don't have any GUI for this environment ... hmm ..
Sorry, but we have no idea what your setup looks like so it is impossible to guess how things have been set up. If you use the Visual Studio IDE then project settings will be in a file called <project_name>.vcxproj or some similar extension. You need to provide some more details of how your project is setup and what commands you run to build it.
Okay so my laptop has about 2.5 years of accumulated debris on it: VS2008, VS2015, VS Code (gone now). I have a project that contains multiple activeX controls for Windows Embedded Compact 7. I need to modify these for an update I need to get out. Go to control A - view resources - it expands to show me: Bitmap, Dialog, Icon, ... etc. Go to control B - view resources - burps with the error:
"C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\ce\atlmfc\incdue\winres.h(33)
fatal error RC1015: cannot open include file 'winresrc.h"
Now here's the weird part - they compile fine. So VS2008 can find it when it wants too.
If I compare the two project files, I can see no differences (other than the filenames). I do have the files it is looking for, so it isn't that. In a fit of inspiration, I fired up a Windows 10 VM I have that is "newer" than the base iron. VS2008 running from there opens the resource views fine - same project files accessed over a shared folder.
I'm at a complete loss. Any ideas? Most of my google fu points me to defunct microsoft forums, but most of the hits have to do with compile time issues.
<italic>Stuck in a dysfunctional matrix from which I must escape...
"Where liberty dwells, there is my country." B. Franklin, 1783
“They who can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety.” BF, 1759
Take a look at Project Properties -> General -> Windows SDK Version. It may be that your project needs to be re-targeted to a specific version as shown in the drop down in the right pane (yes Microsoft, a right pain).