By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,413 Members | 1,023 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,413 IT Pros & Developers. It's quick & easy.

Compiling C code in visual C++

P: 1
I have written a INI file phaser in C, with the expectation that C is backwards compatible with c++. It compiles perfectly with gcc. However, when I try to compile it in Microsoft Visual C++ 6.0 i get the following errors:

--------------------Configuration: test - Win32 Debug--------------------
Linking...
in.obj : error LNK2001: unresolved external symbol _settings_delete
in.obj : error LNK2001: unresolved external symbol _settings_print
in.obj : error LNK2001: unresolved external symbol _settings_getvalue
in.obj : error LNK2001: unresolved external symbol _settings_new
Debug/test.exe : fatal error LNK1120: 4 unresolved externals
Error executing link.exe.

test.exe - 5 error(s), 0 warning(s)

Googleing told me that I had something wrong with my project settings, but none of them can get the C code to integrate with C++. What can I do to get it to compile?
Jun 6 '07 #1
Share this Question
Share on Google+
3 Replies


P: 21
I have written a INI file phaser in C, with the expectation that C is backwards compatible with c++. It compiles perfectly with gcc. However, when I try to compile it in Microsoft Visual C++ 6.0 i get the following errors:

--------------------Configuration: test - Win32 Debug--------------------
Linking...
in.obj : error LNK2001: unresolved external symbol _settings_delete
in.obj : error LNK2001: unresolved external symbol _settings_print
in.obj : error LNK2001: unresolved external symbol _settings_getvalue
in.obj : error LNK2001: unresolved external symbol _settings_new
Debug/test.exe : fatal error LNK1120: 4 unresolved externals
Error executing link.exe.

test.exe - 5 error(s), 0 warning(s)

Googleing told me that I had something wrong with my project settings, but none of them can get the C code to integrate with C++. What can I do to get it to compile?
Please see me the code.
Jun 6 '07 #2

100+
P: 208
You may have to change a few things in your C code to make it work in a C++ compiler. It probably won't work perfectly without any changes since there are differences.
Jun 6 '07 #3

weaknessforcats
Expert Mod 5K+
P: 9,197
The linker can't find the code for these functions:

_settings_delete
_settings_print
_settings_getvalue
_settings_new

Be sure you include the library (or the .c file) that containsthe code for these functions. If it's a library, go to the property pages and find the linker properties and add your library as an additional dependency.
Jun 6 '07 #4

Post your reply

Sign in to post your reply or Sign up for a free account.