Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error compiling release 1.1 #6

Closed
KevinShook opened this issue Feb 5, 2021 · 23 comments
Closed

Error compiling release 1.1 #6

KevinShook opened this issue Feb 5, 2021 · 23 comments
Assignees

Comments

@KevinShook
Copy link
Collaborator

I attempted to make release 1.1 using gcc, but it did not complete, and returns this error message

/usr/bin/ld: obj/StandardConverterUtility.o: in function std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > __gnu_cxx::__to_xstring<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, char>(int (*)(char*, unsigned long, char const*, __va_list_tag*), unsigned long, char const*, ...)': /usr/include/c++/9/ext/string_conversions.h:105: undefined reference to ___chkstk_ms'
collect2: error: ld returned 1 exit status
make: *** [Makefile:95: crhm] Error 1

In addition it returns many examples of this warning:
cc1plus: warning: ‘-fstack-check=’ and ‘-fstack-clash_protection’ are mutually exclusive. Disabling ‘-fstack-check=’
I was compiling on Linux Mint 20.1, using boost 1.73, and gcc version 9.3.0

@jhs507
Copy link
Collaborator

jhs507 commented Feb 8, 2021

Sorry, about this Kevin. Just to confirm you get this error when using the makefile in the release1.1 folder after checking out the master branch?

Have you run "make clean" before attempting to make?

@KevinShook
Copy link
Collaborator Author

KevinShook commented Feb 8, 2021

Yep.I am on the master branch, in the release1.1 folder
~/data/projects/crhmcode/release1.1 $ git show-branch [master] Alteration to ClassWQ_Netrout.cpp based on version of water modules recived from Diogo.
I ran make clean first, before running make.
I've attached a complete listing of the make output.
crhmcodemake.txt

@jhs507
Copy link
Collaborator

jhs507 commented Feb 8, 2021

I was previously using gcc 7.5 but I just checked with version 9.3.0 on Ubuntu and it compiled for me.

Based on the error message you receive it looks like one of your c++ std lib files was possibly compiled with a older version of gcc. Can you recompile your std lib c++ files and try to make again?

@KevinShook
Copy link
Collaborator Author

I do have the version 9 c++ std lib files installed:
image

However, version 6 is also installed. Is make not finding the correct version?

K

@jhs507
Copy link
Collaborator

jhs507 commented Feb 8, 2021

I doubt that is the case but if you add these two lines into the makefile for the crhm target then we can verify it for sure.
gcc --version g++ --version

crhm: $(OBJ)
$(CC) -o $@ $^ $(CFLAGS) $(DFLAGS) $(LIBS)
gcc --version
g++ --version

@jhs507
Copy link
Collaborator

jhs507 commented Feb 8, 2021

Actually this seems to be an instance of this known error. https://gcc.gnu.org/onlinedocs/libstdc++/manual/using_dual_abi.html

It is leading me to believe that it is your version of the boost library that was compiled with and older version of gcc.

if you recompile boost with a newer gcc or download a new version it should hopefully fix this issue.

@KevinShook
Copy link
Collaborator Author

Ah, that makes sense.
Thanks, I'll try a newer version.
BTW, I but the commands in the makefile but got the error message
Makefile:96: *** missing separator. Stop.

Where line 96 is
gcc --version

I'll update my version of boost and will try again.

K

@jhs507
Copy link
Collaborator

jhs507 commented Feb 8, 2021

Those lines will need to be indented to be part of the crhm target sorry my formatting here was ambiguous.

@KevinShook
Copy link
Collaborator Author

KevinShook commented Feb 8, 2021

Sorry - responded to the wrong message

I re-downloaded boost 1.73 and get the same error.

/usr/include/c++/9/ext/string_conversions.h:105: undefined reference to `___chkstk_ms'
collect2: error: ld returned 1 exit status

Did make clean first
I tabbed in the two lines

crhm: $(OBJ)
    $(CC) -o $@ $^ $(CFLAGS) $(DFLAGS) $(LIBS)
    gcc --version
    g++ --version

and get the same error:

$ make clean  
Makefile:96: *** missing separator.  Stop.

I also upgraded to boost 1.75 and still get the same error

@jhs507
Copy link
Collaborator

jhs507 commented Feb 8, 2021

Interesting I thought for sure that was it. Where did you get your boost library from?

@KevinShook
Copy link
Collaborator Author

Downloaded it directly from https://www.boost.org/

@jhs507
Copy link
Collaborator

jhs507 commented Feb 8, 2021

I will try with boost 1.75 and see if I can recreate your error.

@jhs507
Copy link
Collaborator

jhs507 commented Feb 8, 2021

I am able to compile with gcc 9.3.0 and boost 1.75.0.

The missing separator error that make is producing is most likely caused by using 4 spaces as a tab instead of a tab character. Unfortunately make requires actual tab chars not just spaces.

@KevinShook
Copy link
Collaborator Author

You were right. I forgot that my editor was set up to convert tabs to spaces.
Thanks.
I still get the same error message.
I've attached the output.
crhmcodemake.txt

I was wondering since it says the problem is:
/usr/include/c++/9/ext/string_conversions.h:105: undefined reference to ___chkstk_ms'`
if we should check to see if we have the same version of string_conversions.h?

@KevinShook
Copy link
Collaborator Author

I tried googling the error, and most of the results indicate that chkstk_ms is for Windows - is that right?

@jhs507
Copy link
Collaborator

jhs507 commented Feb 9, 2021

check to see if we have the same version of string_conversions.h

Sure can you locate the file on your system and upload it here.

However since it is a library file they may differ due to system architecture ect...

I tried googling the error, and most of the results indicate that chkstk_ms is for Windows - is that right?

It seems to be related to the MinGW compiler which neither of us are using so I do find that confusing.

@KevinShook
Copy link
Collaborator Author

Here's my string_conversions.h
string_conversions.h.zip

The error refers to line 105
/usr/include/c++/9/ext/string_conversions.h:105: undefined reference to ___chkstk_ms'`

In my file, line 105 is

_CharT* __s = static_cast<_CharT*>(__builtin_alloca(sizeof(_CharT) * __n));

@KevinShook
Copy link
Collaborator Author

Are we sure that we are both using the same version of Makefile?
Here's mine
Makefile.zip

@jhs507
Copy link
Collaborator

jhs507 commented Feb 9, 2021

Our string_conversions.h and makefile are identical.

I have compiled with boost 1.73.0, 1.74.0, and 1.75.0 and gcc 9.3.0 without error.

@jhs507
Copy link
Collaborator

jhs507 commented Feb 9, 2021

Peter had an issue with the -mstack-arg-probe flag earlier.

We actually shouldn't need any of the flags in the DFLAGS statement I just haven't gotten around to updating the makefile. Can you try leaving the DFLAGS statement empty?

@KevinShook
Copy link
Collaborator Author

I'll give it a try

@jhs507 jhs507 self-assigned this Feb 9, 2021
@KevinShook
Copy link
Collaborator Author

I commented out the DFLAGS and it now compiles without any errors.]
I will now test the program with one of our newer models.
Thanks for the help.

@jhs507
Copy link
Collaborator

jhs507 commented Feb 9, 2021

Awesome I will commit a new version of the makefile without so many DFLAGS that can cause issues.

@jhs507 jhs507 closed this as completed Feb 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants