LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 02-18-2023, 12:07 PM   #1
jmgibson1981
Senior Member
 
Registered: Jun 2015
Location: Tucson, AZ USA
Distribution: Debian
Posts: 1,141

Rep: Reputation: 392Reputation: 392Reputation: 392Reputation: 392
IDE Troubles. Errors that don't exist.


Using Codeblocks on the my source found here

https://gitlab.com/jmgibson1981/mycp...les/File%20Ops

It fails with 2 errors to even compile in CodeBlocks. The first error is
Code:
line 58 multiple definition of `file_search_func';obj/Debug/mycprogress/Source Files/File Ops/fileprocess.c
and followed by this

Code:
error: ld returned 1 exit status
I chased my tail with this for awhile. Then for some reason I compiled manually with gcc in the terminal, same options
Code:
-Wall -O1
and it compiled without a word. My function works just fine. I cannot explain the failure to build at all or why this failure is limited to CodeBlocks.

I thought I might have some cruft in the project folder, so I created a new project and imported these 2 source files. Same result. I'm at a loss. I like the IDE, it helps me find my syntax errors (which are thankfully getting fewer and fewer) but this just baffles me. Especially considering it's set to use GCC... I just don't get it.
 
Old 02-18-2023, 03:07 PM   #2
jailbait
LQ Guru
 
Registered: Feb 2003
Location: Virginia, USA
Distribution: Debian 12
Posts: 8,337

Rep: Reputation: 548Reputation: 548Reputation: 548Reputation: 548Reputation: 548Reputation: 548
My guess is that Codeblocks is mishandling the spaces that you have in: `file_search_func';obj/Debug/mycprogress/Source Files/File Ops/fileprocess.c

Perhaps you could put in escape characters that are recognized by both C and Codeblocks if there is such a thing.

Or if the names aren't set in stone yet you could use underlines instead of spaces.

Last edited by jailbait; 02-18-2023 at 03:21 PM.
 
Old 02-18-2023, 04:33 PM   #3
jmgibson1981
Senior Member
 
Registered: Jun 2015
Location: Tucson, AZ USA
Distribution: Debian
Posts: 1,141

Original Poster
Rep: Reputation: 392Reputation: 392Reputation: 392Reputation: 392
I'm assuming you are talking about the path folders? If so then it made no change. changed them to lowercase _ separated names.

I may try to build on Windows, if only to see if that changes anything. It is an odd one.

*EDIT*

Same issue on Windows, slightly different wording. However in Visual Studio Code back on my kubuntu side it compiles and debugs clean.

Last edited by jmgibson1981; 02-18-2023 at 04:46 PM.
 
Old 02-18-2023, 09:10 PM   #4
ntubski
Senior Member
 
Registered: Nov 2005
Distribution: Debian, Arch
Posts: 3,781

Rep: Reputation: 2082Reputation: 2082Reputation: 2082Reputation: 2082Reputation: 2082Reputation: 2082Reputation: 2082Reputation: 2082Reputation: 2082Reputation: 2082Reputation: 2082
Plausible answer at: https://stackoverflow.com/questions/...-in-codeblocks

Quote:
Originally Posted by podgyhodgy
when adding a file in codeblocks using file - new etc there is a screen which asks if you want to include the file in debug and release versions. you innocently answer yes by ticking the boxes. the result is the file is automatically included and when you explicitly include it yourself you end up duplicating. so, dont tick those boxes.
 
Old 02-18-2023, 10:08 PM   #5
NevemTeve
Senior Member
 
Registered: Oct 2011
Location: Budapest
Distribution: Debian/GNU/Linux, AIX
Posts: 4,866
Blog Entries: 1

Rep: Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869
Remove this line from your mylibs.h file:
Code:
#include "fileprocess.c"
Only *.h files are mean't to be included into other files.
 
1 members found this post helpful.
Old 02-20-2023, 05:01 PM   #6
jmgibson1981
Senior Member
 
Registered: Jun 2015
Location: Tucson, AZ USA
Distribution: Debian
Posts: 1,141

Original Poster
Rep: Reputation: 392Reputation: 392Reputation: 392Reputation: 392
Well played. Thank you much. Worked just perfectly. So it will automatically check for the functions in any file in the project?
 
Old 02-20-2023, 10:00 PM   #7
NevemTeve
Senior Member
 
Registered: Oct 2011
Location: Budapest
Distribution: Debian/GNU/Linux, AIX
Posts: 4,866
Blog Entries: 1

Rep: Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869
I would start here: https://en.wikipedia.org/wiki/Linker_(computing)
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Selenium: Check whether button exist or not and if exist whether the the text is in it is desired one or not daichiash General 0 07-03-2020 10:17 AM
[SOLVED] cannot login to funtoo linux. UID 0 does not exist. no users or groups seem to exist. whansard Linux - Security 1 12-19-2018 03:40 AM
Errors, Errors, and more Errors (KDE 3.4.x GUI Errors) Dralnu Linux - Software 2 05-13-2006 08:30 AM
DiskOnKey troubles (does not exist) hobylinux Linux - Hardware 6 08-28-2003 10:18 AM
ide-scsi /dev/scd0 doesn't exist freenet Linux - Hardware 1 07-09-2003 06:39 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 10:39 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration