Author Topic: New installation...not working properly  (Read 6416 times)

Offline marcdan221

  • Single posting newcomer
  • *
  • Posts: 6
New installation...not working properly
« on: November 17, 2005, 06:33:00 pm »
Hi all, I'm new to this forum and new to C::B.  :)

I need help with my installation. I'm using BCC55 but I'm not able to use correctly with C::B.

Everytime I compile my sources, this is what I get...

Project   : Console application
Compiler  : GNU GCC Compiler (called directly)  <------------------------ Is that normal??  I set Borland to be the default compiler.
Directory : C:\Borland\BCC55\CodeBlocks\Test\
--------------------------------------------------------------------------------
Compiling: ..\..\Projects\transfer.cpp
Borland C++ 5.5.1 for Win32 Copyright (c) 1993, 2000 Borland
..\..\Projects\transfer.cpp:


And the following....

Linking console executable: ..\..\Projects\transfer.exe
Turbo Incremental Link 5.00 Copyright (c) 1997, 2000 Borland
Error: Unresolved external '___CRTL_VCL_Init' referenced from C:\BORLAND\BCC55\LIB\C0X32.OBJ
Error: Unresolved external '___CRTL_MEM_UseBorMM' referenced from C:\BORLAND\BCC55\LIB\C0X32.OBJ
Error: Unresolved external '___CRTL_VCLLIB_Linkage' referenced from C:\BORLAND\BCC55\LIB\C0X32.OBJ
Error: Unresolved external '__ExceptInit' referenced from C:\BORLAND\BCC55\LIB\C0X32.OBJ
Error: Unresolved external 'GetModuleHandleA' referenced from C:\BORLAND\BCC55\LIB\C0X32.OBJ
Error: Unresolved external '__startup' referenced from C:\BORLAND\BCC55\LIB\C0X32.OBJ
Error: Unresolved external '__GetExceptDLLinfoInternal' referenced from C:\BORLAND\BCC55\LIB\C0X32.OBJ
Error: Unresolved external 'HeapAlloc' referenced from C:\BORLAND\BCC55\LIB\C0X32.OBJ
Error: Unresolved external '___CRTL_TLS_SetValue' referenced from C:\BORLAND\BCC55\LIB\C0X32.OBJ
Error: Unresolved external '___CRTL_TLS_InitThread' referenced from C:\BORLAND\BCC55\LIB\C0X32.OBJ
Error: Unresolved external '___CRTL_TLS_Alloc' referenced from C:\BORLAND\BCC55\LIB\C0X32.OBJ
Error: Unresolved external '___CRTL_TLS_GetValue' referenced from C:\BORLAND\BCC55\LIB\C0X32.OBJ
Error: Unresolved external 'GetProcessHeap' referenced from C:\BORLAND\BCC55\LIB\C0X32.OBJ
Error: Unresolved external 'HeapFree' referenced from C:\BORLAND\BCC55\LIB\C0X32.OBJ
Error: Unresolved external '___CRTL_TLS_ExitThread' referenced from C:\BORLAND\BCC55\LIB\C0X32.OBJ
Error: Unresolved external '___CRTL_TLS_Free' referenced from C:\BORLAND\BCC55\LIB\C0X32.OBJ
Error: Unresolved external 'WSAStartup' referenced from C:\BORLAND\BCC55\PROJECTS\TRANSFER.OBJ
Error: Unresolved external 'WSACleanup' referenced from C:\BORLAND\BCC55\PROJECTS\TRANSFER.OBJ
Error: Unresolved external '_printf' referenced from C:\BORLAND\BCC55\PROJECTS\TRANSFER.OBJ
Error: Unresolved external 'socket' referenced from C:\BORLAND\BCC55\PROJECTS\TRANSFER.OBJ
Error: Unresolved external 'WSAGetLastError' referenced from C:\BORLAND\BCC55\PROJECTS\TRANSFER.OBJ
Error: Unresolved external '_strcpy' referenced from C:\BORLAND\BCC55\PROJECTS\TRANSFER.OBJ
Error: Unresolved external 'inet_addr' referenced from C:\BORLAND\BCC55\PROJECTS\TRANSFER.OBJ
Error: Unresolved external 'htons' referenced from C:\BORLAND\BCC55\PROJECTS\TRANSFER.OBJ
Error: Unresolved external 'connect' referenced from C:\BORLAND\BCC55\PROJECTS\TRANSFER.OBJ
...


Now this is what I get if I compile from command line....

C:\Borland\BCC55\Projects>bcc transfer
Borland C++ 5.5.1 for Win32 Copyright (c) 1993, 2000 Borland
transfer.cpp:
transfer.cpp:
Turbo Incremental Link 5.00 Copyright (c) 1997, 2000 Borland



I've tried to install both version of C::B (with or w/o GNU GCC compiler) and both are giving me the same errors.

Please help me, what's wrong?  :(

Thanks.

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9603
Re: New installation...not working properly
« Reply #1 on: November 17, 2005, 07:27:10 pm »
Error: Unresolved external 'WSAStartup' referenced from C:\BORLAND\BCC55\PROJECTS\TRANSFER.OBJ
Error: Unresolved external '_printf' referenced from C:\BORLAND\BCC55\PROJECTS\TRANSFER.OBJ
Seems you are missing linking against quite a few Windows libraries. Could you post the whole command line used for compiling/linking? (Enable Settings -> Compiler -> Other -> Compiler Logging: Full command line.

Morten.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: http://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: http://wiki.codeblocks.org/index.php?title=FAQ

Offline marcdan221

  • Single posting newcomer
  • *
  • Posts: 6
Re: New installation...not working properly
« Reply #2 on: November 17, 2005, 08:04:38 pm »
Ok, I think I know what I'm doing wrong. I'm triyng to compile the file only and not the project.

I have created a new project and include my tranfer.cpp source in it....now I'm having new errors...

main.cpp: In function `bool ConnectAndSend(char*, char*, long int)':
main.cpp:220: error: expected primary-expression before "long"
main.cpp:220: error: integer constant is too large for "long" type
main.cpp: In function `void WaitForIncomming()':
main.cpp:270: warning: converting of negative value `-0x000000001' to `SOCKET'
main.cpp: In function `long long int GetFilesize(char*)':
main.cpp:348: warning: passing NULL used for non-pointer converting 3 of `void* CreateFileA(const CHAR*, DWORD, DWORD, _SECURITY_ATTRIBUTES*, DWORD, DWORD, void*)'
main.cpp:348: warning: passing NULL used for non-pointer converting 6 of `void* CreateFileA(const CHAR*, DWORD, DWORD, _SECURITY_ATTRIBUTES*, DWORD, DWORD, void*)'
main.cpp:352: error: expected primary-expression before "long"
main.cpp:352: error: expected `;' before "long"
main.cpp:352: error: expected primary-expression before "long"
main.cpp:352: error: expected `;' before "long"
main.cpp:356: error: `GetFileSizeEx' undeclared (first use this function)
main.cpp:356: error: (Each undeclared identifier is reported only once for each function it appears in.)
main.cpp:360: error: expected primary-expression before "long"
main.cpp:360: error: expected `;' before "long"
main.cpp:360: error: expected primary-expression before "long"
main.cpp:360: error: expected `;' before "long"
main.cpp:364: error: expected primary-expression before "long"
main.cpp:364: error: expected `;' before "long"
main.cpp:364: error: expected primary-expression before "long"
main.cpp:364: error: expected `;' before "long"
Process terminated with status 1 (0 minutes, 1 seconds)
16 errors, 3 warnings


I've set the option for the compiler (Enable Settings -> Compiler -> Other -> Compiler Logging: Full command line).

Normally, when I compile a .cpp source with the Borland Compiler, I simply....

C:\Borland\BCC55\Projects>bcc32 transfer.cpp     <------------------This is the command line I use to compile my programs (bcc32.exe)
Borland C++ 5.5.1 for Win32 Copyright (c) 1993, 2000 Borland
transfer.cpp:
Turbo Incremental Link 5.00 Copyright (c) 1997, 2000 Borland


...and everything is fine. No errors and .exe is created.

I tried to modify the macros in the "Advanced Compiler Options" so it only use $compiler $file....same thing going on.

Escuse me if I don't elaborate more....bcc32.exe does the job for me I guess (compiling + linking).


Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9603
Re: New installation...not working properly
« Reply #3 on: November 17, 2005, 08:34:33 pm »
I've set the option for the compiler (Enable Settings -> Compiler -> Other -> Compiler Logging: Full command line).
Could you please post the full compiler build log then? It is important to see full commandline provided to the compiler.

Morten.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: http://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: http://wiki.codeblocks.org/index.php?title=FAQ

Offline marcdan221

  • Single posting newcomer
  • *
  • Posts: 6
Re: New installation...not working properly
« Reply #4 on: November 17, 2005, 09:00:38 pm »
Here is the full build log....  :( (it doesn't give me the command line it uses)

Project   : Console application
Compiler  : GNU GCC Compiler (called directly)
Directory : C:\Borland\BCC55\Projects\Transfer project\
--------------------------------------------------------------------------------
Switching to target: default
Compiling: ..\transfer.cpp
..\transfer.cpp: In function `bool ConnectAndSend(char*, char*, long int)':
..\transfer.cpp:220: error: expected primary-expression before "long"
..\transfer.cpp:220: error: integer constant is too large for "long" type
..\transfer.cpp: In function `void WaitForIncomming()':
..\transfer.cpp:270: warning: converting of negative value `-0x000000001' to `SOCKET'
..\transfer.cpp: In function `long long int GetFilesize(char*)':
..\transfer.cpp:348: warning: passing NULL used for non-pointer converting 3 of `void* CreateFileA(const CHAR*, DWORD, DWORD, _SECURITY_ATTRIBUTES*, DWORD, DWORD, void*)'
..\transfer.cpp:348: warning: passing NULL used for non-pointer converting 6 of `void* CreateFileA(const CHAR*, DWORD, DWORD, _SECURITY_ATTRIBUTES*, DWORD, DWORD, void*)'
..\transfer.cpp:352: error: expected primary-expression before "long"
..\transfer.cpp:352: error: expected `;' before "long"
..\transfer.cpp:352: error: expected primary-expression before "long"
..\transfer.cpp:352: error: expected `;' before "long"
..\transfer.cpp:356: error: `GetFileSizeEx' undeclared (first use this function)
..\transfer.cpp:356: error: (Each undeclared identifier is reported only once for each function it appears in.)
..\transfer.cpp:360: error: expected primary-expression before "long"
..\transfer.cpp:360: error: expected `;' before "long"
..\transfer.cpp:360: error: expected primary-expression before "long"
..\transfer.cpp:360: error: expected `;' before "long"
..\transfer.cpp:364: error: expected primary-expression before "long"
..\transfer.cpp:364: error: expected `;' before "long"
..\transfer.cpp:364: error: expected primary-expression before "long"
..\transfer.cpp:364: error: expected `;' before "long"
Process terminated with status 1 (0 minutes, 1 seconds)
16 errors, 3 warnings



I would like to include some screenshot..but I don't know how yet   :?


Offline marcdan221

  • Single posting newcomer
  • *
  • Posts: 6
Re: New installation...not working properly
« Reply #5 on: November 17, 2005, 09:02:42 pm »
and it always says "Compiler  : GNU GCC Compiler (called directly)" ?? Is that ok?

Offline marcdan221

  • Single posting newcomer
  • *
  • Posts: 6
Re: New installation...not working properly
« Reply #6 on: November 17, 2005, 09:26:12 pm »
ok....I think there might be a bug there. I went in the menu in Projects\Build Options and from there selected Borland C++ 5.5 and walk through the options. I then "Cancel" and recompile....here are my new results.

Project   : Console application
Compiler  : Borland C++ Compiler 5.5 (using GNU "make")
Directory : C:\Borland\BCC55\Projects\test\
--------------------------------------------------------------------------------
Cleaning target "default"...
rm -f C:/Borland/BCC55/Projects/test/console.exe .objs/main.o   
Calculating dependencies for "main.cpp"...
mingw32-g++.exe -MM   -MF .deps/main.d -MT .objs/main.o  -IC:/Program\ Files/CodeBlocks/include main.cpp
Compiling "main.cpp"...
mingw32-g++.exe    -IC:/Program\ Files/CodeBlocks/include -c main.cpp -o .objs/main.o
main.cpp: In function `bool ConnectAndSend(char*, char*, long int)':
main.cpp:220: error: expected primary-expression before "long"
main.cpp:220: error: integer constant is too large for "long" type
main.cpp: In function `void WaitForIncomming()':
main.cpp:270: warning: converting of negative value `-0x000000001' to `SOCKET'
main.cpp: In function `long long int GetFilesize(char*)':
main.cpp:348: warning: passing NULL used for non-pointer converting 3 of `void* CreateFileA(const CHAR*, DWORD, DWORD, _SECURITY_ATTRIBUTES*, DWORD, DWORD, void*)'
main.cpp:348: warning: passing NULL used for non-pointer converting 6 of `void* CreateFileA(const CHAR*, DWORD, DWORD, _SECURITY_ATTRIBUTES*, DWORD, DWORD, void*)'
main.cpp:352: error: expected primary-expression before "long"
main.cpp:352: error: expected `;' before "long"
main.cpp:352: error: expected primary-expression before "long"
main.cpp:352: error: expected `;' before "long"
main.cpp:356: error: `GetFileSizeEx' undeclared (first use this function)
main.cpp:356: error: (Each undeclared identifier is reported only once for each function it appears in.)
main.cpp:360: error: expected primary-expression before "long"
main.cpp:360: error: expected `;' before "long"
main.cpp:360: error: expected primary-expression before "long"
main.cpp:360: error: expected `;' before "long"
main.cpp:364: error: expected primary-expression before "long"
main.cpp:364: error: expected `;' before "long"
main.cpp:364: error: expected primary-expression before "long"
main.cpp:364: error: expected `;' before "long"
mingw32-make.exe: *** [.objs/main.o] Error 1
Process terminated with status 1 (0 minutes, 1 seconds)
0 errors, 0 warnings


From what I got there, what should I do to configure my C::B to work with Borland as it's working under the command line?

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9603
Re: New installation...not working properly
« Reply #7 on: November 17, 2005, 09:45:17 pm »
ok....I think there might be a bug there.mingw32-g++.exe -MM   -MF .deps/main.d -MT .objs/main.o  -IC:/Program\ Files/CodeBlocks/include main.cpp
You were very fast... :lol: What I said was wrong - it was MY mistake... sorry. I did forget (indeed) to setup the include and library path correctly in the Borland C++ compiler setup.

Quote
Compiling "main.cpp"...
mingw32-g++.exe    -IC:/Program\ Files/CodeBlocks/include -c main.cpp -o .objs/main.o
mingw32-make.exe: *** [.objs/main.o] Error 1
You are using the wrong (GCC) compiler. It has to be setup in the project's build options as well: Right click on the project, select "Properties" and then the button "Project's build options". There you have to select the compiler. it's not enough to setup the compiler under "settings". You can have a different compiler for each project. Please try again.

Morten.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: http://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: http://wiki.codeblocks.org/index.php?title=FAQ

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9603
Re: New installation...not working properly
« Reply #8 on: November 17, 2005, 09:50:05 pm »
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: http://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: http://wiki.codeblocks.org/index.php?title=FAQ

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9603
Re: New installation...not working properly
« Reply #9 on: November 17, 2005, 09:58:12 pm »
I've prepared a hello-world project for you. Find it attached. Ones you have setup the Compiler correctly, this should work. Please note that you have to setup the "[YOUR_BC55_DIR]\Lib" AND "[YOUR_BC55_DIR]\Lib\PSDK" in the compiler setup. otherwise the platform (kernel32 and user32) libs are missing.

Morten.


[attachment deleted by admin]
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: http://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: http://wiki.codeblocks.org/index.php?title=FAQ

Offline marcdan221

  • Single posting newcomer
  • *
  • Posts: 6
Re: New installation...not working properly
« Reply #10 on: November 17, 2005, 10:48:47 pm »
Ok,.. well first thank you Morten for taking your precious time to help me out with this issue.

I read the post on BCC55 and it's kinda too complicated for me all these linking things (for now at least!). I downloaded your Hello World source and add the path to BCC55\lib\PSDk...Compile...working.... I then tested my project, selected Borland Compiler in Build options...still having all those errors.

What I did is that I reduce the macro for "Compile single file to object" to $compiler $file....and delete the macro for "Link object file to console executable" because I know that when you call BCC32 $file it automatically do the ilink32.exe stuff (things that I'm not aware of normally when using BCC32.EXE $file from commnad line)

For now, all my console sources are working perfectly without giving me any errors. I might get to work with those compiling/linking things I don't do normally  :D It will help me a lot with the rest.

While we are there, can you teach me how to include files or pirctures please. My last request for today  :D

Thanks again, cheers

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9603
Re: New installation...not working properly
« Reply #11 on: November 18, 2005, 08:02:47 am »
What I did is that I reduce the macro for "Compile single file to object" to $compiler $file....and delete the macro for "Link object file to console executable" because I know that when you call BCC32 $file it automatically do the ilink32.exe stuff (things that I'm not aware of normally when using BCC32.EXE $file from commnad line)
I guess this is a (the) source for the errors. I assume you screwed up the compiler/linker settings a little. But: If my example still works than you could compare my project (.cbp) file with yours using a Diff-program (e.g. WinMerge). You might find the errors than. I would strongly suggest that you don't change the compiler settings beside the path's setup. This works, normally!

While we are there, can you teach me how to include files or pirctures please. My last request for today  :D
When you click on "Reply" to the message than beyond the message field there is a "Additional Options" link. Click on it and you can select a file / files to attach to the message.

Morten.
« Last Edit: November 18, 2005, 08:04:19 am by MortenMacFly »
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: http://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: http://wiki.codeblocks.org/index.php?title=FAQ