Using Visual Studio 6 writing a C program and getting errors

--------------------Configuration: StockCharter - Win32 Release--------------------
Compiling...
StdAfx.cpp
C:\Program Files (x86)\Microsoft Visual Studio\VC98\INCLUDE\objbase.h(435) : error C2664: 'memcmp' : cannot convert parameter 1 from 'const struct _GUID *' to 'void *'
        Conversion loses qualifiers
C:\Program Files (x86)\Microsoft Visual Studio\VC98\INCLUDE\objbase.h(459) : error C2664: 'memcmp' : cannot convert parameter 1 from 'const struct _GUID *' to 'void *'
        Conversion loses qualifiers
C:\Program Files (x86)\Microsoft Visual Studio\VC98\INCLUDE\memory.h(68) : error C2733: second C linkage of overloaded function '_memccpy' not allowed
        C:\Program Files (x86)\Microsoft Visual Studio\VC98\INCLUDE\memory.h(68) : see declaration of '_memccpy'
C:\Program Files (x86)\Microsoft Visual Studio\VC98\INCLUDE\memory.h(69) : error C2733: second C linkage of overloaded function 'memchr' not allowed
        C:\Program Files (x86)\Microsoft Visual Studio\VC98\INCLUDE\memory.h(69) : see declaration of 'memchr'
C:\Program Files (x86)\Microsoft Visual Studio\VC98\INCLUDE\memory.h(70) : error C2733: second C linkage of overloaded function '_memicmp' not allowed
        C:\Program Files (x86)\Microsoft Visual Studio\VC98\INCLUDE\memory.h(70) : see declaration of '_memicmp'
C:\Program Files (x86)\Microsoft Visual Studio\VC98\INCLUDE\memory.h(76) : error C2733: second C linkage of overloaded function 'memcmp' not allowed
        C:\Program Files (x86)\Microsoft Visual Studio\VC98\INCLUDE\memory.h(76) : see declaration of 'memcmp'
C:\Program Files (x86)\Microsoft Visual Studio\VC98\INCLUDE\memory.h(77) : error C2733: second C linkage of overloaded function 'memcpy' not allowed
        C:\Program Files (x86)\Microsoft Visual Studio\VC98\INCLUDE\memory.h(77) : see declaration of 'memcpy'
C:\Program Files (x86)\Microsoft Visual Studio\VC98\INCLUDE\memory.h(85) : error C2733: second C linkage of overloaded function 'memccpy' not allowed
        C:\Program Files (x86)\Microsoft Visual Studio\VC98\INCLUDE\memory.h(85) : see declaration of 'memccpy'
C:\Program Files (x86)\Microsoft Visual Studio\VC98\INCLUDE\memory.h(86) : error C2733: second C linkage of overloaded function 'memicmp' not allowed
        C:\Program Files (x86)\Microsoft Visual Studio\VC98\INCLUDE\memory.h(86) : see declaration of 'memicmp'
Error executing cl.exe.
Creating browse info file...

StockCharter.exe - 9 error(s), 0 warning(s)
Software AssembliesSoftwareAssemblies.comAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

evilrixSenior Software Engineer (Avast)Commented:
Let's start with the obvious errors and see where we go from there.

C:\Program Files (x86)\Microsoft Visual Studio\VC98\INCLUDE\objbase.h(435) : error C2664: 'memcmp' : cannot convert parameter 1 from 'const struct _GUID *' to 'void *'
        Conversion loses qualifiers
C:\Program Files (x86)\Microsoft Visual Studio\VC98\INCLUDE\objbase.h(459) : error C2664: 'memcmp' : cannot convert parameter 1 from 'const struct _GUID *' to 'void *

This error suggests you have a mismatched with constness. Have you looked at this to see why?

Also, seeing the code would help.
0
Software AssembliesSoftwareAssemblies.comAuthor Commented:
how would I solve this issue?
0
Software AssembliesSoftwareAssemblies.comAuthor Commented:
if this is C program why is it picking up C++ errors?
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

sarabandeCommented:
you should remove stdafx.cpp from your project. this source most probably would compile as a c++ source (by default because of .cpp extension) but if you have chosen ansi-c as the compiler you might get some very strange errors like the ones you posted. stdafx.cpp is the source that should provide the so-called precompiled header (pch) which would make faster builds for all source files which included stdafx.h as first header file. stdafx.h mostly includes a lot of c++ headers and with the pch feature those classes and their inline functions are compiled only once.

in your project the precompiled headers seem to be a wrong decision when you created the project. especially when you intend to build with the c compiler. you should go to the c/c++ project settings and choose the precompiled header tab. there you can specify that the precomiled headers are not be used for your project. you have to do this for both debug and release configuration.  if you have a c project you additionally should remove all #include "stdafx.h" from your sources (in case of c++ you may use those include statements regardless if pch is switched on or off).

Sara
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
sarabandeCommented:
by the way vs 6 is from 1998 and was released before first c++ standard (c++98). if you want to have a c program, you much better would use visual studio 2017 community which is 19 years younger and for free. it still has an excellent ansi-c compiler.

Sara
0
evilrixSenior Software Engineer (Avast)Commented:
>> if this is C program why is it picking up C++ errors?
Why do you think they are C++ errors?

>> how would I solve this issue?
Well, you have a const/non-const mismatch and so you'll either have to make one argument const or the other non-const. Without being able to see the code (as I've asked you to provide), we can't really say much more without resorting to telepathy or asking our spirit guides. :)
1
sarabandeCommented:
Why do you think they are C++ errors?

stdafx.cpp is a wizard-generated c++ source which has only one (include) statement: #include "stdafx.h"

the extension .cpp is a reasonable indication that stdafx.cpp is compiled by using the c++ compiler. nevertheless vs studio settings would allow to compile even a source named stdafx.cpp with ansi-c compiler if all headers included by stdafx.h can be included as c headers as well. however, this can't work if the generated stdafx.h source included headers with some inline functions which are not compliant with strict ansi c syntax.

Sara
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
C

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.