Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8688999
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T23:31:27+00:00 2026-06-12T23:31:27+00:00

I have C source code which i want want to build with Visual Studio

  • 0

I have C source code which i want want to build with Visual Studio 2010. It references two libraries, which i think i have added correctly to my project, see the image.

As i understand i should rename the source file to name.c in order to have compiled as C. When i build my solution I get a undefined namespace errors on AssemblyInfo.cpp.

how can i fix these errors?

Please note that I also got a .OBJ, .LIB and .MAK file with the program. When opening the .MAK file I get the following errors:

EDIT:

i recreaated the project as Win32 console project. When compile the solution I get the following errors:

1>------ Build started: Project: SerialCommWin32, Configuration: Debug Win32 ------
1>  SerialCommWin32.cpp
1>c:\users\jgoddijn\documents\development\vanduijnen\serialcommwin32\serialcommwin32\asynch_1.h(44): error C2143: syntax error : missing ',' before '*'
1>c:\users\jgoddijn\documents\development\vanduijnen\serialcommwin32\serialcommwin32\asynch_1.h(73): error C2143: syntax error : missing ',' before '*'
1>c:\users\jgoddijn\documents\development\vanduijnen\serialcommwin32\serialcommwin32\serialcommwin32.cpp(272): error C2146: syntax error : missing ')' before identifier 'far'
1>c:\users\jgoddijn\documents\development\vanduijnen\serialcommwin32\serialcommwin32\serialcommwin32.cpp(272): error C2065: 'far' : undeclared identifier
1>c:\users\jgoddijn\documents\development\vanduijnen\serialcommwin32\serialcommwin32\serialcommwin32.cpp(272): warning C4197: 'volatile long' : top-level volatile in cast is ignored
1>c:\users\jgoddijn\documents\development\vanduijnen\serialcommwin32\serialcommwin32\serialcommwin32.cpp(272): error C2059: syntax error : ')'
1>c:\users\jgoddijn\documents\development\vanduijnen\serialcommwin32\serialcommwin32\serialcommwin32.cpp(272): error C2059: syntax error : ')'
1>c:\users\jgoddijn\documents\development\vanduijnen\serialcommwin32\serialcommwin32\serialcommwin32.cpp(447): error C2664: 'wrtst_a1' : cannot convert parameter 4 from 'uint *' to 'int *'
1>          Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
1>c:\users\jgoddijn\documents\development\vanduijnen\serialcommwin32\serialcommwin32\serialcommwin32.cpp(454): error C2146: syntax error : missing ')' before identifier 'far'
1>c:\users\jgoddijn\documents\development\vanduijnen\serialcommwin32\serialcommwin32\serialcommwin32.cpp(454): error C2065: 'far' : undeclared identifier
1>c:\users\jgoddijn\documents\development\vanduijnen\serialcommwin32\serialcommwin32\serialcommwin32.cpp(454): warning C4197: 'volatile long' : top-level volatile in cast is ignored
1>c:\users\jgoddijn\documents\development\vanduijnen\serialcommwin32\serialcommwin32\serialcommwin32.cpp(454): error C2059: syntax error : ')'
1>c:\users\jgoddijn\documents\development\vanduijnen\serialcommwin32\serialcommwin32\serialcommwin32.cpp(454): error C2059: syntax error : ')'
1>c:\users\jgoddijn\documents\development\vanduijnen\serialcommwin32\serialcommwin32\serialcommwin32.cpp(464): error C2146: syntax error : missing ')' before identifier 'far'
1>c:\users\jgoddijn\documents\development\vanduijnen\serialcommwin32\serialcommwin32\serialcommwin32.cpp(464): error C2065: 'far' : undeclared identifier
1>c:\users\jgoddijn\documents\development\vanduijnen\serialcommwin32\serialcommwin32\serialcommwin32.cpp(464): warning C4197: 'volatile long' : top-level volatile in cast is ignored
1>c:\users\jgoddijn\documents\development\vanduijnen\serialcommwin32\serialcommwin32\serialcommwin32.cpp(464): error C2059: syntax error : ')'
1>c:\users\jgoddijn\documents\development\vanduijnen\serialcommwin32\serialcommwin32\serialcommwin32.cpp(464): error C2059: syntax error : ')'
1>c:\users\jgoddijn\documents\development\vanduijnen\serialcommwin32\serialcommwin32\serialcommwin32.cpp(464): error C2143: syntax error : missing ';' before '{'
1>c:\users\jgoddijn\documents\development\vanduijnen\serialcommwin32\serialcommwin32\serialcommwin32.cpp(491): error C2664: 'wrtst_a1' : cannot convert parameter 4 from 'uint *' to 'int *'
1>          Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
1>c:\users\jgoddijn\documents\development\vanduijnen\serialcommwin32\serialcommwin32\serialcommwin32.cpp(498): error C2146: syntax error : missing ')' before identifier 'far'
1>c:\users\jgoddijn\documents\development\vanduijnen\serialcommwin32\serialcommwin32\serialcommwin32.cpp(498): error C2065: 'far' : undeclared identifier
1>c:\users\jgoddijn\documents\development\vanduijnen\serialcommwin32\serialcommwin32\serialcommwin32.cpp(498): warning C4197: 'volatile long' : top-level volatile in cast is ignored
1>c:\users\jgoddijn\documents\development\vanduijnen\serialcommwin32\serialcommwin32\serialcommwin32.cpp(498): error C2059: syntax error : ')'
1>c:\users\jgoddijn\documents\development\vanduijnen\serialcommwin32\serialcommwin32\serialcommwin32.cpp(498): error C2059: syntax error : ')'
1>c:\users\jgoddijn\documents\development\vanduijnen\serialcommwin32\serialcommwin32\serialcommwin32.cpp(508): error C2146: syntax error : missing ')' before identifier 'far'
1>c:\users\jgoddijn\documents\development\vanduijnen\serialcommwin32\serialcommwin32\serialcommwin32.cpp(508): error C2065: 'far' : undeclared identifier
1>c:\users\jgoddijn\documents\development\vanduijnen\serialcommwin32\serialcommwin32\serialcommwin32.cpp(508): warning C4197: 'volatile long' : top-level volatile in cast is ignored
1>c:\users\jgoddijn\documents\development\vanduijnen\serialcommwin32\serialcommwin32\serialcommwin32.cpp(508): error C2059: syntax error : ')'
1>c:\users\jgoddijn\documents\development\vanduijnen\serialcommwin32\serialcommwin32\serialcommwin32.cpp(508): error C2059: syntax error : ')'
1>c:\users\jgoddijn\documents\development\vanduijnen\serialcommwin32\serialcommwin32\serialcommwin32.cpp(508): error C2143: syntax error : missing ';' before '{'
1>c:\users\jgoddijn\documents\development\vanduijnen\serialcommwin32\serialcommwin32\serialcommwin32.cpp(532): warning C4309: '=' : truncation of constant value
1>c:\users\jgoddijn\documents\development\vanduijnen\serialcommwin32\serialcommwin32\serialcommwin32.cpp(546): warning C4309: '=' : truncation of constant value
1>c:\users\jgoddijn\documents\development\vanduijnen\serialcommwin32\serialcommwin32\serialcommwin32.cpp(585): warning C4309: '=' : truncation of constant value
1>c:\users\jgoddijn\documents\development\vanduijnen\serialcommwin32\serialcommwin32\serialcommwin32.cpp(710): warning C4309: '=' : truncation of constant value
1>c:\users\jgoddijn\documents\development\vanduijnen\serialcommwin32\serialcommwin32\serialcommwin32.cpp(728): warning C4309: '=' : truncation of constant value
1>c:\users\jgoddijn\documents\development\vanduijnen\serialcommwin32\serialcommwin32\serialcommwin32.cpp(746): warning C4309: '=' : truncation of constant value
1>c:\users\jgoddijn\documents\development\vanduijnen\serialcommwin32\serialcommwin32\serialcommwin32.cpp(765): warning C4309: '=' : truncation of constant value
1>c:\users\jgoddijn\documents\development\vanduijnen\serialcommwin32\serialcommwin32\serialcommwin32.cpp(779): error C2146: syntax error : missing ')' before identifier 'far'
1>c:\users\jgoddijn\documents\development\vanduijnen\serialcommwin32\serialcommwin32\serialcommwin32.cpp(779): error C2065: 'far' : undeclared identifier
1>c:\users\jgoddijn\documents\development\vanduijnen\serialcommwin32\serialcommwin32\serialcommwin32.cpp(779): warning C4197: 'volatile long' : top-level volatile in cast is ignored
1>c:\users\jgoddijn\documents\development\vanduijnen\serialcommwin32\serialcommwin32\serialcommwin32.cpp(779): error C2059: syntax error : ')'
1>c:\users\jgoddijn\documents\development\vanduijnen\serialcommwin32\serialcommwin32\serialcommwin32.cpp(779): error C2059: syntax error : ')'
1>c:\users\jgoddijn\documents\development\vanduijnen\serialcommwin32\serialcommwin32\serialcommwin32.cpp(782): error C2146: syntax error : missing ')' before identifier 'far'
1>c:\users\jgoddijn\documents\development\vanduijnen\serialcommwin32\serialcommwin32\serialcommwin32.cpp(782): error C2065: 'far' : undeclared identifier
1>c:\users\jgoddijn\documents\development\vanduijnen\serialcommwin32\serialcommwin32\serialcommwin32.cpp(782): warning C4197: 'volatile long' : top-level volatile in cast is ignored
1>c:\users\jgoddijn\documents\development\vanduijnen\serialcommwin32\serialcommwin32\serialcommwin32.cpp(782): error C2059: syntax error : ')'
1>c:\users\jgoddijn\documents\development\vanduijnen\serialcommwin32\serialcommwin32\serialcommwin32.cpp(782): error C2059: syntax error : ')'
1>c:\users\jgoddijn\documents\development\vanduijnen\serialcommwin32\serialcommwin32\serialcommwin32.cpp(946): warning C4309: '=' : truncation of constant value
1>c:\users\jgoddijn\documents\development\vanduijnen\serialcommwin32\serialcommwin32\serialcommwin32.cpp(1364): error C2664: 'rdst_a1' : cannot convert parameter 3 from 'uchar *' to 'char *'
1>          Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
1>c:\users\jgoddijn\documents\development\vanduijnen\serialcommwin32\serialcommwin32\serialcommwin32.cpp(1393): error C2146: syntax error : missing ')' before identifier 'far'
1>c:\users\jgoddijn\documents\development\vanduijnen\serialcommwin32\serialcommwin32\serialcommwin32.cpp(1393): error C2065: 'far' : undeclared identifier
1>c:\users\jgoddijn\documents\development\vanduijnen\serialcommwin32\serialcommwin32\serialcommwin32.cpp(1393): warning C4197: 'volatile long' : top-level volatile in cast is ignored
1>c:\users\jgoddijn\documents\development\vanduijnen\serialcommwin32\serialcommwin32\serialcommwin32.cpp(1393): error C2059: syntax error : ')'
1>c:\users\jgoddijn\documents\development\vanduijnen\serialcommwin32\serialcommwin32\serialcommwin32.cpp(1393): error C2059: syntax error : ')'
1>c:\users\jgoddijn\documents\development\vanduijnen\serialcommwin32\serialcommwin32\serialcommwin32.cpp(1393): error C2143: syntax error : missing ';' before '{'
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T23:31:28+00:00Added an answer on June 12, 2026 at 11:31 pm

    The compiler probably doesn’t really care for the file extensions. You could look into your project’s settings: C/C++ -> Advanced -> Compile As and then select C Code (although valid C code should also be valid C++ code).

    Also, the AssemblyInfo.cpp is only for C++/CLI projects. So remove that file or exclude it from the build.

    It looks like created the project as a C++/CLI project, so you’ll probably have to edit more project settings, or (the best solution IMO) recreate the project file as a native C/C++ project (Like Win32 Project or Win32 Console Application).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have standard source code package under Linux which requires to run ./configure make
I have an installer for which I don't have any source code. I need
In my source tree have Java code which is automatically generated from XSD files.
I have website on the server, which is not precompiled (with source code, so
I have a source directory which uses makefile to compile the code. This makefile/configure
I have a source code of an OpenSource project which I get from SVN.
I have a Nant script which updates a directory with the latest source code
I want to build mod_wsgi against a Python which I have built myself from
I have a substantial body of source code ( OOFILE ) which I'm finally
I'm writing a post build event for visual studio project. I have: java -jar

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.