Public Group

#### Archived

This topic is now archived and is closed to further replies.

# Trouble with Borland C++

This topic is 6013 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

Hi there, I''m currently learning DirectX 8 and I made a simple app that compiles fine but comes up with an error when it links. It reads as follows: Error: Unresolved external ''_main'' reference from C:\BCPP\LIB\C0X32.obj If anyone knows what this means I would greatly appreciate a reply so I can go on to some more learning of DirectX . Thank you.

##### Share on other sites
make sure you have some kind of main function (main or WinMain)
and you compile for the right platform. if you compile a
windows console application, and you defined WinMain, you get
this error, because the linker expects a ''main''-function

##### Share on other sites
I have the function WinMain as my entry point function. Also, how do you specify which type of application(win32 or console) you want to compile?

##### Share on other sites
I''m not sure exactly what you''re doing, but it sounds as if you have the free tools. Anyway, the main problem is that it''s linking with the wrong crt0... you want C0W32.OBJ (I think).

To compile a Windows app run BCC32 -tW. This is all assuming you''re running the free tools, of course.

##### Share on other sites
Use the -W flag on the free BCC32
bcc32 -W file.cpp

##### Share on other sites
Ok that problem is fixed. But now it comes up with the same error only with the function Direct3dCreate8.

quote:

Error: Unresolved external ''Direct3Create8'' referenced from C:\BCPP\BIN\MAIN.OBJ

I am guessing that it is not linking the DirectX library files? Even though I included the pathname of the .lib''s in the command line. Forgive me if I sound like a moron here, but I have only been using this compiler for 1 day . Thanks for the help so far

P.S. - I am using the free compiler, not C++ Builder.

##### Share on other sites
well, do remember that the standard, .lib files from microsoft are ms (yes, ms, not m\$, since I started using .NET and it''s actually pretty cool, but that''s wayyy off topic) only.
Maybe you already have the borland specific libraries, if so... then it should work. You can get the lib''s from my now-dead-site (hasn''t been updated in months) in the sig.
How did you include the pathnames? you probably did it right, but then again... you never know.
I haven''t messed with the borland command line compiler in a while, but #pragma link usually works...ala..
#pragma link "d3d8.lib"

Oh! you''re not linking d3d.lib, are you? another possibility...

------------------------------
BCB DX Library - RAD C++ Game development for BCB

1. 1
Rutin
34
2. 2
3. 3
4. 4
5. 5

• 12
• 14
• 9
• 9
• 9
• ### Forum Statistics

• Total Topics
633331
• Total Posts
3011397
• ### Who's Online (See full list)

There are no registered users currently online

×