Author Topic: Cannot unlink library  (Read 4084 times)

Offline qrayx

  • Single posting newcomer
  • *
  • Posts: 2
Cannot unlink library
« on: February 05, 2015, 11:06:10 pm »
Hello,

I am still new to Code::Blocks (using 13.12), and very new to the Lubuntu OS. I have somehow managed to break my IDE, and I don’t know how to fix it.

I was trying to use the third party NMEA library (for GPS stuff) from an older project, and was having trouble linking to the library. After some frustration, I decided to build a fresh, clean project. When I created the new project, and just tried to build the default Hello World file that is automatically generated, I still got the same errors. I’m not even telling my new project to look for the library yet, and my compiler search directory and link libraries are all empty. I don’t understand why it’s still trying to find the third party library.

When I try to build the default project, I get this error message in the build log.

/usr/bin/ld: cannot find /home/......./nmealib: File format not recognized

I tried removing the library from the directory, which resulted in

g++: error: cannot find /home/......./nmealib: No such file or directory

(also, I’m using a c file, so I don’t see why g++ is being used instead of gcc)

My usual MO in cases like this is to do a fresh install to reset everything. I did a fresh install of Code::Blocks, g++, and ld (binutils). I created a fresh project after all that. The problem still persists.

I tried compiling the c file (with gcc) outside of Code::Blocks using a makefile, and that worked properly (so I’m assuming it’s not gcc’s fault).

At this point, I don’t even want to link to the nmea library. I just want Code::Blocks or the linker to stop looking for the NMEA library at all. Does anyone know if this is a Code::Blocks issue or a ld issue? If it’s a Code::Blocks issue, where might I look to solve this problem?

Thank you for your time.

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13406
    • Travis build status
Re: Cannot unlink library
« Reply #1 on: February 05, 2015, 11:09:03 pm »
(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!]

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7786
    • My Best Post
Re: Cannot unlink library
« Reply #2 on: February 05, 2015, 11:11:41 pm »
Read this FAQ. http://wiki.codeblocks.org/index.php?title=FAQ-Compiling_%28general%29#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
Then, undo the changes you likely did to the Global Compiler Settings.
It is best that newbies never do any global Compiler settings changes.

Tim S.
C Programmer working to learn more about C++ and Git.
On Windows 10 64 bit and Windows 11 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline qrayx

  • Single posting newcomer
  • *
  • Posts: 2
Re: Cannot unlink library
« Reply #3 on: February 06, 2015, 07:10:34 pm »
Thank you so much. The problem was in the global settings. I was not even aware of the global settings, and don't know how they were changed (possibly from when the project was originally ported over). Everywhere else kept telling me to look at the Project settings.

Again, thank you for your help.