### Author Topic: Getting undefined reference errors when building target is release.[resolved]  (Read 4011 times)

#### zalzane

• Single posting newcomer
• Posts: 7
##### Getting undefined reference errors when building target is release.[resolved]
« on: December 06, 2010, 07:46:25 am »
Hi, I've been using codeblocks and made a program that uses the SDL library. I got the program working fine and dandy while the build target was set to 'Debug', but when I changed it to release, I got an undefined error for each of the SDL methods that I had called in my code like the ones below. Halp?

Code
obj\Release\text.o:text.cpp|| undefined reference to SDL_Init'|e:\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\libmingw32.a(main.o):main.c|| undefined reference to WinMain@16'|

Problem was that there are two sets of build options, one for release and one for debug. I only had my linker setup for debug. Resolved.
« Last Edit: December 06, 2010, 11:40:55 am by zalzane »

#### oBFusCATed

• Developer
• Lives here!
• Posts: 13438
##### Re: Getting undefined reference errors when building target is release.
« Reply #1 on: December 06, 2010, 08:37:38 am »
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]