Author Topic: Cant build simple hello world dll  (Read 11191 times)

Offline mighter

  • Single posting newcomer
  • *
  • Posts: 3
Cant build simple hello world dll
« on: May 13, 2008, 07:04:53 am »
Hi all, first of all sorry if this is in the wrong section. It was a choice between this forums or the help one :shock: . I followed all instructions on this: http://wiki.codeblocks.org/index.php?title=Installing_Code::Blocks_from_source_on_Windows tutorial. Then i proceeded to do everything on this: http://wiki.codeblocks.org/index.php/Creating_a_simple_%22Hello_World%22_plugin tutorial. I get one error during build, "ld.exe cannot find -lcodeblocks." I looked through linking options etc. and couldn't find anything. Any help is appreciated.

Also, there is no src\sdk\include but there is a  src\include so i used that. And i dont get any errors except for the above, just thought that might have something to do with the problem. Thanks in advance.

P.S. im running vista 32 bit.

Offline Seronis

  • Almost regular
  • **
  • Posts: 197
Re: Cant build simple hello world dll
« Reply #1 on: May 13, 2008, 02:46:58 pm »
Quote
Developer forums (C::B DEVELOPMENT STRICTLY!)
Quote
Plugins development
Anything related to modifying or writing new plugins should be discussed here.

That said...

Personally with as annoying as vista is, id just use the vista specific installer and not build codeblocks itself from source until you get the binary release working without issues.  At least then when you try to build codeblocks you will know your environment is properly set up.
« Last Edit: May 13, 2008, 02:51:24 pm by Seronis »

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: Cant build simple hello world dll
« Reply #2 on: May 13, 2008, 03:23:13 pm »
"ld.exe cannot find -lcodeblocks."
With 08.02 we haven't shipped an SDK explicitly. But all you need to do it to link against the C::B DLL shipping with the binary and using the source code of the 08.02 source code provided for download. BTW: You need to link against the wx DLL, too most likely.

Also, there is no src\sdk\include but there is a  src\include so i used that.
That's fully correct. The article is "a bit" outdated. :oops:

Personally with as annoying as vista is,
Seronis: Please, no flaming - I personally like Vista a lot. It's way better than XP IMHO - so you see, everyone has it's own experience. Flaming leads to nowhere.

id just use the vista specific installer
Seronis: Don't know how this will help a lot... He is trying to create a C::B plugin! Not just run C::B.

At least then when you try to build codeblocks you will know your environment is properly set up.
Probably that's another possibility: You can surely compile C::B from the sources yourself. You'll get all required libs in return plus a brand-new C::B which has already improved a lot again compared to 08.02... Your choice. ;-)
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

Offline mighter

  • Single posting newcomer
  • *
  • Posts: 3
Re: Cant build simple hello world dll
« Reply #3 on: May 13, 2008, 09:09:15 pm »
First of all thanks for the help, Before I attempted to make a C::B plugin I already had a working version of C::B, then i downloaded the sources and built everything. So i actually have 2 C::B on my hardrive, both working.

Quote
With 08.02 we haven't shipped an SDK explicitly. But all you need to do it to link against the C::B DLL shipping with the binary and using the source code of the 08.02 source code provided for download. BTW: You need to link against the wx DLL, too most likely.
I tried linking with libcodeblocks.a and libwxscintilla.a and also put the directory it's in in the search directory, But it still doesn't work. Is that what you meant to link against?

Offline Seronis

  • Almost regular
  • **
  • Posts: 197
Re: Cant build simple hello world dll
« Reply #4 on: May 14, 2008, 07:44:56 am »
Seronis: Please, no flaming - I personally like Vista a lot. It's way better than XP IMHO - so you see, everyone has it's own experience. Flaming leads to nowhere.
Not meant to be a flame really.  Vista has many well known 'issues'.  I cant stand using it, but in its favor a majority of its issues is from programs written for XP being used on it.  You just need to use software written specifically for Vista compatibility and you're good.

Specifically I personally was having a lot of linking errors until i got the right updates to gcc.  Which makes vista annoying to me, but is technically a gcc issue (that has been resolved if you have the right packages).  MY problems with vista looked similar to the OPs problems.

Sorry for the misunderstanding.


id just use the vista specific installer
Seronis: Don't know how this will help a lot... He is trying to create a C::B plugin! Not just run C::B.
At least then when you try to build codeblocks you will know your environment is properly set up.
Probably that's another possibility: You can surely compile C::B from the sources yourself. You'll get all required libs in return plus a brand-new C::B which has already improved a lot again compared to 08.02... Your choice. ;-)
Again I was referring to what the problem appeared to me at first read.  That he might have had the non vista friendly version of gcc causing the link issues.  Nothing more =-)

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: Cant build simple hello world dll
« Reply #5 on: May 14, 2008, 09:04:43 am »
I tried linking with libcodeblocks.a and libwxscintilla.a and also put the directory it's in in the search directory, But it still doesn't work. Is that what you meant to link against?
Not really. There are 2 possibilities:
1.) Compile C::B completely yourself, remove any references to 08.02. Then you can (and should) use libcodeblocks.a and libwxscintilla.a.
2.) Use C::B 08.02 with the sources of 08.02. Then you have to use codeblocks.dll to link against. Don't forget to remove any referbnces to SVN sources, then.

For clarification: This all applies to MinGW only. That's the only supported compiler for building C::B plugins (not other applications). With MinGW (GCC) you can link against static libraries (*.a) and dynamic libraries (*.so/*.DLL) just fine.

Probably you should decide which way to go and then post your project here for inspection.
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

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: Cant build simple hello world dll
« Reply #6 on: May 14, 2008, 09:13:19 am »
I cant stand using it, but in its favor a majority of its issues is from programs written for XP being used on it.  You just need to use software written specifically for Vista compatibility and you're good.
I have only very few applications written especially for Vista (these are e.g. applications which needed an adoption of the driver model or alike). Mostly if an application does not run under Vista in my opinion it's grab. Vista just forces what all dev's should have been taken care of at XP already. The idea is good but if devs are just too damn lazy/dumb to implement the right API instead of an "easy work-around" I don't wonder why those applications don't run on Vista. They actually shouldn't have run on XP, too IMHO. So - my personal opinion: If you realise an application not working under Vista but under XP - wipe it off... it's useless and most likely even dangerous. I did exactly that (I am still working with XP at work) and I can live with it very well.
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

Offline mighter

  • Single posting newcomer
  • *
  • Posts: 3
Re: Cant build simple hello world dll
« Reply #7 on: May 14, 2008, 09:30:59 am »
After linking to codeblocks.dll and changing 'codeblocks' in linker options to src\devel\libcodeblocks.a it built fine :D. Thank you for all of your help!