Author Topic: Linking Problem with DevCpp Project  (Read 7112 times)

ck

  • Guest
Linking Problem with DevCpp Project
« on: May 02, 2005, 07:42:31 pm »
hiho!
I just downloaded CB and must say I'm really impressed by the IDE :)
anyhow, I've yet to get MinGW to work - at first I thougth this would be a piece of cake, but it proved to be a pain in the butt ...
Whenever I try to compile my project the compiler runs through without problem, but the linker tells me the following:

Quote

Linking executable: ..\BUILD\spash.exe
C:\Program Files\CodeBlocks\bin\..\lib\gcc\mingw32\3.4.2\..\..\..\..\mingw32\bin\ld.exe: cannot find -lmingw32 -lSDLmain -lSDL -lopengl32
collect2: ld returned 1 exit status
Process terminated with status 1 (0 minutes, 0 seconds)


I guess this is some sort of config-issue, but as of now I've not yet found the souce of the problem :(

Offline mandrav

  • Project Leader
  • Administrator
  • Lives here!
  • *****
  • Posts: 4315
    • Code::Blocks IDE
Linking Problem with DevCpp Project
« Reply #1 on: May 02, 2005, 07:59:12 pm »
Go to Compiler->Compiler options->Directories->Linker and add "C:\Program Files\CodeBlocks\lib" in it.

Yiannis.
Be patient!
This bug will be fixed soon...

Anonymous

  • Guest
Linking Problem with DevCpp Project
« Reply #2 on: May 02, 2005, 08:02:27 pm »
well ... that one is already there

ck

  • Guest
Linking Problem with DevCpp Project
« Reply #3 on: May 02, 2005, 08:03:56 pm »
oops - forgot to type my name

thanks for the fast reply, but that directory was added by default and is therefore already there :(

Offline rickg22

  • Lives here!
  • ****
  • Posts: 2283
Linking Problem with DevCpp Project
« Reply #4 on: May 02, 2005, 09:16:29 pm »
Try searching your directories for "libmingw32.a". Then add that directory to the config and please report back to us! Config bugs (the ones that frustrate newbies most) are in our top priorities to fix.

BTW, are you using "makefiles" or "direct compilation"? (Check your compiler options under 'advanced' tab).

P.S. There's a bug in the web forums, they keep showing your name as "guest" even if you type a name. Please sign with your name or nick below your post (or even better, register as a user - it's free) so we can identify you and call you by your name (you don't want to be called "Guest #384", do you? ;-) )

Second. I notice there's OpenGL included in your project. Perhaps you added some options to your dev-cpp compiler settings, and these were NOT included in your dev-cpp project file.

cerealkiller

  • Guest
Linking Problem with DevCpp Project
« Reply #5 on: May 02, 2005, 10:50:27 pm »
seems to work now, after I manually added libmingw32. I used "direct compilation", didn't fiddle around with GL settings and the like.
Anyhow, I get another error, stating, that there's no WinMain( fair enough - I don't use one, rather "int main(int Arg_N, char ** Arg_V)"

The compiler error is:
C:\Program Files\CodeBlocks\lib\libmingw32.a(main.o)(.text+0x106):main.c: undefined reference to `[email protected]'
collect2: ld returned 1 exit status
Process terminated with status 1 (0 minutes, 0 seconds)

cheers & thanks a lot for the quick help

ck

Offline rickg22

  • Lives here!
  • ****
  • Posts: 2283
Linking Problem with DevCpp Project
« Reply #6 on: May 02, 2005, 11:26:39 pm »
OK question. Are you using a wxwidgets project?
If not, is your project is a console (DOS) project, or a windows project?

There is a -mwindows switch for windows projects that inhibits the use of a console. If that doesn't work, then...

The best thing to do in this case, is to create a *new* project, and add your files manually. (warning: Beta 7 has a display bug that shows the files as having no names). Save the project, then reopen it and start adding files.

Also please post your problem in the bug reports at sourceforge.net. Please attach the project file and your dev-cpp configuration files (wherever they are :-/ ).

And don't despair, beta 8 is going to be released soon.