Hi,

I'm a newbie in this vast world of programming. I've been given some codes in C which are compiled & linked using makefile. I can compile the code using nmake from VS2005. Now i want to build the program in C++ VS2005 IDE.
From a quick google search, there seems to be no automated functions in importing makefile settings to VS IDE.
I tried to include all the necessary dependecies(header and lib files) stated in the makefile to VS but i get a lot of linking errors. I'm not even sure where to start looking to solve the issue. I hope the gurus can help me out.

The makefile including two other related makefile is attached to this post.
[1]makefile.mak
[2]compiler.mak
[3]options.mak

In VS I've:
[1] Create a new empty project
[2] Add exisiting sources (c files and header files)
[3] Additional Include Directories: ..../include and ..../src/make7
[4] Additional Library Directories: ..../lib
[5] Build project...

I got 74 linker errors the VS output after attempted build. Example:

conmain.obj : error LNK2001: unresolved external symbol _MMSd_freeDsMemFunction
scl_cli.obj : error LNK2019: unresolved external symbol _TAM_parse_address referenced in function _ResolveServerAddress

I've not dealt with makefiles before. I apologize if this post may sound very newbie style and amatuer-ish. I'm new but I'm willing to learn.

Any advice and comment is greatly appreciated.

jjplaw

> [4] Additional Library Directories: ..../lib
From your errors (all unresolved errors it seems), the only thing missing are the "additional library names"
On the link tab IIRC.

I've already added the lib folder in the additional libraries tab in VC project properties. The lib folder contains all the lib files stated in the makefile.

[1] Could it be that i'm trying to compile/link pure C codes using a C++ compiler/linker?

[2] The application has 3 .c codes. In the makefile, conmain.c is compiled to produce tcpmain.obj instead of conmain.obj. I assume that this will not effect anything in VS IDE but i just wanna confirm with the experts first. If it does effect, how can i do it in VS IDE?

[3] In the makefile, CDEFS = $(STACK_DEF) $(AUTH_DEF) $(CLIENT_DEF) $(FILESERVICE_DEF)

$(STACK_DEF) = -DUSE_TCP
$(AUTH_DEF) = -DUSE_AUTH
$(CLIENT_DEF) = -DUSE_CLIENT
$(FILESERVICE_DEF) = -DUSE_FILES

What are those parameters and what do they do? Is it specific to this application or common. In the makefile, its used when compiling the 3 .c files to .obj files.

[4] Any idea what is the symbol @<< in the makefile? I cant seem to find the answer from google searching.

Please advise.

justin

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.