![]() |
| | #1 |
| HelpingYouHelpUsHelpUsAll Join Date: Dec 2007 Location: In your nightmares
Posts: 223
| bcc 5.5 Declaration terminated incorrectly I am using Borland C++ 5.5.1.
__________________ long time no C; //seige You miss 100% of the people you don't C; Code: if (language != LANG_C && language != LANG_CPP)
drown(language);
|
| P4R4N01D is offline | |
| | #2 |
| erstwhile Join Date: Jan 2002
Posts: 2,223
| Borland compilers shouldn't need <windows.h> #included in the resource script(*.dlg file).
__________________ CProgramming FAQ Caution: this person may be a carrier of the misinformation virus. |
| Ken Fitlike is offline | |
| | #3 |
| HelpingYouHelpUsHelpUsAll Join Date: Dec 2007 Location: In your nightmares
Posts: 223
| Sorry, this is not what is causing it, adding/removing this line does not affect whether the program compiles or not. Removing the comment on the first few lines gives me a different error: "Error E2141 hexcalc\hexcalc.dlg 1: Declaration syntax error". Comments should not affect program compilation, why would a different error come up? Also changing the two -1s to 0 does not affect the compile. Am pretty sure that the compiler does not like the line, but I have no idea what is wrong with it: Code: HexCalc DIALOG -1, -1, 102, 122
__________________ long time no C; //seige You miss 100% of the people you don't C; Code: if (language != LANG_C && language != LANG_CPP)
drown(language);
|
| P4R4N01D is offline | |
| | #4 |
| Registered User Join Date: Oct 2001
Posts: 2,110
| //LRESULT CALLBACK WndProc (HWND, UINT, WPARAM, LPARAM) ; You'll want to uncomment that for this: wndclass.lpfnWndProc = WndProc; |
| robwhit is offline | |
| | #5 | |
| HelpingYouHelpUsHelpUsAll Join Date: Dec 2007 Location: In your nightmares
Posts: 223
| Quote:
Code: Error E2141 hexcalc\hexcalc.dlg 2: Declaration syntax error Error E2451 hexcalc\hexcalc.c 19: Undefined symbol 'WndProc' in function WinMain Warning W8057 hexcalc\hexcalc.c 46: Parameter 'hPrevInstance' is never used in function WinMain Warning W8057 hexcalc\hexcalc.c 46: Parameter 'szCmdLine' is never used in function WinMain Warning W8060 hexcalc\hexcalc.c 93: Possibly incorrect assignment in function WndProc Warning W8084 hexcalc\hexcalc.c 123: Suggest parentheses to clarify precedence in function WndProc *** 2 errors in Compile ***
__________________ long time no C; //seige You miss 100% of the people you don't C; Code: if (language != LANG_C && language != LANG_CPP)
drown(language);
| |
| P4R4N01D is offline | |
| | #6 |
| Registered User Join Date: Oct 2001
Posts: 2,110
| Code: *--------------------------- HEXCALC.DLG dialog script ---------------------------*/ |
| robwhit is offline | |
| | #7 |
| HelpingYouHelpUsHelpUsAll Join Date: Dec 2007 Location: In your nightmares
Posts: 223
| Thanks for pointing that out, that happened mainly due to using notepad and was the direct result of copy>paste. Fixing that, I get: Code: Error E2141 hexcalc\hexcalc.dlg 6: Declaration syntax error *** 1 errors in Compile ***
__________________ long time no C; //seige You miss 100% of the people you don't C; Code: if (language != LANG_C && language != LANG_CPP)
drown(language);
|
| P4R4N01D is offline | |
| | #8 | |
| erstwhile Join Date: Jan 2002
Posts: 2,223
| Quote:
That aside, with the #inclusion of the resource script in the source code file, bcc32 (bcc551's compiler) is trying and failing to parse it; it needs to be compiled separately to a resource object with brcc32(the resource compiler) and linked with the compiled source object. In short, remove the #include "hexcalc.dlg" line and follow the other advice already given in this thread: ensure that WndProc is forward declared, fix the comment and remove #include <windows.h> from hexcalc.dlg. Then compile the resource script with brcc32, compile the hexcalc.c with brc32 and link the objects with ilink32 using appropriate flags as described in the documentation. eg compile corrected resource: Code: brcc32 -fo hexcalc.res hexcalc.dlg Code: bcc32 -c hexcalc.c Code: ilink32 -aa c0w32.obj hexcalc.obj,hexcalc.exe,,import32.lib cw32.lib,,hexcalc.res
__________________ CProgramming FAQ Caution: this person may be a carrier of the misinformation virus. | |
| Ken Fitlike is offline | |
| | #9 |
| HelpingYouHelpUsHelpUsAll Join Date: Dec 2007 Location: In your nightmares
Posts: 223
| Solved Wow, thanks it worked perfectly. The whole point of this program was learning how to use bcc32 as an alternative to lcc-Win32 and Dev-C++. I still get one error despite it compiling fine: Code: Error: Unresolved external '_main' referenced from C:\BORLAND\BCC55\LIB\C0X32.OBJ
__________________ long time no C; //seige You miss 100% of the people you don't C; Code: if (language != LANG_C && language != LANG_CPP)
drown(language);
|
| P4R4N01D is offline | |
| | #10 | |||
| erstwhile Join Date: Jan 2002
Posts: 2,223
| Quote:
Quote:
For multi-file projects, using a makefile simplifies building (there's a 'make' help file, too, with the tools). Quote:
__________________ CProgramming FAQ Caution: this person may be a carrier of the misinformation virus. | |||
| Ken Fitlike is offline | |
![]() |
| Thread Tools | |
| Display Modes | |
|
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Quantum Random Bit Generator | shawnt | C++ Programming | 62 | 06-18-2008 10:17 AM |
| failure to import external C libraries in C++ project | nocturna_gr | C++ Programming | 3 | 12-02-2007 03:49 PM |
| We Got _DEBUG Errors | Tonto | Windows Programming | 5 | 12-22-2006 05:45 PM |
| Errors with including winsock 2 lib | gamingdl'er | C++ Programming | 3 | 12-05-2005 08:13 PM |
| Dikumud | maxorator | C++ Programming | 1 | 10-01-2005 06:39 AM |