Author Topic: help with first C::B project!  (Read 5750 times)

BigC

  • Guest
help with first C::B project!
« on: May 27, 2010, 05:19:18 pm »
So,

I inherited this project from a coworker who is no longer with the company.  It creates a windows executable, originally made on Slickedit which used C::B and g++ to compile.  I was able to run the code just fine with Slickedit, but since my trial version is over I am trying to port the whole project to C::B.  I have gotten the project (now in C::B) to build w/o error.  However, the executable it creates does not work, at all.  Since I have no idea how (if you even can) compare executable files other than a hex compare, all I can say is the C::B created .exe is about 1/4 the size of the Slickedit created .exe.

Again, it seems to be building fine (w/o error that is), but the resultant .exe doesn't do anything.  I have been looking towards the linker, but since I dont know a great deal about that step, I am not sure if its worth spending time looking at.  I realize I am not giving much information for you all to be able to help me with, but any general direction would be much appreciated.  If you need any more specific information about the project, I would be glad to provide it.

Thanks in advance,
BigC

edit:
additional information:

I have found that my .exe is doing "something" (see message below).  But this again leads me to believe the linker isn't doing it's job.



I/O warning : failed to load external entity "MyXMLfile.xml"
.
.
(bunch of unimportant stuff)
.
.
Process returned 0 (0x0)    execution time : 0.171 s
Press any key to continue.
« Last Edit: May 27, 2010, 09:54:18 pm by BigC »

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: help with first C::B project!
« Reply #1 on: May 27, 2010, 08:59:24 pm »
I inherited this project from a coworker who is no longer with the company.  It creates a windows executable, originally made on Slickedit which used C::B and g++ to compile.  I was able to run the code just fine with Slickedit, but since my trial version is over I am trying to port the whole project to C::B.  I have gotten the project (now in C::B) to build w/o error.  However, the executable it creates does not work, at all.  Since I have no idea how (if you even can) compare executable files other than a hex compare, all I can say is the C::B created .exe is about 1/4 the size of the Slickedit created .exe.
Very hard to analyse if not having the full project. I would suggest you:
- verify you are using EXACTLY the same libraries 7 compiler framework for compiling / linking,
- you are using EXACTLY the same settings which you can verify by the EXACT command line used Slickedit (whatever that is) and Code::Blocks.

See my sig how to enable full compiler logging and compare the output of C::B with the one of Slickedit.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

BigC

  • Guest
Re: help with first C::B project!
« Reply #2 on: May 27, 2010, 09:31:18 pm »
Thanks for the response Mort.  Unfortunately, since my trial license for Slickedit has expired, I am unable to open the original project.

- verify you are using EXACTLY the same libraries 7 compiler framework for compiling / linking,

Forgive me for being simple, trying to get up to speed with C::B.  Do you mean to make sure that i am using the same compiler framework between the original Slickedit project and my new C::B project?  Or do you suggest I may be simply using improper compilers/linkers w/ C::B?  Using mingw32-g++ for compiler and linker (all of the code is written in c++ btw).

- you are using EXACTLY the same settings which you can verify by the EXACT command line used Slickedit (whatever that is) and Code::Blocks.

Thanks for showing me how to enable this, I have no doubt it will come in handy.  However, I cannot compare the output to the same from Slickedit as I can no longer use Slickedit.

Any more insight would be great.  If you (or anyone else) needs any more information to form any ideas, just let me know what you need.

Thanks again

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: help with first C::B project!
« Reply #3 on: May 27, 2010, 09:57:14 pm »
Do you mean to make sure that i am using the same compiler framework between the original Slickedit project and my new C::B project?
Yes. If Slickedit ships with a GCC compiler this should still be working as it is GPL. If it ships with an own (non-GPL?!) based compiler that you have no access to, you might be unable to compare. Different compiler version = different set of libraries = might be cause of the error!

Do you us any other than the standard C/C++ (STL or alike) libs?
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

BigC

  • Guest
Re: help with first C::B project!
« Reply #4 on: May 27, 2010, 10:17:20 pm »
Slickedit (as far as I know) is only a code editor, it does not ship with its own compilers.  The original Slickedit project (my coworker made) used the mingw g++ compiler, so I am hoping I am ok there.

I am using standard C/C++ libs and libxml2 for use with XML files.  If you see the edit I made on my OP, my .exe is not able to open the XML file, in conjunction with the size difference in the Slickedit .exe and my C::B .exe, leads me to believe a problem with linker settings.  But I have included the libxml2.lib in Project>>Build Options>>Linker Settings.  Does it matter if i use a "relative path" for it or not?  I have also added the libxml2 directory to Project>>Build Options>>Search Directories>>Linker.

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7591
    • My Best Post
Re: help with first C::B project!
« Reply #5 on: May 27, 2010, 10:51:39 pm »
I think you need to find all the documentation about the prior build system.
(it is not obvious if you know what the prior build system was. You implied Slick Edit and Code::Blocks; then later implied neither was the build system used.)
Then, read the documentation and ask questions in a site that supports that past build system.

I have not yet seen any Code::Blocks related questions.

When, you find out enough to ask Code::Blocks questions then feel free to ask in this thread.

Note, the size change could be that the prior person build a debug version of the program.

The message you gave implies you are NOT supplying a needed external file, "MyXMLfile.xml", to the program where it is looking for it.

Tim S.

Edit: Added what I consider build system/tools (Things that create Makefile and etc. and things that uses Makefile and etc. to create file object/executable code.)
http://en.wikipedia.org/wiki/Build_Automation
http://en.wikipedia.org/wiki/Makefile
« Last Edit: May 28, 2010, 01:05:07 am by stahta01 »
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: help with first C::B project!
« Reply #6 on: May 28, 2010, 07:01:33 am »
The message you gave implies you are NOT supplying a needed external file, "MyXMLfile.xml", to the program where it is looking for it.
That would be my guess, too. You probably don't realise that your are starting the application from inside C::B in a specific folder, usually where the project file is. You can adjust it in the project properties or provide a full path to the file.

However, I think your application is quite buggy if it "handles" operating non-existent (or non-accessible) XML files with a crash. So you should start using the debugger, but here you are on your own. Place a breakpoint and see step-by-step what exactly is happening.

I can't help you more than that. Sorry.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

BigC

  • Guest
Re: help with first C::B project!
« Reply #7 on: May 28, 2010, 09:16:33 pm »
You probably don't realise that your are starting the application from inside C::B in a specific folder, usually where the project file is. You can adjust it in the project properties or provide a full path to the file.

this was part of it, it seems (among other things) i had some issues with the various file paths for my project

thanks for your help