Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

object-compile woes

Status
Not open for further replies.

DoraC

Programmer
May 7, 2002
98
0
0
US
Hi,

I have a file of functions I want to object-compile, rather than use to build an executable. I would like to do this so that the .obj file that results can be used in the compilation of other executables. I am compiling my program (using the VC++ 6.0 command-line compile facility, vs. the IDE) as:
Code:
/EHsc -I"c:\Program Files\Microsoft Visual Studio\VC98\Include"  hello_world.cpp  /Fo
but this results in:
Code:
hello_world.cpp
Microsoft (R) Incremental Linker Version 7.00.9466
Copyright (C) Microsoft Corporation.  All rights reserved.

/out:hello_world.exe 
hello_world.obj 
LINK : fatal error LNK1561: entry point must be defined
I take it by "entry point" the compiler means a "main" routine - but what if I don't need/want to provide a main routine for this group of functions? And, why is it referencing "out:hello_world.exe" if all I'm building is a obj file?

Am I totally of the mark here? Perhaps creating an "object file" isn't what I need to be doing in this case?

(I'm doing this with VC++ 6.0 on NT)
Thanks for any help -
dora c
 
Can't see the entire command in your post, but :

cl /c ...options.... will do a compile only job.

Try cl /? in a command-prompt to see all options available.

/JOlesen
 

try changing the collection to a DLL instead of an EXECUTABLE. That way the LINKER knows this is going to a library of object files and not an executable.

I don't know exactly how this is done.... in terms of options.

I typically just go back to start and execute

new Projects Wizard

and select the SHARED DLL and copy my files from the other project into my new project.

and then compile a link it as a DLL.



 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top