Author Topic: I have a problem I can't figure out with CodeBlocks  (Read 163 times)

Offline GMcoder

  • Single posting newcomer
  • *
  • Posts: 3
I have a problem I can't figure out with CodeBlocks
« on: February 06, 2018, 12:35:08 am »
I read the sticky above before making this thread.  Feel free to delete this thread if you don't feel it is necessary, but I would not have posted it if I didn't feel it was relevant.

The sticky suggests that the linker/compiler errors are not related to CodeBlocks, and that we should look else where, but this particular problem I believe is related to CodeBlocks.

Originally, I got SFML to work with CodeBlocks.  I added the libraries, and everything worked fine.

Now, I decided to do an all new project from scratch, WITHOUT using SFML at all.

I made a simple project with an empty file, and I'm trying to run the simple Hello World program.

This is the linker/compiler error I am getting:

||=== Clean: Debug in some (compiler: GNU GCC Compiler) ===|
||=== Run: Debug in some (compiler: GNU GCC Compiler) ===|
||=== Build: Debug in some (compiler: GNU GCC Compiler) ===|
||=== Build: Debug in some (compiler: GNU GCC Compiler) ===|
ld.exe||cannot find -lsfml-graphics-s|
ld.exe||cannot find -lfreetype|
ld.exe||cannot find -ljpeg|
ld.exe||cannot find -lsfml-window-s|
ld.exe||cannot find -lsfml-audio-s|
ld.exe||cannot find -lopenal32|
ld.exe||cannot find -lflac|
ld.exe||cannot find -lvorbisenc|
ld.exe||cannot find -lvorbisfile|
ld.exe||cannot find -lvorbis|
ld.exe||cannot find -logg|
ld.exe||cannot find -lsfml-network-s|
ld.exe||cannot find -lsfml-system-s|
||error: ld returned 1 exit status|
||=== Build failed: 14 error(s), 0 warning(s) (0 minute(s), 5 second(s)) ===|

Those are all of the errors I'm getting.

But here is where CodeBlocks comes in:

I have nothing in the linker or compiler settings of the IDE!

Nothing!

It's looking for these SFML libraries, but I have nothing in listed in the Project Build options.

Why is it checking for SMFL libraries when I don't want them, and they are not listed in the linker settings and search directories of the CodeBlocks Project Build options?

Any help would be greatly appreciated.

Thanks.

Offline stahta01

  • Lives here!
  • ****
  • Posts: 6079
    • My Best Post
Re: I have a problem I can't figure out with CodeBlocks
« Reply #1 on: February 06, 2018, 12:40:41 am »
Do NOT add libraries to the CB Global compiler settings!

Remove the libraries you added to the CB Global compiler settings.

Edit: Added link http://wiki.codeblocks.org/index.php/FAQ-Compiling_(general)#Q:_I_would_like_to_compile_a_project_using_some_non-standard_libraries._How_can_I_indicate_to_CodeBlocks_that_these_libraries_and_include_files_exist.3F

Tim S.
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 32 bit.
On Debian Testing, compiling CB Trunk against wxWidgets 3.0.2.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline GMcoder

  • Single posting newcomer
  • *
  • Posts: 3
Re: I have a problem I can't figure out with CodeBlocks
« Reply #2 on: February 06, 2018, 12:49:57 am »
Thank you stahta01.  That was very helpful.

Can I ask you this though--I don't remember adding those files to the global compiler settings.  I may have, but I certainly don't remember adding them there directly.  Is it possible that they could have been automatically added there after adding the libraries in the project build options, and then successfully running the program the first time around?

Offline stahta01

  • Lives here!
  • ****
  • Posts: 6079
    • My Best Post
Re: I have a problem I can't figure out with CodeBlocks
« Reply #3 on: February 06, 2018, 01:02:12 am »
Thank you stahta01.  That was very helpful.

Can I ask you this though--I don't remember adding those files to the global compiler settings.  I may have, but I certainly don't remember adding them there directly.  Is it possible that they could have been automatically added there after adding the libraries in the project build options, and then successfully running the program the first time around?

No, They were added by someone using the computer you are using.

Tim S.
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 32 bit.
On Debian Testing, compiling CB Trunk against wxWidgets 3.0.2.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org